Sub Types

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

Moderator: MacroQuest Developers

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Sub Types

Post by Chill » Fri May 14, 2004 10:05 pm

Is it possible to give Subs (and their return values) types and have them return booleans, integers, or whatever when appropriate? As far as I can tell they always return strings atm, and didnt know if it was possible to change this.

Also, what about recursion? Had an example in mind:

Code: Select all

Sub Slow
  /call cast "Serpent of Vindication" item
  /if (${Macro.Return.Equal["CAST_SUCCESS"]}) {
    /echo Slowed ${Target.Name} at ${Target.PctHPs}%
    /return SLOWED
  } else /if (${Macro.Return.Equal["CAST_IMMUNESLOW"]}) {
    /echo ${Target.Name} Immune to slow
    /return IMMUNE
  } else /if (${Macro.Return.Equal["CAST_RESISTED"]}) {
    /call boggle
    [color=red]/call Slow[/color]
  } else
    /echo check slow logic
  }
/return slowerror
Will this work in MQ? Can I call the function repeatedly from itself (say 3 times if slow resists x3) and then have them all return back out when it completes?

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri May 14, 2004 10:07 pm

yes you can recurse.

no you cant return a specific type sorry.. well.. i'll look into it i guess..
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0