SphereCommunity
Timers etc - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Timers etc (/Thread-Timers-etc)



Timers etc - Anymore - 12-07-2017 06:23 AM

Hello everyone,
I wish to do an item that gonna repeat the same action with a delay, something like that:

Code:
For x 1 3
newitem.i_gold
Wait 3 seconds



And i wish to know how i can add an event in a char is stealted!
Thank you!


RE: Timers etc - darksun84 - 12-07-2017 07:47 AM

For adding an event when a character becomes stealthed you have to add in the Hiding SkillBlock

Code:
ON=@Success
if !<isevent.youreventsname>
  events +youreventsname
endif
ON=@Fail
if <isevent.youreventsname>
   events -youreventsname
endif

ON=@Abort
if <isevent.youreventsname>
   events -youreventsname
endif



RE: Timers etc - Coruja - 12-10-2017 01:54 AM

unfortunately theres no pause/wait function on sphere, but you can use TIMER[F]

Code:
//This will create an loop through numbers 1,2,3 and taking *3 they will be 3,6,9

FOR 3
  TIMERF <eval <LOCAL._FOR>*3>,NEWGOLD 5000
ENDFOR

or

Code:
//When you call this function 'something' it will keep calling the same function again after 3 seconds

[FUNCTION something]
NEWGOLD 5000
IF (<dARGS> < 3)
  TIMERF 3,something <eval <dARGS>+1>
ENDIF