Quote:
Originally Posted by Raeiphon
I'm currently trying to script a CRC check that works on images - basically gets the byte size of the original image and compares it to the player's image, if it's over or under, the file gets deleted and is replaced with the original, if it isn't then it goes on as normal.
I can do this fairly easily - one problem: I don't know of a command/variable that deals with files in gscript. Could someone point me towards a wiki article or the proper syntax/commands to do so? It'd be greatly appreciated.
|
PHP Code:
// Loads the lines of a file to an array
temp.lines.clear();
temp.lines.loadLines("path/to/file");
// Saves the lines to an array
temp.line.saveLines("path/to/file", 0);
Please note that you have to give your NPC server r/w rights if you want to do both, or just read rights if you just want to read the files.