Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   savelines, loadlines (https://forums.graalonline.com/forums/showthread.php?t=134265018)

Astram 11-11-2011 03:59 AM

savelines, loadlines
 
Can someone please give me a brief tutorial on how to use these scripting functions, like if I was to have a saved file of a players data and load it at login. How could I make a file save and loadlines in the first place, I've seen these used before but don't quite understand it.

fowlplay4 11-11-2011 05:27 AM

Quote:

Originally Posted by fowlplay4 (Post 1634392)
Here's some basic examples for the savestring and savelines functions.

PHP Code:

// Declare Filename
temp.filename "path/to/file.txt";
// Save Lines
temp.lines = {
  
"Line 0: Hello",
  
"Line 1: World!"
  "Line 2: How are you?"
};
temp.lines.savelines(temp.filename0);
// Save String
temp.str "Hello World!\n";
temp.str.savestring(temp.filename0);
// Append String to File
temp.str "Yeah!\n";
temp.str.savestring(temp.filename1);
// Append Lines to File
temp.lines.savelines(temp.filename1); 


Examples.


All times are GMT +2. The time now is 01:49 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.