Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Old Scripting Engine (GS1)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 07-31-2017, 02:57 AM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
sleep(1) is more like waitfor(this, "none", 1) in GS2 the benefit of this it doesn't stop the execution of the script, that's my preferred method If its viable. scheduleevent can call a function on a timer basis. Basically It wont trigger the function immediately but when it hits the timer. Its better then timeout since it can be called once. Although I seen some people set there setTimer(0) (not sure if that even works, never tried it), which is ugly in my opinion. Reason I used this is because like your join classes, It's good to have one centralized place for repetitive code. instead of adding this.chat = "" after ever function its only in one place. Format just organized your code in a readability type way. Instead of doing things like,

PHP Code:
echo("test1:" SPC temp.test1 SPC "test2:"SPC temp.test2 SPC "test3:"SPC temp.test3
which looks horrible you could do

PHP Code:
echo(format("test1: %s test2: %s test3: %s"temp.test1temp.test2temp.test3)); 
It also can be used to replace parts of a string. Without using replacetext which could be intensive in some instances.

PHP Code:
   temp.copy_id player.account;
   
temp.level findlevel(format("mylevel-%s.nw"temp.copy_id)); 
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]




Last edited by MysticalDragon; 07-31-2017 at 03:21 AM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:48 PM.


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