tsincaat Posted March 4, 2009 Share Posted March 4, 2009 (edited) I'm having some trouble figuring this one out. Basically I want this script to cast one spell, or hit one button, while another is on cooldown. I know how to do the script itself, it's only this one part of waiting for something, while doing something else. I don't want to have to use a hardcoded "sequence". So far, my general code relating to this is as follows Func SpellOne() (Casts Spell 1) Func SpellTwo() (Casts Spell 2) $Sleeping = True (Sleeps for Cooldown) $Sleeping = False Func Loop() If $Sleeping = False Then SpellTwo() Else SpellOne() I know the problem with this is that it runs the SpellTwo Function until the cooldown is over, rather then heading back to the Loop and hitting SpellOne until the SpellTwo cooldown ends. I can't figure out how else to do this. I'd love it if someone could help! Edited March 4, 2009 by tsincaat Link to comment Share on other sites More sharing options...
Aceguy Posted March 4, 2009 Share Posted March 4, 2009 here is a crude example. Global $spellone,$spelltwo $spellone=0 $spelltwo=0 AdlibEnable("timer",500) while 1 if $spellone=12000 then ; when $spellone has reached 12 secs, CAST &reset timer ConsoleWrite("casting 1"&@Lf) $spellone=0;reset casting timer ElseIf $spelltwo =15000 Then ; when $spelltwo has reached 15 secs, CAST &reset timer ConsoleWrite("casting 2"&@Lf) $spelltwo=0;reset casting timer EndIf WEnd func timer() $spellone+=500 $spelltwo+=500 EndFunc [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
tsincaat Posted March 4, 2009 Author Share Posted March 4, 2009 here is a crude example. Global $spellone,$spelltwo $spellone=0 $spelltwo=0 AdlibEnable("timer",500) while 1 if $spellone=12000 then ; when $spellone has reached 12 secs, CAST &reset timer ConsoleWrite("casting 1"&@Lf) $spellone=0;reset casting timer ElseIf $spelltwo =15000 Then ; when $spelltwo has reached 15 secs, CAST &reset timer ConsoleWrite("casting 2"&@Lf) $spelltwo=0;reset casting timer EndIf WEnd func timer() $spellone+=500 $spelltwo+=500 EndFunc PERFECT Aceguy! Thank you SO much for your help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now