Example of curing with a box

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

Moderator: MacroQuest Developers

shamster
Custom Builder
Custom Builder
Posts: 1
Joined: Tue Feb 08, 2005 9:51 pm

Example of curing with a box

Post by shamster » Tue Feb 08, 2005 10:01 pm

Well, I know its not the prettiest way to do it.

I couldnt figure out why nested for/next would fail so I just did the group part the way I did. Make your own suggestions I just wanted this idea out there.

I used afnuke's Junk routines for the idea

Needs spell_routines.inc

Code: Select all

|-shaman.ini
|-This file is from /declare inifile filename.ini outer elsewhere and can be shared with other ini files.
|-DoT_#=Name of the spell you want cured
|-Cure_#=The spell to cast (Or Ability)
|-CureType_#=Type of spell (aa, single, self, group)
| Single will do each member of your party
| Self will do yourself only
| AA will use an ability (Radiant Cure)
| Group will assume the spell is a group and is there so you can add /gsay Cure inc

[Cures]
DoT_0=Turgur's Insects
Cure_0=Blood of Nadox
CureType_0=group
DoT_1=Malos
Cure_1=Radiant Cure
CureType_1=aa

Code: Select all

Sub Cures 
   /declare Category string local 
   /declare EachDoT int local 
   /declare DoT string local 
   /declare Cure string local
   /declare CureType string local
   /varset Category Cures 
   /if (${String["${Ini[${IniFile},${Category},-1,NOTFOUND]}"].Find["NOTFOUND"]}) {        
      /return 
   } 

   |- Set line to 0, and search ailments list until no more found looping to :Nextcure...
   /varset EachDoT 0 

:NextCure 
   /varset DoT ${Ini[${IniFile},${Category},DoT_${Int[${EachDoT}]},NOTFOUND]} 
   /if (${DoT.Equal["NOTFOUND"]}) { 
      |- Were done, leave subroutine
      /return 
   } 

   |- Loop all buff slots and check for the current ailment in $DoT...
   /for m 1 to 20 
      /if (${Me.Buff[${m}].ID}>0) {
         |- We have a buff in this slot, check it against ini file for cures
         /if (${Me.Buff[${m}].Name.Find["${DoT}"]}) { 
             |- We have a match, look for a cure
             /varset Cure ${Ini[${IniFile},${Category},Cure_${Int[${EachDoT}]},NOTFOUND]} 
             /varset CureType ${Ini[${IniFile},${Category},CureType_${Int[${EachDoT}]},NOTFOUND]} 
             /if (${Cure.Equal["NOTFOUND"]}) { 
                /echo No Cure Found for ${DoT}...
                /goto :curenext 
             } 
             /if (${CureType.Equal["NOTFOUND"]}) {
                /echo No Cure Type defined, assuming group spell...
                /varset CureType group
             }                
             /echo ${DoT} needs ${Cure}, a ${CureType} target spell for my group...

             |-----------CURE STARTS HERE-----------------------
             /if (${CureType.Equal["AA"]}) {
                /target myself 
                /delay 1s
                /call Cast "${Cure}" alt
             }
             /if (${CureType.Equal["self"]}) {
                /target myself 
                /delay 1s
                /call Cast "${Cure}" gem6
             }
             /if (${CureType.Equal["group"]}) {
                /target myself 
                /delay 1s
                /call Cast "${Cure}" gem6            
             }
             /if (${CureType.Equal["single"]}) {
                /target myself 
                /delay 1s
                /call Cast "${Cure}" gem6            
                /if (${Group[1].ID}) {
                   /target id ${Group[1].ID} 
                   /delay 1s ${Target.ID}==${Group[1].ID} 
                   /call Cast "${Cure}" gem6 7s
                }
                /if (${Group[2].ID}) {
                   /target id ${Group[2].ID} 
                   /delay 1s ${Target.ID}==${Group[2].ID} 
                   /call Cast "${Cure}" gem6 7s
                }
                /if (${Group[3].ID}) {
                   /target id ${Group[3].ID} 
                   /delay 1s ${Target.ID}==${Group[3].ID} 
                   /call Cast "${Cure}" gem6 7s
                }
                /if (${Group[4].ID}) {
                   /target id ${Group[4].ID} 
                   /delay 1s ${Target.ID}==${Group[4].ID} 
                   /call Cast "${Cure}" gem6 7s
                }
                /if (${Group[5].ID}) {
                   /target id ${Group[5].ID} 
                   /delay 1s ${Target.ID}==${Group[5].ID} 
                   /call Cast "${Cure}" gem6 7s
                }
             }
             |-----------CURE ENDS HERE-------------------------             

         }
      }
   /next m
:curenext
   /varset EachDoT ${Math.Calc[${EachDoT}+1]} 
   /goto :NextCure 
/return 
I chose to return after casting once, so that other things can happen in the even of a DoT like healing, then loop again if the detrimental effect is still present. This will also nag until the AA is available.

xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 7:22 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 7:59 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 8:00 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 8:37 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 9:14 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 9:16 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 9:17 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 9:18 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 9:19 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 10:23 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 10:24 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 10:26 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 11:03 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Example of curing with a box

Post by xyilla » Tue Apr 08, 2025 11:04 pm