PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Tarokkk on 20 December, 2003, 17:51:41

Title: Overwrite something
Post by: Tarokkk on 20 December, 2003, 17:51:41
I would like a script what open a file and write over sg.

For exapmple

seetings.ini => ISP = 1
                         Ban = 1
...........

And for example !set ISP 0

seetings.ini => ISP = 0
                         Ban = 1
Title: PLS help me
Post by: Tarokkk on 21 December, 2003, 13:17:21
?(  ?(  ?(  ?(  ?(  ?(  ?(

Pls help me. I ask for a script what Overwrite something in a settings File.....


----------------
Version = 0
Bot = 1
ISP = 1

----->>> ForExample: !set Bot Sg

Version = 0
Bot = Sg
ISP = 1


Thx.
Title:
Post by: Tarokkk on 22 December, 2003, 17:47:44
Psl somebody help me.

I learn scripting with Lua and I make a Bot... And I would like to use this function ...  ;(   :(  

................................................................................
Title:
Post by: plop on 23 December, 2003, 16:06:05
ok as you wanne learn i'll only give the outline of what 2 do.

1) open the settings file
2) stuff every line in2 a table
3) compair every line 2 match the line you want 2 change
4) remove the old file
5) save the table 2 a new file
6) close the file

plop