Small Poblem with my Macro

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Snowbanx
a lesser mummy
a lesser mummy
Posts: 31
Joined: Sun Feb 22, 2004 4:56 am

Small Poblem with my Macro

Post by Snowbanx » Sat May 22, 2004 6:53 pm

I can get this to work fine, only problem is that for some reason it won't stop when i am out of bandages.

Feal free to correct any of my mistakes as this is my frist macro, =)

Code: Select all

|binding.mac -- 5.22.2004 
| 


#Event Nobandage "You can't bandage without bandages, go buy some." 

Sub Main 
   /echo binding.mac Started.... 
   /target id ${Group[0].ID}
   /sit
   /delay 2
   :loop_bandage
   /if (${Me.PctHPs} < 70) {
      /if (${Me.AbilityReady[Bind Wound]}) { 
         /doability "Bind Wound"
      } 
      /delay 5
      /goto :loop_bandage
   }
   /echo Binding Done. Exiting.
   /end

      

Sub Event_Nobandage
   /echo No Bandages. Exiting. 
   /endmac 
   /return

User avatar
signal0
a lesser mummy
a lesser mummy
Posts: 32
Joined: Thu Apr 01, 2004 10:07 pm
Contact:

Post by signal0 » Sat May 22, 2004 7:24 pm

You just need a /doevents statement.

Code: Select all

|binding.mac -- 5.22.2004
|

#Event Nobandage "You can't bandage without bandages, go buy some."

Sub Main
   /echo binding.mac Started....
   /target id ${Group[0].ID}
   /sit
   /delay 2
   :loop_bandage
   [color=red]/doevents[/color]
   /if (${Me.PctHPs} < 70) {
      /if (${Me.AbilityReady[Bind Wound]}) {
         /doability "Bind Wound"
      }
      /delay 5
      /goto :loop_bandage
   }
   /echo Binding Done. Exiting.
   /end

     

Sub Event_Nobandage
   /echo No Bandages. Exiting.
   /endmac
   /return 
signal[b]0[/b]

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Sat May 22, 2004 7:24 pm

You are missing /doevents

Code: Select all

|binding.mac -- 5.22.2004 
| 

#Event Nobandage "You can't bandage without bandages, go buy some." 

Sub Main 
   /echo binding.mac Started.... 
   /target id ${Group[0].ID} 
   /sit 
   /delay 2
   :loop_bandage 
   /if (${Me.PctHPs} < 70) { 
      /if (${Me.AbilityReady[Bind Wound]}) /doability "Bind Wound" 
      /delay 5
      [color=cyan]/doevents[/color]
      /goto :loop_bandage 
   }
   /echo Binding Done. Exiting.
/end 

Sub Event_Nobandage 
   /echo No Bandages. Exiting. 
   /endmac 
/return
Edit: Edited a typo
Last edited by wassup on Sat May 22, 2004 9:29 pm, edited 1 time in total.

Snowbanx
a lesser mummy
a lesser mummy
Posts: 31
Joined: Sun Feb 22, 2004 4:56 am

Post by Snowbanx » Sat May 22, 2004 8:40 pm

well damn, i am sure that will work now, totaly fergot about /do events.

Thanks guys, i would have been searching for my answer for a VERY long time i think.


*thumbs up for the good work* =)

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Sat May 22, 2004 9:28 pm

One other thing... I always try to avoid using events when I can...

Maybe try this too, replace Bandages_Name with whatever the bandages are called you use:

Code: Select all

|binding.mac -- 5.22.2004 

Sub Main 
   /echo binding.mac Started.... 
   /target myself 
   /sit 
   /delay 2 
   :loop_bandage
   /if (${Me.PctHPs} < 70) {
      /if (!${FindItem[=[color=cyan]Bandages_Name[/color]]}) /call NoBandages
      /if (${Me.AbilityReady[Bind Wound]}) {
      /doability "Bind Wound" 
      /delay 5
      /goto :loop_bandage 
   } 
   /echo Binding Done. Exiting. 
   /endmacro
/return

Sub NoBandages
   /echo No Bandages. Exiting. 
   /endmac 
/return 


eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

Post by eqjoe » Sun May 23, 2004 1:36 pm

Wassup wrote:One other thing... I always try to avoid using events when I can...
Almost all my macros are event driven......

Any reason you try to avoid using events?

-j

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Sun May 23, 2004 5:08 pm

Probably because they used to take more time to process than a simple comparison?

Use events when you have to... not because you can IMO.

Programmer
a hill giant
a hill giant
Posts: 195
Joined: Mon Dec 01, 2003 2:41 am

Post by Programmer » Sun May 23, 2004 6:20 pm

Normally I would say events are best in situations where they are available. This sort of rotuine though is best without depending on an event. The reason is simple: it's not necessary to use an event to determine if you are out of bandages, as shown by Wassup.

The number one rule of programming: don't make things more complicated than they need to be to get the job done.

thunderly
decaying skeleton
decaying skeleton
Posts: 5
Joined: Thu May 27, 2004 12:18 pm

re: very nice

Post by thunderly » Wed Jun 02, 2004 1:05 am

I've been using a variant of these for a while, but the something that I'd like to add to it is to get the macro to stop if I move or am attacked. I've looked through some other macros like the hunters and such and I think I can tell how to code it up, but didn't know if there was one already done that had those types of features.