Need help on this Magician macro badly!

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

showme1
a ghoul
a ghoul
Posts: 138
Joined: Wed Dec 17, 2003 5:51 pm

Need help on this Magician macro badly!

Post by showme1 » Tue Apr 13, 2004 3:32 pm

Ok bare with me cause me and the guy who have been working on this are very new to scripting these, but we have got something that is a start. I'm sure a lot of it just needs cleaned up a bit and redone and that's why i'm here! First I'll post the the codes I'm using and then tell you what problems i'm having and what else i'd like to add... here is the magician macro and the #include macro i'm trying to work with

Code: Select all

#event xp "You gain party experience!!"
#include enc_spellcast.mac

Sub Main
/echo groupbot v1.0

:MainLoop
  /doevents
  /assist soandso
  /delay 10
  /if $char(buff,"Maelstrom of Ro")==0 {
  /call cast "Maelstrom of Ro"
  }
  /if $char(buff,"Elemental Draw Recourse")==0 {
  /call cast "Elemental Draw"
  }
  /if $char(mana,pct)<=90 {
  /call cast "Rod of Mystical Transvergance" item
  }
  /if $target(type)!="NPC" /goto :MainLoop
  /if n $target(hp,pct)>99 /goto :MainLoop
  /call cast "Veil of Lost Hopes" item
  /if $target(type)!="NPC" /goto :MainLoop
  /if n $target(hp,pct)>96 /goto :MainLoop
  /pet attack
:rest
  /delay 1
  /if n $target(hp,pct)>90 /goto :rest
:NukeLoop
  /call cast "sun vortex"
  /delay 140
/goto :MainLoop

Sub Event_xp
  /pet hold
/return

and here is the include file

Code: Select all

#event Fizzle "Your spell fizzles!" 
#event Interrupt "Your casting has been interrupted!" 
#event Interrupt "Your spell is interrupted." 
#event Recover "You haven't recovered yet..." 
#event Recover "Spell recovery time not yet met." 
#event Resisted "Your target resisted the Forlorn Deeds spell." 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event NoLOS "You cannot see your target." 
#event Stunned "You cannot cast while stunned" 
#event Standing "You must be standing to cast a spell" 
#event Collapse "Your gate is too unstable, and collapses."
#event Malosinia "looks very uncomfortable." 
#event Success "slows down"

Sub Cast(SpellName,Item) 
:StartCast 
  /if "@Item"=="Item" { 
  /call ClearReturnValue 
  /cast item "@SpellName" 
} else { 
  /if n $char(gem,"@SpellName")==0 /return CAST_UNKNOWNSPELL 
  /call ClearReturnValue 
  /if n $char(gem,"@SpellName")<0 { 
     /delay 0 
     /goto :StartCast 
  } 
  /cast "@SpellName" 
} 

  :WaitCast 
     /if "$char(casting)"=="TRUE" { 
       /delay 1 
       /goto :WaitCast 
     } 
     /doevents Fizzle 
     /doevents Interrupt 
     /doevents Recover 
     /doevents Standing 
     /doevents OutOfRange 
     /doevents OutOfMana 
     /doevents NoLOS 
     /doevents Resisted 
     /doevents Success
     /doevents Malosinia
     /if "$return"=="CAST_RESTART" /goto :StartCast 
     /if "$return"!="CAST_SUCCESS" /return "$return" 
/return CAST_SUCCESS 

Sub ClearReturnValue 
/return CAST_SUCCESS 

Sub Event_Fizzle 
/return CAST_RESTART 

Sub Event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover 
   /delay 5 
/return CAST_RESTART 

Sub Event_Standing 
   /stand 
/return CAST_RESTART 

Sub Event_Collapse 
/return CAST_RESTART 

Sub Event_OutOfMana 
/return CAST_OUTOFMANA 

Sub Event_OutOfRange 
/return CAST_OUTOFRANGE 

Sub Event_NoLOS 
/return CAST_CANNOTSEE 

Sub Event_Stunned 
/return CAST_STUNNED 

Sub Event_Resisted 
/return CAST_RESTART 

Sub Event_Malosinia
/return CAST_SUCCESS
/return
OK, now basically what I have works, but here is exactly what i'm looking for. At 99% i want my "veil of lost hopes" to cast malosinia. after the person i put in for assist targets the mob it does just that. The next step i was going for is my pet to engage once the mob is past 96%, this also always happens without a problem. After that when the mob is below 90% i want myself to start nuking with the spell i have chosen. this all works fine and dandy for the most part.

now there is also some buff commands in there. You'll notice that there are two buffs that i want on me at all times. "Maelstrom of ro" and "elemental recourse" are the two buffs we have added and they work fine. they recast automatically everytime the buff icon wears off. I also have it set that if my mana drops below 90% that i cast my mod rod which is in inventory slot 7. All 3 of these are working but they arent perferct obviously

Here is the bugs and add in requests i need help on hehe. First with the malosinia part. At 99% my veil of lost hopes casts normally and will cast until it is no longer resisted which is what im shooting for. after that the pet engages and everything appears fine. I cast the first sun vortex spell at 90%ish like normal. here is where things get goofy... the next time sun vortex casts after the delay ive put in, my veil of lost hopes casts again too. This is not such a big deal but the spell has landed so i dont need it to cast again since it's just a debuff. bascially i don't think i have it in the right spot of i messed up the include file somewhere and that's why it's recasting, so if anyone can help me on this part that would be great!

Next problem lol.... as you can see im very stuck! The mod rod portion is the next part i want to get working right. Mod rods have a reuse time of 5 minutes on them so if i go below 90% and cast it once it will spam me that the reuse time has not yet been met. I expected that to happen when i added the line to cast it. What i need help on is how to get around the spam. I'm sure there is a way, but i can't find anything to try and use heh. If I can get that working right then i'd like one more feature added. Mod rods have 3 charges on them so after the 3rd use the rod is gone. When this happens i want my "Magi`kots Pants of Convergenace" to target me and cast another rod which will be placed in inventory slot 7 again.

Other then these little anoyances these work ok. I just don't know how to fix the little bugs and add the other feature i want. Any help is VERY appreciated! Thank you for taking the time to read this mess heh. I hope i've made it clear enough that someone will actually be able to help me on it lol. Thanks again!

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Tue Apr 13, 2004 3:58 pm

Easy fixes.
malosinia fix:
Add an event keyed to the reuturn phrase of malosinia taking on your target. Add a Global variable at the top of your macro and varset it to 0 in the malosinia event set the value to 1. Add another /if to your malosinia cast line so that it doesn't cast if malosinia variable is 1. In your Experience event reset the value to 0 again.

Mod Rod spam:
Simular fix to above but instead of an event use a timerevent, When you cast the mod rod set a global to 1, don't mod rod till the value is again 0, have the timer reset the value to 0

Mod rod recast:
Fairly basic, create a global again, varset it to 0 increment it every time you mod rod. When the value is 3 cast a new rod and reset to 0

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

A quick glance

Post by Preocts » Tue Apr 13, 2004 4:19 pm

Code: Select all

  [color=green]:MainLoop [/color]
  /doevents 
  /assist soandso 
  /delay 10 
  /if $char(buff,"Maelstrom of Ro")==0 { 
  /call cast "Maelstrom of Ro" 
  } 
  /if $char(buff,"Elemental Draw Recourse")==0 { 
  /call cast "Elemental Draw" 
  } 
  /if $char(mana,pct)<=90 { 
  /call cast "Rod of Mystical Transvergance" item 
  } 
  /if $target(type)!="NPC" /goto :MainLoop 
  /if n $target(hp,pct)>99 /goto :MainLoop 
  [color=red]/call cast "Veil of Lost Hopes" item[/color]
  /if $target(type)!="NPC" /goto :MainLoop 
  /if n $target(hp,pct)>96 /goto :MainLoop 
  /pet attack 
:rest 
  /delay 1 
  /if n $target(hp,pct)>90 /goto :rest 
:NukeLoop 
  /call cast "sun vortex" 
  /delay 140 
[color=green]/goto :MainLoop [/color]
A very good use of /if statements to control the program here. Just need to look at the line in red and the line above it.
Follow the whole MainLoop out by hand and once you hit 99% MoB health I think the reason your item is casting constantly should be really noticable. If not, here is a hint:

Code: Select all

  /if n @VeilCast==0 {
    /varadd VeilVast 1
    [color=red]/call cast "Veil of Lost Hopes" item[/color]
  }
Now, how and why you just setup a @VeilCast I'll leave up to you to decide. This isn't the only way, it's just the first way I thought of.