View Single Post
  #2  
Old 06-22-2007, 04:53 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Raeiphon View Post
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.
__________________
What signature? I see no signature?
Reply With Quote