Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-08-2013, 07:31 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
compressing script

What is a better, more efficient way to write this. Preferably without TimeOuts or scheduleEvent.

It's for an npc item I'm making. There's more to it, but I'm just pasting the little snippet I want compressed.

PHP Code:
      if (blocked[0]==0) { 
       
player.-= 0.5;
       
sleep(0.05);   
       
player.-= 0.5;
       
sleep(0.05);
       
player.-= 0.5;
       
sleep(0.05);
       
player.-= 0.5;
       
sleep(0.05);
       
player.-= 0.5;
       
sleep(0.05);      
       
player.-= 0.5;
       
sleep(0.05);   
       
player.-= 0.5;
       
sleep(0.05);
       
player.-= 0.5;
       
sleep(0.05);
       
player.-= 0.5;
       
sleep(0.05); 
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #2  
Old 07-08-2013, 07:50 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Use a for loop to repeat a sequence of statements.

PHP Code:
for (temp.0temp.9temp.++) {
  
player.-= 0.5;
  
sleep(0.05);

__________________
Reply With Quote
  #3  
Old 07-08-2013, 07:50 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
either a gani or using a for() loop
__________________
MEEP!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:38 AM.


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