I am currently trying to figure out ways that I can read from or save to a text file either on the server or the client's computer.
I have been experimenting with "requestText(str, str)" for a while, but I can't really figure out at all how you would be able to read a specific file with it.
Currently I have:
NPC Code:
requestText(str, str):
- weapon [weaponname]
- weaponlist
- class [classname]
- classlist
- options
- serverflags
- folders
- folder [path]
- document [path=docu/docu_textfile.txt]
I'm not positive about that last one as I am not able to test it.
I am sure there's a few more. But I am unable to test.
Some other functions I have found are these. Yet I have no clue on how they work and am requesting any help in figuring them out.
NPC Code:
loadfolder(str, int)
loadlines(str)
loadstring(str)
loadvars(str)
savelines(str, int)
savestring(str, int)
I have seen the RC weapon use it as:
text.savestring("rclog.txt",1);
But again, I am not able to test. I just presume that it saves a string to the specified text file in the logs folder.
savevars(str, int)
I would appreciate any help.
I have also attached something I slapped together, rather messily (is that a word? It is now.).
It is sort of based on command prompt. Something I've been using to test the above commands and to teach myself gscrip2.
I didn't really need to make them all "/commands" but, what's the dif?
Included is a small formatText function which basically is used like:
NPC Code:
formatText("[r]This is red,[/r] and [y]This is yellow[/y]")
And it basically swaps the [r] tags and any other tags you may add into the function with their respective <font color=#color></font> tags.
I didn't put much effort into it, but I'm sure we can improve on it.
And if you call weaponlist or any other kind of thing through "/request" you can add either "-e" or "-l" to open the requested text in a editable text box or a list.
Perhaps even we can start up a few community projects that we can all work on together.
Anyway, again, I would love any help from anyone, and enjoy my little cmd script.