PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: b_w_johan on 12 July, 2005, 12:09:00

Title: how to save to file ?
Post by: b_w_johan on 12 July, 2005, 12:09:00
function TCPReceive(client,key)
  print(""..key.."|")
end

this part searches for string and prints what is shown.

now im looking for a way to save this string to a file.

tried to copy from other scripts. but somehow im not getting this saving to work.

can someone help with this??

giving correct code will be cool but with --editors notes
about what what does it would be even better =-p

its im realy hoping to get this to work then my public hublist can be released =-p, seems to work now =-p but only problem is its not saving its only printing in my program now =-p

Greetings b_w_johan
Title:
Post by: b_w_johan on 12 July, 2005, 12:31:02
im gonna even make it more difficult:-)

ok you get i want to "catch" the "..key.." and save that to file.

how can i "sort it out" before saving ..


$Key p|name|address|discrip|users|sharing|

i want the .conf file to be orden't at address

so the A will be above the B and so on =-p
Title:
Post by: b_w_johan on 12 July, 2005, 12:38:23
thank you pur you helped me saving the file now need to find out ordening
[12:31]
   filename = "./hublist.conf"
   local str = ""
    file = io.output(filename)
   file:write(str)
   file:close()

hope someone can help by organizing by address

greetings johan
Title:
Post by: Dessamator on 12 July, 2005, 14:50:48
QuoteOriginally posted by b_w_johan
im gonna even make it more difficult:-)

ok you get i want to "catch" the "..key.." and save that to file.

how can i "sort it out" before saving ..


$Key p|name|address|discrip|users|sharing|

i want the .conf file to be orden't at address

so the A will be above the B and so on =-p

what happens when u run out of alphabet letters?, by the way what does the key contain initially?
Title:
Post by: plop on 12 July, 2005, 18:01:22
build an array with all hub adresses, and do a table.sort(array) on that.
next parse the full table by looping the same array 2 index the table.
check public kick battle V2 for more hints, or any other script with stats/top10.

plop