Someone please check this code..thanks

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

night
orc pawn
orc pawn
Posts: 24
Joined: Sat Jun 22, 2002 7:08 pm

Someone please check this code..thanks

Post by night » Wed Aug 21, 2002 8:24 pm

I am trying to modify Arioch's spell skill macro. http://macroquest2.com/phpBB2/viewtopic.php?t=81

Intstead of the /delay 5m that he uses when OOM to get mana I would like the macro to continually check for mana untill FM and then restart the spell casting. That way I can do other things while he is getting mana ie use sense heading skill while sitting or even run a fishing sub macro untill the char is FM. Here is what I have so far:

Code: Select all

#include spells.mac 

Sub Main 
     :Loop 
       /target myself 
       /stand 
       /call spells 8 5
       /if n $v99==999 /goto :GetMana 
       /if n $char(hp,pct)<10 /goto :GetMana 

       /delay 5 
      
       /click left destroy 
 |added for casting summoning spells
       /goto :Loop 
/return 

:GetMana 
   /delay 5 
   /sit 
   
   /if n $char(mana,pct)==100 /goto :loop    
   /goto :Getmana
The spells cast as they should and the char sits down when oom. However he then gets stuck in a sit-stand loop. There must be a problem with:

Code: Select all

/if n $char(mana,pct)==100 /goto :loop    
Anyways this is my first attempt at altering a macro and I appreciate any help you all could come up with.

Thank you.
Last edited by night on Wed Aug 21, 2002 8:29 pm, edited 1 time in total.

night
orc pawn
orc pawn
Posts: 24
Joined: Sat Jun 22, 2002 7:08 pm

hmm maybe...

Post by night » Wed Aug 21, 2002 8:29 pm

I just had a thought. If a char is already sitting and you type /sit will the char stand and then sit again? If so then I guess thats why my char is in a sit stand loop because the macro keeps returning to the /sit line in the getmana subroutine. Anyone come up with a work around for that if so?

powerspike
a ghoul
a ghoul
Posts: 80
Joined: Sun Aug 11, 2002 11:40 pm
Location: Australia
Contact:

Post by powerspike » Wed Aug 21, 2002 8:36 pm

Code: Select all

#include spells.mac 

Sub Main 
     :Loop 
       /target myself 
       /sit off
       /call spells 8 5 
       /if n $v99==999 {
                /sit on
                /goto :GetMana 
       } else /if n $char(hp,pct)<10 {
               /sit on
               /goto :GetMana 
       }
       /delay 5 
      
       /click left destroy 
      |added for casting summoning spells 
       /goto :Loop 
/return 

:GetMana 


   /delay 5 
   /if n $char(mana,pct)==100 /goto :loop    
   /goto :Getmana 


(excuse if there's a error in there - at work can't realy test it ;), tab doesn't help with formating in a textarea box on a form either *G*)

that should be a quick and nasty way to fix that for you to stop it sitting and standing all the time.

(edit : fixed wording - coffee hasn't kick in yet)

night
orc pawn
orc pawn
Posts: 24
Joined: Sat Jun 22, 2002 7:08 pm

Yeah man that works. Thank you

Post by night » Wed Aug 21, 2002 9:00 pm

Now I can add a fishing and sense heading macro during the siting an medding part. Thanks again

powerspike
a ghoul
a ghoul
Posts: 80
Joined: Sun Aug 11, 2002 11:40 pm
Location: Australia
Contact:

Post by powerspike » Wed Aug 21, 2002 9:10 pm

NP, remember if it turns out to be a functionable script to put it in the Macro depot =)