Lavastorm AFK 2.3 - BE CAREFUL RUNNING

Booges

Macro Master
Joined
Sep 10, 2005
Messages
602
Reaction score
2
Points
0
Location
Dover, DE
*************************************************************************************
*DISCLAIMER* = DO NOT USE THIS if you are on a flagged account, afraid of becoming a flagged account, afraid of getting banned. AFK macros are extremely risky to use so do not blame me if you get caught
*************************************************************************************

Forming new thread for this version, original macro thread is located here:

http://www.mmobugs.com/forums/showthread.php?t=882&page=28

And credit to Kalle for the locs inside the mission on his thread here:

[ame="http://www.mmobugs.com/forums/showthread.php?t=1596"]http://www.mmobugs.com/forums/showthread.php?t=1596[/ame]

Description:Will auto-retrieve mission, or count down if there is a tasktimer. Once zoning in will wait for at least 1 group member, then begin pulling goblins using *WARP* back to the entrance. Will kill all mobs before proceeding to next and will pause if health is low or if rooted. Will continue pulling goblins until the 40 counter is reached, then will begin retrieving hostages. On success will open chest and loot shard, then wait until mission is over and do it all over again.

UPDATED: 2 OCT 2006​

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*NOTE* = PickSkill.inc is something I whipped up solely for using the Abilities "Taunt" and "Kick". Feel free to copy it into a General include if you want, and change the #include line at top of macro. If you wish to use these abilities in the macro, make sure to download the .inc file into your macros folder, and in the macro make sure the variable UseAbility shows a value of 1. By using these, it will overwrite your existing hotkeys in slot 3 and 4 FYI. If you dont' wish to use it, make the value 0 and comment out or remove the line #include Pickskill (already done by default).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Version: 2.3
Plugins Required:
- MQ2Exchange
- MQ2MoveUtils
- MQ2MMOBUGSTOOLS

Known Issues:
---------------------
- Restarting macro inside(for testing) will reset Goblin count back to 0, in work



Code:
Changes:
----------------
7 April 2006 - Complete rewrite from orig. to account for 40 goblins
8 April 2006 - Back to the old way of warp target, hail, removed hailtarget
             - Added Current zone checks for known Zoning event issue
9 April 2006 - Changed zone checks because they weren't working :)
             - Added pause at start to wait for group
             - 2nd loc was a tad off, adjusted it
             - Will now wait if low on health or rooted
             - Added 9 more Locations to goblin loop
15 April 2006 - Added event to help in counting, prev. was only counting ones the main toon killed
             - Fight sub will now target wizzies first, then rogues, then rest
             - Locs 19-25 changed to better targets
             - Added a better zonechange event
17 April 2006 - Added a goblincount reset so they don't go straight to hailing hostages on 2nd mission
             - Changed the way Sub Loot is called
             - Fixed errors created during pasting macro into post
             - Changed target order on mobs to Shm then Wiz then Rogue
             - Added loop so he will keep trying to zone in, instead of just getting another mission.
20 April 2006 - Modified Goblincount variable to better recognize group members dying.
             - Changed hostage check to better recognize a hostage from a goblin
             - Added /face heading so main toon isn't facing wall on each succor (doesn't really add to functionality)
             - Added 45min. Missiontimer from the time you get the mission. Should now either zone you out when 45min. is up, or when you are booted from the zone, whichever is first.
30 April 2006 - Improved targeting functionality during fight routine
             - Added Aggrotimer to fix 0-mob pull problems (60sec timer)
             - Main toon will no longer warp after doing hostages, Looters rejoice
             - The Goblin counter now works much better
             - New include file, adding Taunt and Kick ability if you wish it, Read above and make sure to copy/download Pickskill.inc
             - End of mission, zoning to Lavastorm, it will wait 2min. or until a group member is in zone (+ another 15sec) then get new mission
10 May 2006 - Moved :Laghangup in the DoGoblins sub up a little to reclear target to avoid a possible Loop error
31 May 2006 - Added a timer on Taunt so it won't mash the keys
             - Removed 723.00, 543.00 LOC from array, it was a roamer
             - Fixed Looting bug, was looting faster than window was up
1 June 2006 - Added command "/LSPassword text" to change PW in-game
             - *NOTE* Using /LSPassword only changes pw for duration of the macro running. Continue to use the Password variable inside macro to permanently change the password, I don't want to incorporate an INI for 1 variable
             - Added delay before Fade check in Loot for slower computers
24 Aug 06 - Added hail counter to avoid a loop if trying to zone in
             - Changed the way hostages are done
             - Added LoS checks on goblins (credit to Fy, I didn't know you could use this as a parameter)
             - Removed a line that was causing conflict
3 Sep 06 - Added check for group health to help avoid wipes
2 Oct 06 - Added the additional Fade after hails back in

LSMAIN.MAC
Code:
|LSMain.mac 
|Written by Booges 2 OCT 06
|Version: 2.3
|-*-This macro is to be only posted on MMOBugs.com-*-
|-Required Plugins: MQ2MoveUtils, MQ2MMOBUGSTOOLS, MQ2Exchange
|                   Pickskill.inc - if using abilities
|- Put in PASSWORD variable for those auto-joining your group
|- Begin Macro at Sol A entrance in vicinity of Commander 
|- MAIN CHARACTER MUST BE GROUP LEADER FOR MISSION TO WORK CORRECTLY
|- If you use USEABILITY, slot 3 and 4 of HotButtons will be overwritten
|
|
|-----------------------------------------------
|On the Fly Commands:
|===============================================
|- /LSPassword passwordhere    = Change PW - NOTE* only changes for duration of macro, use Var below to perma change
|-----------------------------------------------

#turbo 10 
#include Pickskill.inc

#Chat Group
#Chat Tell
#Event Camping		"It will take you about 30 seconds to prepare#*#"
#event Goblindeath	"You have slain#*#"
#event Goblindeath	"#*# goblin #*# has been slain by #*#"
#event Healinc		"#1# begins to cast a spell."
#event Lava		"#*#You have entered The Lavastorm Mountains#*#" 
#event Nogroup		"#*#this shared task because your party does not contain the minimum#*#"
#event NewPassword	"[MQ2] LSPassword #1#"
#event Request		"You may not request a shared task because#*#" 
#event Shard		"#*#Meet back at the rendezvous point and we'll celebrate in due process#*#"
#event Slain		"#*#You have been slain by#*#" 
#event Trade		"#1# has offered you a #*#"
#event WaitTimer	"#*#task because you must wait 0d:0h:#1#m before you can#*#" 
#event Zoning		"LOADING, PLEASE WAIT#*#"


Sub Main 

|--------------------------------------------------------------------
|##Between quotes type what people should say to you to get an invite
|##Set UseAbility to 1 if you want to use Taunt and Kick (PickSkill.inc)
|-----------------------------------------------------------------------
/declare Password       string outer	"INVITE PASSWORD"
/declare UseAbility	int	outer	1

|--------------------------------------------------------------------
|## NO EDIT
|--------------------------------------------------------------------
/declare Waittimer	int outer	0
/declare Missiontimer	timer outer	0
/declare WinCount	int outer	0
/declare Goblincount	int outer	0
/declare Goblinloc[25]  string outer
/varset Goblinloc[1]	-485 -483 73
/varset Goblinloc[2]	-504 -535 58
/varset Goblinloc[3]	-471 -570 44
/varset Goblinloc[4]	-565 -558 55
/varset Goblinloc[5]	-546 -657 55
/varset Goblinloc[6]	-621 -675 49
/varset Goblinloc[7]	-530 -705 51
/varset Goblinloc[8]	-543 -789 50
/varset Goblinloc[9]	-568 -841 43
/varset Goblinloc[10]	-574 -901 42
/varset Goblinloc[11]	-539 -915 42
/varset Goblinloc[12]	-495 -633 55
/varset Goblinloc[13]	-447 -611 55
/varset Goblinloc[14]	-441 -746 33
/varset Goblinloc[15]	-419 -777 43
/varset Goblinloc[16]	-368 -566 38
/varset Goblinloc[17]	-655 -541 44
/varset Goblinloc[18]	-435 -869 42
/varset Goblinloc[19]	-387 -890 44
/varset Goblinloc[20]	-439 -922 43
/varset Goblinloc[21]	-356 -614 56
/varset Goblinloc[22]	-338 -663 56
/varset Goblinloc[23]	-365 -778 44
/varset Goblinloc[24]	-330 -744 44
/squelch /alias /LSPassword /echo LSPassword

   /Echo ==============+==============
   /Echo ##   Lavastorm AFK V2.3    ##
   /Echo ==============+==============
:main 
   /doevents 
   /call GM
   /call start 
   /goto :main 
/return 

|--
|##If in lavastorm it will get mission, if in Sol A
|##mission zone it will begin the mission
|--------------------------------------------------
Sub start 
   /declare t       int local 0 
:StartOver 
   /if (${Zone.ID}==31) /goto :Bigloop
   /call Reset 

:Bigloop 
   /call GM
   /target myself 
   /If ((!${Target.ID}) && (!${Spawn[${Group.Member[1]}].Type.Equal[pc]})) /goto :BigLoop
   /doevents 
:Checkgobs
   /if (${Goblincount}<40) {
      /call DoGoblins
      /goto :Checkgobs
   }
   /if (${Spawn[npc "goblin" radius 20].ID}) /call Fight
   /if (${Zone.ID}==27) /return 
   /delay 2s
   /target clear
|--
|If you wish to post this or use it elsewhere please contact the author Booges 
|for permission. If you see this macro posts elsewhere please contact admin@mmobugs.com
|##Hailing Hostages now
|------------------------------------------------

   /call GM
   /echo ! Saving the Hostages !

   /for t 1 to 9
      /target hostage0${t}
      /if (${Target.CleanName.NotEqual[a gnomish hostage]}) /goto :Nohostage
      /delay 5
      /warp t
      /delay 5
      /keypress h
      /delay 25
      /keypress h
      /delay 7
:Nohostage
   /next t
   /target hostage10
   /if (${Target.CleanName.NotEqual[a gnomish hostage]}) /goto :AllDone
   /delay 5
   /warp t
   /delay 5
   /keypress h
   /delay 25
   /keypress h
   /delay 7
:AllDone
   /warp s
   /delay 2s
   /call Fade 
   /delay 2s
   /call Fade
   /delay 2s
:Checkcursor
   /autoinventory
   /if (${Cursor.ID}) /goto :Checkcursor
   /doevents 
   /goto :StartOver 
/return 

|--
|##40 Goblin Script
|------------------
Sub DoGoblins
/declare intcount	int local
/declare Aggrotimer	timer local
   /if (${UseAbility}) /call Pickskill Taunt 3
   /delay 1s
   /if (${UseAbility}) /call Pickskill Kick 4
   /exchange "Reinforced Armor Plating" Chest
   /delay 1s
   /exchange "Diamond Tipped Drill Bit" mainhand
   /delay 1s 
   /cleanup
   /for intcount 1 to 24
      /if (${Zone.ID}==27) /call Event_Lava
      /squelch /target clear
      /if (${Goblincount}>40) /return
:Laghangup
      /varset Aggrotimer 60s
      /warp loc ${Goblinloc[${intcount}]}
      /delay 4s
      /keypress back hold
      /delay 3
      /keypress back
      /delay 4s (${Target.ID})
      /if (${Spawn[npc radius 5].ID}) /target goblin npc los
      /if (${UseAbility} && ${Target.ID}) /notify HotButtonWnd HB_Button4 leftmouseup
      /warp s
      /face heading 90
      /delay 2s
:wait1
      /if (!${Aggrotimer} && ${Target.Type.Equal[npc]}) /goto :Laghangup
      /if (${Target.Distance}>25) /goto :wait1
      /call Fight
      /doevents
      /if (${Target.ID} || ${SpawnCount[npc goblin radius 30]} || ${Me.Buff["Root"].ID} || ${Me.Buff["Instill"].ID} || ${Me.PctHPs}<63) /goto :wait1
      /call CheckGroup
      /if (${Macro.Return}) /goto :wait1
   /next intcount
/return

|--
|##Make sure group is ready for more
|----------------------------------
Sub CheckGroup
/declare i int local
/declare t int local 0
/declare Healthlow int local 0
   /for i 0 to ${Group.Members}
      /if (${Group.Member[${i}].PctHPs}<55) /varcalc t ${t}+1
   /next i
   /if (${t}>2) {
      /varset Healthlow 1
   } else {
      /varset Healthlow 0
   }
/return ${Healthlow}

|--
|##Retrieve the Mission and zone in
|----------------------------------
Sub Reset 
/declare Gnomeslackcounter	int local 0
   /doevents flush
   /if (${Me.Sitting}) /stand 
   /target Clockwork_Commander_widgetsworth 
   /If (${Target.Distance}>40) /call Movement 1449, 913 
   /face
   /delay 2s
   /stick 10 
   /delay 2s 
   /squelch /stick off 
   /say group 
   /delay 2s 
   /doevents 
   /delay 1s 
   /if (!${Window[TaskSelectWnd].Open}) /say group
:GetTask1
   /if (${Window[TaskSelectWnd].Open}) { 
      /notify TaskSelectWnd AcceptButton leftmouseup 
      /delay 3s 
      /goto :GetTask2
   } 
   /goto :GetTask1
:GetTask2
   /delay 1s 
   /doevents 
   /delay 1s 
:GetMonster1
   /if (${Window[TaskTemplateSelectWnd].Open}) { 
      /notify TaskTemplateSelectWnd TaskTemplateSelectListOptional listselect ${Window[TaskTemplateSelectWnd].Child[TaskTemplateSelectListOPtional].List[Juggernaut]} 
      /delay 1s 
      /notify TaskTemplateSelectWnd TaskTemplateSelectAcceptButton leftmouseup 
      /delay 3s 
      /goto :GetMonster2
   } 
   /goto :GetMonster1
:GetMonster2
   /cleanup 
   /tar Clockwork_Commander_Cogswain 
   /face
   /delay 2s 
   /stick 10 
   /varset Goblincount 0
   /varset Missiontimer 43m
   /delay 10s 
   /squelch /stick off 
:hailwait
   /if (${Gnomeslackcounter}==5) /call Event_Camping
   /keypress h 
   /delay 15s 
   /doevents
   /if (${Zone.ID}==27) {
      /varcalc Gnomeslackcounter ${Gnomeslackcounter}+1
      /goto :hailwait
   }
   /delay 10s 
   /call Start 
/return 

|--
|##Loot Sub, checks for nearby mob
|---------------------------------
Sub Loot 
:again 
   /if (${Zone.ID}==31) {
      /call Fade
      /If (${Cursor.ID}) /autoinventory
      /target id ${Spawn[npc race "Chest"].ID}
      /delay 1s 
      /If (${Target.Distance}>8) /warp target 
      /delay 1s 
      /open 
      /delay 1s 
      /target corpse 
      /delay 5
      /if (${Target.Type.NotEqual[corpse]}) /call Fade
      /target corpse
      /If (${Target.Distance}>8) /warp target 
      /delay 3s 
      /loot 
      /delay 1s
      /call Fight
      /delay 2s
      /if (${Window[LootWnd].Open}) {
         /if (${Corpse.Items}==1) {
            /itemnotify loot1 rightmouseup
            /itemnotify loot1 rightmouseup
            /delay 2s
         } else {
            /itemnotify loot2 rightmouseup 
            /itemnotify loot2 rightmouseup
            /delay 2s 
         }
         /if (${Window[ConfirmationDialogBox].Open}) /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup 
         /delay 2s 
         /notify LootWnd DoneButton Leftmouseup 
         /delay 3s (!${Window[LootWnd].Open})
         /notify LootWnd DoneButton Leftmouseup 
      }
      /if (!${FindItem[Shard of Wisdom].InvSlot.ID}) /goto :again 
      /varcalc WinCount ${WinCount}+1
      /echo Successful Mission = (${WinCount})
      /popup Success! Like Woah
      /warp loc ${Math.Calc[${Math.Rand[7]}+-401]}, ${Math.Calc[${Math.Rand[7]}+-352]}, 17
      /varset Goblincount 0
      /delay 30s
      /call Fight
:Forever
      /if ((!${Missiontimer}) && (${Zone.ID}==31)) {
         /target Comm
         /delay 1s
         /warp t
         /delay 1s
         /say evac
         /delay 5s
      }
      /doevents
      /goto :Forever
   } else {
      /call Reset
   }
/return 

|--
|##Attack mobs if they prevent you from looting
|----------------------------------------------
Sub Fight
/declare Taunttimer timer local 7s
:Checkfight
   /If (${Zone.ID}!=31) /return
   /If (${Spawn[npc "goblin" radius 25].LineOfSight}) {
      /if (${Spawn[npc Shaman radius 30].ID}) {
         /target Shaman npc
         /goto :Targeted
      } else /if (${Spawn[npc Wizard radius 30].ID}) {
         /target Wizard npc
         /goto :Targeted
      } else /if (${Spawn[npc Rogue radius 25].ID}) {
         /target Rogue npc
         /goto :Targeted
      } else {
         /target goblin npc los
      }
:Targeted
      /delay 5
      /stick 10
:Mob
      /if (${Target.Distance}<16) /attack on
      /doevents
      /If (${Target.Type.Equal[NPC]} && ${Spawn[npc "goblin" radius 24].LineOfSight}) {
         /if (${UseAbility} && !${Taunttimer}) {
            /notify HotButtonWnd HB_Button3 leftmouseup
            /varset Taunttimer 7s
         }
         /goto :Mob
      } else {
         /attack off
         /squelch /stick off
      }
      /goto :Checkfight
   }            
   /doevents 
/return

|--
|##Simple Fade sub to hold macro while fading
|--------------------------------------------
Sub fade 
   /If (${Me.PctHPs}>30) {
      /fade
   } else {
      /delay 40s
   }
:Fading 
   /target myself 
   /If (!${Target.ID}) /goto :Fading 
   /target clear 
   /delay 1s 
/return 

|--
|##GM Sub for checking
|---------------------
Sub GM
   /if (${Spawn[gm].ID}) {
      /gsay Time to go, cya later
      /camp 
      /endmac
   } 
/return 

|--
|##Enables you to Move to a loc specified
|----------------------------------------
Sub Movement(int MoveX,int MoveY) 
   /declare StartZone int local ${Zone.ID} 
   /declare  StuckXLoc      int local ${Me.X} 
   /declare  StuckYLoc      int local ${Me.Y} 
   /squelch /stick off 
   /keypress forward hold 
   /keypress Space 
:AnchorMoveLoop 
   /delay 1 
   /face fast nolook loc ${MoveX},${MoveY} 
   /if (${Math.Distance[${MoveX},${MoveY}]}>10) { 
      /keypress forward hold 
      /varset StuckXLoc ${Me.X}
      /varset StuckYLoc ${Me.Y}
      /doevents
      /delay 5
      /if (${StuckXLoc}==${Me.X} && ${StuckYLoc}==${Me.Y}) {
         /keypress forward 
         /keypress back hold 
         /delay 3 
         /keypress back 
         /if (${Math.Rand[2]}) { 
            /keypress strafe_right hold 
         } else { 
            /keypress strafe_left hold 
         } 
         /delay 2s
         /keypress strafe_right 
         /keypress strafe_left 
      }
      /if (${Zone.ID}!=${StartZone}) /return 
   } else { 
      /keypress forward 
      /return 
   } 
   /goto :AnchorMoveLoop 
/return 

|------------------------------------------------------
|                  -+= EVENTS =+-
|------------------------------------------------------

|--
|##Chat Events
|-------------
Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
   /If (${ChatType.Equal[TELL]} && ${ChatText.Equal[${Password}]}) {
      /invite ${ChatSender}
      /taskaddplayer ${ChatSender}
      /return
   }

   /If (${ChatText.Equal[make me leader]}) {
      /if (!${Goblincount}) /makeleader ${ChatSender}
      /return
   }

   /If (${ChatText.Equal[how long]} || ${ChatText.Equal[timer?]}) {
      /t ${ChatSender} Have ${Waittimer} minutes left yet.
      /return
   }

/return

|--
|##End Macro if you camp on your own
|-----------------------------------
Sub Event_Camping
	/echo Camping - Ending macro!
	/endmacro
/return

|--
|##Counting dead goblins
|-----------------------
Sub Event_Goblindeath
   /varcalc Goblincount ${Goblincount}+1
   /echo Goblin Dead! ${Math.Calc[40-${Goblincount}]} To Go!
/return

|--
|## Pause if a heal is inc
|-------------------------
Sub Event_Healinc(Line, string Command)
   /if (${Verbose}) /echo Heal Delay Entered
   /if (${Select[${Command},${Group.Member[1]},${Group.Member[2]},${Group.Member[3]},${Group.Member[4]},${Group.Member[5]}]}) /delay 2s
/return

|--
|##Remove task upon zoning to Lavastorm
|--------------------------------------
Sub Event_Lava 
   /declare g       int local 0 
   /declare g2       int local 0 
   /doevents flush
   /delay 2s
   /If (${Me.Sitting}) /stand 
   /for g 0 to ${Group.Members} 
      /varcalc g2 ${Group.Members}-${g} 
      /taskremove ${Group.Member[${g2}]} 
   /next g 
   /delay 2m (${Spawn[${Group.Member[1]}].Type.Equal[pc]})
   /delay 15s
   /call Reset 
/return 

|--
|## Set a new Password on the fly
|--------------------------------
Sub Event_NewPassword(Line, string Freshone)
   /varset Password ${Freshone}
   /echo Password successfully changed to - ${Password} -
/return

|--
|##Auto-camp in the event your group leaves/crashes
|--------------------------------------------------
Sub Event_Nogroup
   /gsay Group folded I'm done
   /end
/return

|--
|##This Event is so you can stop/start a macro during a tasktimer
|----------------------------------------------------------------
Sub Event_Request 
   /declare g       int local 0 
   /declare g2       int local 0 
   /If (${Me.Sitting}) /stand 
   /echo ! Pausing for 2 Minutes for Looters ! 
   /delay 2m 
   /for g 0 to ${Group.Members} 
      /varcalc g2 ${Group.Members}-${g} 
      /taskremove ${Group.Member[${g2}]} 
   /next g 
   /call Reset 
/return 

|--
|##Hostages done. Calling Loot sub
|---------------------------------
Sub Event_Shard
   /call Loot
/return

|--
|##Holds macro when you die
|--------------------------
Sub Event_Slain 
   /delay 5s 
:Loading 
   /target myself 
   /If (!${Target.ID}) /goto :Loading 
   /target clear 
   /delay 2s
/return 

|--
|##Auto accept items traded
|--------------------------
Sub Event_Trade
   /delay 8s
   /doevents flush
   /if (${Window[TradeWnd].Open}) {
      /notify TradeWnd TRDW_Trade_Button leftmouseup
   }
/return

|--
|##Countdown if you have a tasktimer
|-----------------------------------
Sub Event_WaitTimer(crap,int tasktime) 
   /declare y       int local 0 
   /varcalc tasktime ${tasktime}+1 
   /echo Delaying ${tasktime} minutes 
   /squelch /stick off 
   /keypress strafe_left hold
   /delay 1s
   /keypress strafe_left
   /call Movement ${Math.Calc[${Math.Rand[7]}+1427]}, ${Math.Calc[${Math.Rand[7]}+971]}
   /face heading ${Math.Rand[359]}
   /If (!${Me.Sitting}) /sit 
   /for y 0 to ${tasktime} 
      /Echo ${Math.Calc[${tasktime}-${y}]} minutes left till get new expedition 
      /varset Waittimer ${Math.Calc[${tasktime}-${y}]}
      /doevents 
      /delay 15s 
      /doevents 
      /delay 15s 
      /doevents 
      /delay 15s 
      /doevents 
      /delay 15s 
   /next y 
      /call reset 
/return 

|--
|##Zoning Function since zone events don't work
|----------------------------------------------
Sub Event_Zoning
   /delay 2s
   /if (${Zone.ID}==27) /call Event_Lava
/return
 

Attachments

  • Pickskill.inc
    701 bytes · Views: 311
  • LSMain.mac
    17 KB · Views: 177
Last edited by a moderator:
LSLooter 2.3

Description: Will sit on hill until mission is received, the choose Infantry monster and zone in. Will wait patiently until Main toon(group leader) pulls mobs, as he does this toon will auto-assist until all are dead, and checking Main's health between each mob death as well as his own, Main getting priority though. Will use haste clicky, slow stick, and nuke bombs if acquired. Once finished will autoloot shard and wait until it's time to leave zone.

UPDATED: 1 JUNE 2006​

Version: 2.3
Plugins Required:
- MQ2Exchange
- MQ2MoveUtils
- MQ2MMOBUGSTOOLS

Includes Required:
- Spell_routines.inc

Known Issues:
---------------------
- Once every 30 or so missions something wierd happens


Code:
Changes:
---------------------
7 April 2006 - Complete rewrite from orig. to account for 40 goblins
8 April 2006 - Added Zonechange Sub for known zone event issue
9 April 2006 - Changed zonechange because it was a little wrong
             - Changed heal thresholds to avoid healing during pull
             - Looters will reassist if their target is OOR now
15 April 2006 - Looter toons no longer spamming if main isn't in zone
              - Movement loop outside should no longer keep activating
              - Looter will now wait if still inside last mission before choosing new monster for next mission
17 April 2006 - Changed Event_Gotmission zone.ID, thank you kalle, i was backwards
20 April 2006 - Removed infinite loop at end of LOOT sub, causing a loop error
30 April 2006 - Will only nuke Wizards w/ bombs now
              - Now Leashed to Commanders, will /warp s if too far from camp
              - Will not call DoHeal in Lavastorm 1 time when zoning out anymore
              - Better assisting Main toon, won't spam heal junk if Main not in zone
              - Changed something else but forget what, rawr 
24 May 2006 - Added zone check to leash command
              - Added distance check before assisting Main in Fight Sub
              - Changed Loot sub so 6th char can still loot shard if ring was looted
31 May 2006 - Fixed the Loot Sub, it was trying to loot too fast
              - Will only use Bayonet if target is over 45% health
              - Lowered leash length to 35 to avoid running past wall
              - Will not /stick and /attack until target is below 100% unless Leader is not in zone at the time
              - Added /doevents in front of leash command to avoid warping on a failed mission while inside the fight sub
1 June 2006 - Added command /LSVerbose to toggle on/off Debug garbage
              - Added delay in Loot before Fade check for slower computers


LSLOOTER.MAC
Code:
|LSLooter.mac
|Written by Booges - 1 JUNE 06
|Version 2.3
|-*-This macro is to be only posted on MMOBugs.com-*-
|-*-Contact author or admin@mmobugs.com for reposting permission-*-
|-Required plugins: MQ2MoveUtils, MQ2MMOBUGSTOOLS, MQ2EXchange, Spell_Routines.inc
|
|*IMPORTANT* If you are running a toon without a HELM, CHEST, AND Primary
|(IE naked)macro will close, change the items 15 lines down, to other items.
|(At least one of those equipped will keep macro up)
|
|-----------------------------------------------
|On the Fly Commands:
|===============================================
|- /LSVerbose - Toggle Debug text ON/OFF, Default is OFF
|-----------------------------------------------


#include Spell_routines.inc
#turbo 10 
#chat group
#chat tell
#Event Bayonet		"#*# is stuck with a bayonet#*#"
#Event Camping		"#*#It will take you about 30 seconds to prepare#*#"
#Event GotMission 	"#*#You have been assigned the task#*#"
#Event Invite           "#1# invites you to join a group."
#event Lava 		"#*#You have entered The Lavastorm Mountains#*#" 
#Event NoMonster	"#*#You may not enter the mission zone until you have chosen a monster#*#"
#event Shard		"#*#Meet back at the rendezvous point and we'll celebrate in due process#*#"
#Event Takeover 	"You are now the leader of your group#*#"
#event ToggleVerbose	"[MQ2] ToggleVerbose#*#"
#event Zoning		"LOADING, PLEASE WAIT#*#"


Sub Main


/declare Backup		string outer
/declare Bayonet0	int	outer
/declare Currentzone	string outer ${Zone.ID}
/declare Oldleader	string outer ${Group.Leader}
/declare Verbose	int outer 	0
/declare WinCount	int outer
/squelch /alias /LSVerbose /echo ToggleVerbose


|--
|##Camp if naked, Main call sub
|------------------------------
   /Echo ==================+===================
   /Echo ##   Lavastorm Shard Looter V2.3                   ##
   /Echo ==================+===================
   /if (${Zone.ID}==27) {
      /call Movement ${Math.Calc[${Math.Rand[30]}+1400]}, ${Math.Calc[${Math.Rand[30]}+951]}
      /face heading ${Math.Rand[359]}
      /If (!${Me.Sitting}) /sit
   }
:Main 
   /If (${Zone.ID}!=31) {
      /if (!${InvSlot[mainhand].Item.Name.Length} && !${InvSlot[chest].Item.Name.Length} && !${InvSlot[head].Item.Name.Length}) {
         /echo You are naked in public @@... Camping out
         /camp desktop
         /end
      }
      /call gm 
      /doevents 
      /goto :Main
   }
   /if (${Spawn[npc "goblin" radius 24].ID}) /call Fight
   /call DoHeal
   /doevents 
   /goto :Main 

|--
|##Upon getting mission this will zone you in
|--------------------------------------------
Sub Reset  
   /if (${Verbose}) /echo Reset Sub
   /cleanup 
   /delay 10s
   /delay ${Math.Rand[30]}s
   /if (${Me.Sitting}) /stand
   /echo ! Zoning in to Loot shortly !
   /tar Clockwork_Commander_Cogswain 
   /if (${Verbose}) /echo Reset Sub - Call Movement
   /if (${Target.Distance}>40) /call Movement 1445, 920
   /if (${Verbose}) /echo Reset Sub - Face Commander
   /face
   /delay 2s
   /stick 10
   /delay 2s
   /squelch /stick off
   /if (${Verbose}) /echo Reset Sub - Hail Commander to zone in
:hailwait
   /keypress h 
   /delay 15s 
   /doevents
   /if (${Zone.ID}==27) /goto :hailwait
|\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
|If your comp is slow CHANGE this delay|
|\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
   /delay 25s
   /doevents
/return 

|--
|##Hell with running - We Fight !
|--------------------------------
Sub Fight
   /if (${Verbose}) /echo Fight Sub
/declare Bomb int local 1
   /If (${Zone.ID}!=31) /return
   /exchange "Diamond Tipped Drill Bit" Mainhand
   /delay 5 
   /exchange "Clockwork Infantry Bayonet" Offhand
   /delay 5
   /If (${Spawn[npc "goblin" radius 24].LineOfSight}) {
      /if (${Spawn[pc ${Group.Leader} radius 30].ID}) {
         /assist ${Group.Leader}
      } else {
         /target Goblin npc
      }
      /delay 8
      /if (${Verbose}) /echo Bomb Check
      /If (${Bomb}==1 && ${FindItem["Anti-Infantry Bomb"].InvSlot} && ${Target.LineOfSight}) {
         /if (${Target.Class.Name.Equal[Wizard]}) {
            /delay 1s
            /if (${Verbose}) /echo Casting Anti-Infantry Bomb
            /call Cast "Anti-Infantry Bomb" item 3s
            /varset Bomb 0
            /delay 2s
         }
      }
      /if (${Target.PctHPs}>99 && ${Spawn[pc ${Group.Leader}].ID}) /return
      /delay 5
      /stick 10
:Mob
      /If (${Target.Type.Equal[NPC]} && ${Spawn[npc "goblin" radius 24].LineOfSight}) {
         /if (${Target.Distance}<16) /attack on
         /if (${Spawn[pc ${Group.Leader} radius 26].ID}) /assist ${Group.Leader}
         /If (${Target.PctHPs}>45 && ${InvSlot[offhand].Item.Name.Equal["Clockwork Infantry Bayonet"]} && !${FindItem["Clockwork Infantry Bayonet"].Timer} && !${Bayonet0}) /call Cast "Clockwork Infantry Bayonet" item 1s
         /If (${FindItem["Heat Sinks"].InvSlot} && !${Me.Buff["Heat Sink Activated"].ID}) /Call Cast "Heat Sinks" item
         /goto :Mob
      } else {
         /varset Bayonet0 0
         /doevents
         /if (!${Spawn[npc Commander radius 35].ID} && ${Zone.ID}==31) /warp s
         /attack off
         /squelch /stick off
      }
   }
   /if (${Verbose}) /echo Fight Sub - End
   /doevents
/return 

|--
|##Heal checker
|--------------
Sub DoHeal
   /if (${Zone.ID}!=31) /return
   /If (${FindItem["Auto Repair Kit"].InvSlot} && !${FindItem["Auto Repair Kit"].Timer}) {
      /if (${Me.PctHPs}<47) {
         /target myself
         /delay 5
         /if (${Me.PctHPs}<50) /call Cast "Auto Repair Kit" item 1s
      } else {   
         /if (${Spawn[pc ${Group.Leader} radius 26].ID}) /target ${Group.Leader}
         /delay 5
         /if (${Target.ID} && ${Target.PctHPs}<60 && ${Target.Distance}<26) /call Cast "Auto Repair Kit" item 1s
      }
   }
/return

|--
|##Allows movement to any loc specified in the call
|##And camps you if you don't get there within 2min.
|--------------------------------------------------
Sub Movement(int MoveX,int MoveY,int pointnum) 
   /if (${Verbose}) /echo Movement Sub
   /declare StartZone int local ${Zone.ID} 
   /declare  StuckXLoc      int     local  ${Me.X} 
   /declare  StuckYLoc      int     local  ${Me.Y} 
   /declare  iCount         timer   local  1200
   /squelch /stick off 
   /if ((${MoveX}==9999) && (${MoveY}==9999)) { 
      /varcalc MoveX ${Target.X}+1 
      /varcalc MoveY ${Target.Y}-10 
   } 
   /keypress forward hold 
   /keypress Space 
   /if (${Verbose}) /echo Movement Sub - Start Loop
:AnchorMoveLoop 
   /if (${Zone.ID}!=${StartZone}) /return 
   /delay 3
   /face fast nolook loc ${MoveX},${MoveY} 
   /if (${Math.Distance[${MoveX},${MoveY}]}>10) { 
      /keypress forward hold 
      /doevents
      /delay 5
      /if (${StuckXLoc}==${Me.X} && ${StuckYLoc}==${Me.Y}) {
         /if (${Verbose}) /echo Movement Sub - Stuck
         /keypress forward 
         /keypress back hold 
         /delay 8 
         /keypress back 
         /if (${Math.Rand[2]}=2) { 
            /keypress strafe_right hold 
         } else { 
            /keypress strafe_left hold 
         } 
         /delay 10
         /keypress strafe_right 
         /keypress strafe_left 
      }
      /if (${Zone.ID}!=${StartZone}) /return 
      /varset StuckXLoc ${Me.X}
      /varset StuckYLoc ${Me.Y}
      /if (!${iCount}) { 
         /echo Sorry, cannot get unstuck. Camping until you return
         /camp
         /end
      } 
   } else { 
      /if (${Verbose}) /echo Movement Sub - End Loop
      /keypress forward 
      /return 
   } 
   /goto :AnchorMoveLoop 
/return 

|--
|##Will continue to loot unless mob nearby or have no shard
|----------------------------------------------------------
Sub Loot 
   /if (${Verbose}) /echo Loot Sub
:again
   /If (${Zone.ID}==31) { 
      /exchange "Diamond Tipped Drill Bit" Mainhand
      /delay 1s 
      /exchange "Clockwork Infantry Bayonet" Offhand
      /delay 1s
      /echo ! Looting !
      /delay 1s 
      /target id ${Spawn[npc race "Chest"].ID}
      /delay 1s 
      /if (${Verbose}) /echo Loot Sub - Warp
      /If (${Zone.ID}==31 && ${Target.Distance}>8) /warp t
      /delay 1s 
      /open 
      /delay 1s 
      /target corpse 
      /delay 5
      /if (${Verbose}) /echo Loot Sub - Fade
      /if (${Target.Type.NotEqual[corpse]}) /call Fade
      /If (${Target.Distance}>8) /warp target 
      /delay 1s 
      /if (${Verbose}) /echo Loot Sub - Loot
      /loot 
      /delay 2s
      /call Fight
      /if (${Window[LootWnd].Open}) {
         /if (${Corpse.Items}==1) {
            /itemnotify loot1 rightmouseup
            /itemnotify loot1 rightmouseup
            /delay 2s
         } else {
            /itemnotify loot2 rightmouseup 
            /itemnotify loot2 rightmouseup
            /delay 2s 
         }
         /if (${Window[ConfirmationDialogBox].Open}) /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup 
         /delay 2s 
         /notify LootWnd DoneButton Leftmouseup 
         /delay 3s (!${Window[LootWnd].Open})
         /notify LootWnd DoneButton Leftmouseup 
      }
      /if (${Window[ConfirmationDialogBox].Open}) /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup 
      /delay 1s 
      /notify LootWnd DoneButton Leftmouseup 
      /delay 2s 
      /notify LootWnd DoneButton Leftmouseup 
      /if (!${FindItem[Shard of Wisdom].InvSlot.ID}) /goto :again 
      /varcalc WinCount ${WinCount}+1
      /if (${Verbose}) /echo Loot Sub - Successful Loot (${WinCount})
      /warp loc ${Math.Calc[${Math.Rand[7]}+-401]}, ${Math.Calc[${Math.Rand[7]}+-352]}, 17
   } else {
      /if (${Zone.ID}==27) {
         /if (${Verbose}) /echo Loot Sub - Loot called in Lavastorm
         /call Reset
         /call Loot
      }
   }
/return 

|--
|##Fade off aggro if needed
|--------------------------
Sub fade 
   /if (${Verbose}) /echo Fade Sub
   /If (${Me.PctHPs}>25) {
      /fade
      /delay 5s
   } else {
      /delay 30s
   }
:Fading 
   /target myself 
   /If (!${Target.ID}) /goto :Fading 
   /target clear 
   /delay 1s 
/return 

|--
|##GM Checker
|------------
Sub gm 
   /if (${Spawn[gm].ID}) {
      /gsay Gotta go cya later
      /camp desktop
      /endmac 
   }
/return 

|------------------------------------------------------
|                  -+= EVENTS =+-
|------------------------------------------------------

|--
|##Handle Bayonet Clicky
|-----------------------
Sub Event_Bayonet
   /varset Bayonet0 1
/return

|--
|##Handle any chat routines
|--------------------------
Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
   /if (${ChatText.Equal[make me leader]}) {
      /makeleader ${ChatSender}
      /return
   }
/return

|--
|##End Macro if you camp on your own
|-----------------------------------
Sub Event_Camping
	/echo Camping - Ending macro!
	/endmacro
/return

|--
|##Will Select monster when mission is received
|##And call the sub to zone in and wait
|----------------------------------------------
Sub Event_GotMission
   /if (${Verbose}) /echo GotMission EVent
   /doevents flush
:wait1
   /if (${Zone.ID}==31) /goto :wait1
   /keypress forward
:OMGWAIT2 
   /if (${Window[TaskTemplateSelectWnd].Open}) { 
      /notify TaskTemplateSelectWnd TaskTemplateSelectAcceptButton leftmouseup 
      /delay 3s 
      /notify TaskTemplateSelectWnd TaskTemplateSelectAcceptButton leftmouseup 
      /goto :Okyourgood2 
   } 
   /goto :OMGWAIT2 
:Okyourgood2
   /cleanup
   /if (${Verbose}) /echo GotMission Event - Call Reset
   /call Reset
/return

|--
|##Will auto-accept invites to group
|##ToDo: Assign masterlist
|-----------------------------------
Sub Event_Invite(Junk, string Sender)
   /target clear
   /invite
/return

|--
|##Find your perch and sit down until next mission
|##Everytime you zone into Lavastorm IF no mission
|##Right away
|-------------------------------------------------
Sub Event_Lava
   /if (${Verbose}) /echo Lava Event
   /delay 25s
   /delay ${Math.Rand[20]}s 
   /if (${Window[TaskTemplateSelectWnd].Open}) {
      /if (${Verbose}) /echo Lava Event - Task Window Open
      /call Event_GotMission
      /doevents
      /return
   }
   /if (${Verbose}) /echo Lava Event - No Task going up hill
   /keypress strafe_left hold
   /delay 1s
   /keypress strafe_left
   /call Movement ${Math.Calc[${Math.Rand[30]}+1400]}, ${Math.Calc[${Math.Rand[30]}+951]}
   /face heading ${Math.Rand[359]}
   /If (!${Me.Sitting}) /sit
/return

|--
|##Called if you have no monster picked and trying to zone in
|------------------------------------------------------------
Sub Event_NoMonster
   /if (${Verbose}) /echo NoMonster Event
   /call Event_GotMission
/return

|--
|##Mission Won, starting Loot sub
|--------------------------------
Sub Event_Shard
   /if (${Verbose}) /echo Shard Event
   /delay 25s
   /delay ${Math.Rand[30]}s 
   /call Loot
/return

|--
|##Will take over the macro when leader leaves grp
|-------------------------------------------------
Sub Event_Takeover
   /echo Taking over Leader
   /macro LSMain
/return

|--
|## Toggle Verbose(helps with debugging) on or off
|-------------------------------------------------
Sub Event_ToggleVerbose
   /if (${Verbose}) {
      /varset Verbose 0
      /echo Verbose now turned OFF!
   } else {
      /varset Verbose 1
      /echo Verbose now turned ON!
   }
/return

|--
|##Zoning Function since zone events don't work
|----------------------------------------------
Sub Event_Zoning
   /delay 2s
   /varset Currentzone ${Zone.ID}
   /if (${Zone.ID}==27) /call Event_Lava
/return
 

Attachments

  • LSLooter.mac
    13.4 KB · Views: 168
Last edited:
NOTE MAKE SURE YOU HAVE LOADED MQ2MOVEUTILS, MQ2EXCHANGE and MQ2HAIL.

PLEASE READ: Booges macro above is written much better than mine. I've just had alot more time to test and make changes. I'm posting mine as I feel i've got the macro near perfect but Booges still has a few problems to sort out. Mine is not written for flexablity, its written for mindless AFK running.

There are a few problems with the macro that I’ve fixed in my version which runs near perfect for me now. I think most of these problems have been mentioned in this thread. Note all of these changes in my macro were written for a 6 man group.

LSMain Problems:
1. Pulls over 8 mobs sometimes, this will wipe the group but doesn't break the macro. (Fixed)
2. Once hes looted shard there’s only 20s delay before he resets goblin timer, if looters get jumped while looting and kill a goblin it will restart the goblin timer. (Fixed)
4. Removed the /if (${Target.Type.NotEqual[corpse]}) /call Fade lines in code so they don't chain fade if they can't find chest to loot. (Fixed)
5. LSMain has code written in it for killing a goblin attacking you if you are trying to loot but it isn't called when trying to loot. (Haven't fixed this but never ran into any issues because of it)
6. Added fade after gnomes are hailed to avoid unneeded death.
7. A problem with looters running off to kill something which isn't quite in camp yet and main just sitting there. (Hopefully Fixed)
8. Made macro wait until at least three other people were in mission before starting (Fixed)

LSLooter Problems:
1. If Main is low on health and heal is called they all waste heals on him. (Fixed)
2. Changed main heal level to under 65% to stop main sitting there doing nothing sometimes when he has 60% health. (Fixed)
3. Made all looters /warp succor if they kill a goblin and no more are left in camp, then /face towards where goblins get pulled from. (Fixed)
4. Removed all traces of walking up hill in lavastorm once mission is finished and there’s no mission given yet. (Fixed)
5. Added a warp once they've zoned out to lavastorm to the loc you are suppose to be sent to when leaving mission to solve warping under mountain bug. (Fixed)
6. Added check for goblins attacking when trying to loot and to try and kill them then go back to looting. (Fixedt)
7. Removed the /if (${Target.Type.NotEqual[corpse]}) /call Fade lines in code so they don't chain fade if they can't find chest to loot.

By posting this I hope it gives Booges an idea of where the problems are in his macro to fix.

UPDATE 27th of May:
Updated LSMainTest attack radius to hopefully stop fighting behind the wall.
Updated LSLooterTest to add a gm check before warping in lavastorm.

UPDATE 29th of May:
Fixed LSLooterTest looting while goblins in camp problem
Moved LSMainTest onto MQ2Hail (Grab the version of MQ2Hail that doesn't crash you here)

UPDATE 29th of May A:
Fixed succor problem on looters
Changed attack range and line of sight on looter and main
Moved goblin loc -539 -915 42 to last to avoid train.
Fixed issue of looter crashing if they weren't near commander in lavastorm

UPDATE 1ST OF JUNE
- Got rid of -723 -543 44 pull spot
- Looters nolonger assist leader (This may sound like a bad thing but its almost fixed the fighting behind the wall problems)
- Played around with loot sub a bit.
- Added some longer delays to some things to stop lag from breaking macro.
- Changed assist radius yet again.

UPDATE 24TH OF JULY 2006
-Fixed Line of Sight Issues in Main and Looter.

UPDATE 26TH OF JULY 2006
-Fixed a shard looting problem when your jumped while looting or after looting.


Fry.
 

Attachments

  • LSMainFry.mac
    16.9 KB · Views: 20
  • LSLooterFry.mac
    12.6 KB · Views: 17
Last edited:
disconected

I keep getting disconnected. using 3 different computers, 5 different accounts. this happens to all. This only just started to happen when I tried running lsmm. ? Anyone else having this issue?
 
MQ2Hail functionality removed, back to the way it used to be.
 
feew, thought I was losing my mind. Dont wanna look like a total Noob. lol
 
Ctd

OK this cant be me. For some reason I cant do the LSMM, I keep CTD. I even tried getting the mission with mq2 off. I just watch my packet bar drop like a rock as soon as i request mission. It's too weird. I wonder if SOE flagged all my accounts, so as soon as I request the mission my connectiion gets dropped?
 
That is extremely strange because none of that part was changed, however I did notice way back when macro'ing the old version of hte mission, that the Main person would on rare occasion go LD when running down to get the mission, toon would freeze right after the movement loop before sticking to the mission-giver. I've had no probs getting the mission, so I don't know what to tell you.
 
hackersacker said:
cant find spell_routines.inc/par
every time i try to run looter

Code:
| spell_routines.inc v2.4
| Originally Written by Rusty~
| Upkeep performed by A_Druid_00
| Includes MQ2Exchange integration for item swapping by BrainDeath
| Also includes FD fix that would cause an endless loop if you were hit by FD mid-cast by A_Druid_00
| Features:
| - Casts spells, clicks items, or uses AA abilities for you
| - Allows back to back casting without waiting on spell gems to pop all the way up
| - Will interrupt spell if target dies while casting. If on a mount, it will dismount and duck if the time left
|   is greater than 7 seconds, else it will move forward a bit to interrupt, then move you back
|    ** IMPORTANT: if you don't want to interrupt a spell while mounted, put this at the top of your macro: **
|    **   /declare noInterrupt int outer 1                                                                  **
| - Allows you to use items in bags. Equips item, clicks it, then returns it to its previous location
| - Lets you set how long you want to keep trying to cast the spell (defaults to 0)
|   If the spell is interrupted before the given time, it will recast, else it will return CAST_INTERRUPTED
| - Lets you call a custom subroutine while waiting for spell to finish casting
|   Try to keep custom subroutines very small. A common use would be to interrupt the spell if a certain condition is true
| - This file also includes a sub named Interrupt. You can call this to interrupt any spell you're casting instantly.
| - You can also use the SwapItem sub included in this to swap items to certain slots
| - Added EquipItem sub to easily equip items in your main Inventory slots.
| - Note: if you don't want this to cast spells while you're invis, in your main macro have this at the top:
|      /declare noInvis int outer 1
|   This will make it return CAST_INVIS if you're invis
|  Below is a list of outer scope variables you can access in your macros:
|      refreshTime        - How much time is left till you're done recovering from casting
|      castEndTime        - How much time left till you're done casting the current spell... usable in custom spell Subs
|      spellNotHold       - 1 if your last spell didn't take hold, 0 otherwise
|      spellRecastTime1-9 - How much time left till that spell is back up
|======================================================================================================================
|  EquipItem:  An easier way to equip items you have in bags ( useful for weapons or focus items )
|              slot name is optional. If not given, it will equip it in the first possible spot
|    Usage:
|        /call EquipItem "item name|slotname"
|        Returns: "old item name|slotname"
|    Examples:
|    To Equip Sharp Ended Broken Lever when you have Serpent of Vindication equiped:
|        /call EquipItem "Sharp Ended Broken Lever"
|    It will return "Staff of Vindication|mainhand"
|    To reequip the original item, you can save the return in a variable, and then use it later like this:
|       /varset oldPrimary ${Macro.Return}
|       | ... do stuff here with your new item equiped
|       /call EquipItem ${oldPrimary}
|======================================================================================================================
|  SwapItem:  a subroutine which is used in the Cast sub itself. You don't need to do this to cast an item in a bag
|             but you can call it in your macro to SwapItems (such as weapons or focus items)
|    Usage:
|        /call SwapItem "item name" slotname
|    Examples:
|    To swap Darkblade of the Warlord to your main hand:
|        /call SwapItem "Darkblade of the Warlord" mainhand
|    To swap stat food in one bag with other food in another bag:
|        /call SwapItem "Bristlebanes Party Platter" ${FindItem[halas 10lb meat pie].InvSlot}
|======================================================================================================================
|  Cast: the main subroutine that casts spells or items for you
|     Usage:
|        /call Cast "spellname|itemname|AAname|AA#" [item|alt|gem#] [give up time][s|m] [custom subroutine name] [Number of resist recasts]
|     Examples:
|     To cast Howl of Tashan and mem it in slot 3 if not memmed:
|       /call Cast "Howl of Tashan" gem3
|     To cast Arcane Rune and keep trying for 7 seconds, in case of interrupts.
|       /call Cast "Arcane Rune" gem5 7s
|     To click Grim Aura earring that's in a bag:
|       /call Cast "Shrunken Goblin Skull Earring" item
|     To use AA ability Eldritch Rune:
|       /call Cast "Eldritch Rune" alt
|         or
|       /call Cast "173" alt
|     To call a subroutine that interrupts CH if target gets healed before it lands:
|       /call Cast "Complete Healing" gem1 0 CheckHP
|     Then in your macro have somewhere:
|       Sub CheckHP
|          /if ( ${Target.PctHPs}>=80 ) /call Interrupt
|       /return
| Returns these values:
|----------------------+----------------------------------------------------------------------+
| CAST_CANCELLED       | Spell was cancelled by ducking (either manually or because mob died) |
| CAST_CANNOTSEE       | You can't see your target                                            |
| CAST_IMMUNE          | Target is immune to this spell                                       |
| CAST_INTERRUPTED     | Casting was interrupted and exceeded the given time limit            |
| CAST_INVIS           | You were invis, and noInvis is set to true                           |
| CAST_NOTARGET        | You don't have a target selected for this spell                      |
| CAST_NOTMEMMED       | Spell is not memmed and you gem to mem was not specified             |
| CAST_NOTREADY        | AA ability or spell is not ready yet                                 |
| CAST_OUTOFMANA       | You don't have enough mana for this spell!                           |
| CAST_OUTOFRANGE      | Target is out of range                                               |
| CAST_RESISTED        | Your spell was resisted!                                             |
| CAST_SUCCESS         | Your spell was cast successfully! (yay)                              |
| CAST_UNKNOWNSPELL    | Spell/Item/Ability was not found                                     |
|----------------------+----------------------------------------------------------------------+
#event BeginCast "You begin casting#*#"
#event Collapse "Your gate is too unstable, and collapses.#*#"
#event FDFail "#1# has fallen to the ground.#*#"
#event Fizzle "Your spell fizzles#*#"
#event Immune "Your target is immune to changes in its attack speed#*#"
#event Immune "Your target is immune to changes in its run speed#*#"
#event Immune "Your target cannot be mesmerized#*#"
#event Interrupt "Your casting has been interrupted#*#"
#event Interrupt "Your spell is interrupted#*#"
#event NoHold "Your spell did not take hold#*#"
#event NoHold "Your spell would not have taken hold#*#"
#event NoHold "You must first target a group member#*#"
#event NoHold "Your spell is too powerful for your intended target#*#"
#event NoLOS "You cannot see your target.#*#"
#event NoTarget "You must first select a target for this spell!#*#"
#event NotReady "Spell recast time not yet met.#*#"
#event OutOfMana "Insufficient Mana to cast this spell!#*#"
#event OutOfRange "Your target is out of range, get closer!#*#"
#event Recover "You haven't recovered yet...#*#"
#event Recover "Spell recovery time not yet met#*#"
#event Resisted "Your target resisted the #1# spell#*#"
#event Resisted2 "You resist the #1# spell#*#"
#event Standing "You must be standing to cast a spell#*#"
#event Stunned "You are stunned#*#"
#event Stunned "You can't cast spells while stunned!#*#"
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#"

Sub Cast(spellName,spellType,giveUpValue,mySub,int ResistTotal)
/declare castTime float local
/if (!${Defined[castReturn]}) /declare castReturn string outer CAST_CANCELLED
/if (${Me.Invis} && ${noInvis}) /return
/if (${spellType.Equal[item]}) {
  /if (!${FindItem[${spellName}].InvSlot}) /return CAST_UNKNOWNSPELL
  /varset castTime ${FindItem[${spellName}].CastTime}
} else /if (${spellType.Equal[alt]}) {
  /if (!${Me.AltAbilityReady[${spellName}]}) /return CAST_NOTREADY
  /varset castTime ${Me.AltAbility[${spellName}].Spell.MyCastTime}
} else {
  /if (!${Me.Book[${spellName}]}) /return CAST_UNKNOWNSPELL
  /declare spellID int local ${Me.Book[${Me.Book[${spellName}]}].ID}
  /varset castTime ${Spell[${spellName}].MyCastTime}
  /if (${Me.CurrentMana}<${Spell[${spellID}].Mana}) /return CAST_OUTOFMANA
}
/if (${castTime}>0.1) {
  /if (${Stick.Status.Equal[ON]}) /stick pause
  /if (${FollowFlag}) /call PauseFunction
  /if (${Me.Moving}) /keypress back
}
/if (!${Defined[spellType]}) /declare spellType string local spell
/if (!${Defined[spellRecastTime1]}) {
  /if (!${Defined[noInterrupt]}) /declare noInterrupt int outer 0
  /declare ResistCounter int outer
  /declare moveBack bool outer false
  /declare selfResist int outer
  /declare selfResistSpell string outer
  /declare giveUpTimer timer outer
  /declare castEndTime timer outer
  /declare refreshTime timer outer
  /declare itemRefreshTime float outer
  /declare i int local
  /declare spellNotHold int outer
  /delay 5
  /for i 1 to 9
  /declare spellRecastTime${i} timer outer
  /if (${Me.SpellReady[${i}]}) {
    /varset spellRecastTime${i} 0
  } else {
    /varcalc spellRecastTime${i} 10*${Me.Gem[${i}].RecastTime}
  }
  /next i
}
/if (${Defined[giveUpValue]}) /varset giveUpTimer ${giveUpValue}
/if (${Defined[ResistTotal]}) /varset ResistCounter ${ResistTotal}
/varset spellNotHold 0
/varset selfResist 0
:wait_for_stop
/if (${Me.Casting.ID} || (${Me.Moving} && ${castTime}>0.1)) {
  /if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
  /goto :wait_for_stop
}
/if (${Window[SpellBookWnd].Open}) /keypress spellbook
/if (${Me.Ducking}) /keypress duck
/call DoCastingEvents
/varset castReturn X
/if (${spellType.Equal[item]}) /call ItemCast "${spellName}" "${mySub}"
/if (${spellType.Equal[alt]}) /call AltCast "${spellName}" "${mySub}"
/if (${spellType.NotEqual[item]} && ${spellType.NotEqual[alt]}) /call SpellCast "${spellType}" "${spellName}" "${mySub}" "${spellID}" "${giveUpValue}"
/if (${Stick.Status.Equal[PAUSED]}) /squelch /stick unpause
/if (${PauseFlag}) /call PauseFunction
/varset giveUpTimer 0
/varset ResistCounter 0
/return ${castReturn}

Sub SpellCast(spellType,spellName,mySub,int spellID,giveUpValue)
:cast_spell
/if (!${Me.Gem[${spellName}]}) {
  /if (${Cursor.ID}) /call ClearCursor
  /if (${spellType.Left[3].Equal[gem]}) {
    /memspell ${spellType.Right[1]} "${spellName}"
  } else {
    /return CAST_NOTMEMMED
  }
  /if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
  /delay 6s ${Me.Gem[${spellName}]}
  /if (${Me.Gem[${spellName}]}) /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
  /if (!${Me.Gem[${spellName}]}) /return CAST_INTERRUPTED
  :wait_for_mem
  /if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
  /delay 15s ${Me.SpellReady[${spellName}]}
  /if (!${Me.SpellReady[${spellName}]}) {
    /if (${giveUpTimer}) /goto :wait_for_mem
    /return CAST_NOTREADY
  }
}
/varset spellType spell
/if (${spellName.Find[illusion: ]} && ${Me.AltAbilityReady[project illusion]}) /call Cast "project illusion" alt
/varset giveUpTimer ${giveUpValue}
/declare recoverWaitTime timer local 30
:cast_spell_loop
/if (!${Me.SpellReady[${spellName}]} && (${spellRecastTime${Me.Gem[${spellName}]}}<${giveUpTimer} || ${refreshTime}>0 || ${castReturn.Equal[CAST_RESISTED]})) {
  /if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
  /goto :cast_spell_loop
} else {
  /if (!${Me.SpellReady[${spellName}]} && !${castReturn.Equal[CAST_RESISTED]}) /return CAST_NOTREADY
}
/cast "${spellName}"
/if (${Me.Casting.ID}) {
  /varset spellID ${Me.Casting.ID}
  /varcalc castEndTime ${Me.Casting.MyCastTime}*10
  /if (${castEndTime}<${Math.Calc[${Me.Casting.CastTime}*5]}) /varcalc castEndTime ${Me.Casting.CastTime}*5
}
/varset moveBack false
/call WaitCast ${mySub} ${spellID}
/if (${moveBack}) {
  /keypress back hold
  /delay 4
  /keypress back
  /delay 15 !${Me.Moving}
}
/if (${castReturn.Equal[CAST_CANCELLED]}) /return CAST_CANCELLED
/call DoCastingEvents
/if (!${castReturn.Equal[CAST_SUCCESS]}) {
  /if (${castReturn.Equal[CAST_RECOVER]}) {
    /if (!${recoverWaitTime}) {
      /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
      /if (!${giveUpTimer}) /return CAST_NOTREADY
    }
    /goto :cast_spell_loop
  }
  /if (${castReturn.Equal[CAST_RESTART]} || ${castReturn.Equal[CAST_STUNNED]} || ${castReturn.Equal[CAST_FIZZLE]} || ${castReturn.Equal[CAST_COLLAPSE]} || (${castReturn.Equal[CAST_INTERRUPTED]} && ${giveUpTimer}) || (${castReturn.Equal[CAST_RESISTED]} && ${ResistCounter})) /goto :cast_spell_loop
}
/if (!${castReturn.Equal[CAST_CANNOTSEE]} && !${castReturn.Equal[CAST_OUTOFRANGE]} && !${castReturn.Equal[CAST_OUTOFMANA]} && !${castReturn.Equal[CAST_NOTARGET]} && !${castReturn.Equal[CAST_INTERRUPTED]}) {
  /varcalc refreshTime 10*${Spell[${spellID}].RecoveryTime}
  /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
}
/return

Sub ItemCast(spellName,mySub)
/declare charges int local
/declare oldItemName string local
/declare slotName string local
/declare swapItemBack bool local false
:cast_item
/if (${FindItem[${spellName}].InvSlot}>21) {
  /varset swapItemBack true
  /if (${FindItem[${spellName}].WornSlot[1]} && ${FindItem[${spellName}].EffectType.Find[worn]}) {
    /varset slotName ${FindItem[${spellName}].WornSlot[1].Name}
  } else /if (${FindItem[${spellName}].InvSlot}>29) {
    /varset slotName pack8
  } else {
    /varset slotName ${FindItem[${spellName}].InvSlot.Name}
  }
  /varset oldItemName ${InvSlot[${slotName}].Item.Name}
  /call SwapItem "${spellName}" ${slotName}
}
:wait_item_loop
/if (${itemRefreshTime}>${MacroQuest.Running}) /goto :wait_item_loop
/varset itemRefreshTime ${Math.Calc[${MacroQuest.Running}+000]}
/varset charges ${FindItem[${spellName}].Charges}
/cast item "${spellName}"
/if (${Me.Casting.ID}) /varcalc castEndTime ${FindItem[${spellName}].CastTime}*10
/if (${charges}) /delay 1s ${FindItem[${spellName}].Charges}!=${charges}
/call WaitCast ${mySub}
/if (${FindItem[${spellName}].CastTime}<0.5) /delay 5
/if (${swapItemBack} && ${FindItem[${oldItemName}].ID}) /call SwapItem "${oldItemName}" ${slotName}
/if (${castReturn.Equal[CAST_CANCELLED]}) /return CAST_CANCELLED
/call DoCastingEvents
/if (${castReturn.Equal[CAST_RESTART]} || ${castReturn.Equal[CAST_STUNNED]} || (${castReturn.Equal[CAST_INTERRUPTED]} && ${giveUpTimer}) || ${castReturn.Equal[CAST_COLLAPSE]} || (${castReturn.Equal[CAST_RESISTED]} && ${ResistCounter})) /goto :cast_item
/return

Sub AltCast(spellName,mySub)
:cast_alt
/alt activate ${Me.AltAbility[${spellName}].ID}
/delay 5 ${Me.Casting.ID}
/call WaitCast ${mySub}
/if (${castReturn.Equal[CAST_CANCELLED]}) /return CAST_CANCELLED
/call DoCastingEvents
/if (${castReturn.Equal[CAST_RESTART]} || ${castReturn.Equal[CAST_STUNNED]} || (${castReturn.Equal[CAST_INTERRUPTED]} && ${giveUpTimer}) || (${castReturn.Equal[CAST_RESISTED]} && ${ResistCounter})) /goto :cast_alt
/return

Sub ClearCursor
/declare i int local
:auto_inv
/if (${Cursor.ID}) {
  /if (${Cursor.Container}) {
    /for i 1 to 8
    /if (!${InvSlot[pack${i}].Item.Container}) /nomodkey /itemnotify pack${i} leftmouseup
    /next i
  } else {
    /timed 5 /autoinventory
  }
  /goto :auto_inv
}
/return

Sub DoCastingEvents
/doevents Recover
/doevents BeginCast
/doevents Fizzle
/doevents Interrupt
/doevents Standing
/doevents FDFail
/doevents OutOfRange
/doevents OutOfMana
/doevents NoLOS
/doevents Resisted2
/doevents Resisted
/doevents Immune
/doevents Stunned
/doevents Collapse
/doevents NoTarget
/doevents NotReady
/doevents NoHold
/return

Sub EquipItem(WhatWhere)
/declare DestName string local
/declare ItemName string local ${WhatWhere.Arg[1,|]}
/declare SlotName string local ${WhatWhere.Arg[2,|]}
/if (${SlotName.Equal[NULL]}) /varset SlotName ${InvSlot[${FindItem[=${ItemName}].WornSlot[1]}].Name}
/if (${FindItem[=${ItemName}].InvSlot}<22 || !${FindItem[=${ItemName}].WornSlot[${SlotName}]}) /return
/if (!${InvSlot[${SlotName}].Item.Name.Equal[NULL]}) /varset DestName "${InvSlot[${SlotName}].Item.Name}|${SlotName}"
/call SwapItem "${ItemName}" "${SlotName}"
/return ${DestName}

Sub Interrupt
/if (${Me.Mount.ID}) /dismount
/stopcast
/if (${Defined[castReturn]}) /varset castReturn CAST_CANCELLED
/return ${castReturn}

Sub SwapItem(itemName,slotName)
/declare i int local
/if (${Cursor.ID}) /call ClearCursor
/exchange "${itemName}" ${slotName}
/delay 5s ${InvSlot[${slotName}].Item.Name.Equal[${itemName}]}
/if (${Cursor.ID}) /call ClearCursor
/return

Sub WaitCast(mySub,int spellID)
/declare currentTarget int local ${Target.ID}
/declare currentTargetType string local ${Target.Type}
:wait_cast_loop
/if (${Bool[${mySub}]}) /call ${mySub} ${spellID}
/if (${Me.Casting.ID}) {
  /if (${currentTarget} && !${Spawn[${currentTarget}].Type.Equal[${currentTargetType}]}) {
    /if (!${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && !${moveBack} && (!${Me.Mount.ID} || !${noInterrupt})) {
      /if (!${Me.Mount.ID} || ${castEndTime}>70) {
        /call Interrupt
      } else /if (${Me.Casting.RecastTime}>3) {
        /varset castReturn CAST_CANCELLED
        /keypress forward hold
        /delay 6
        /keypress forward
        /varset moveBack true
      }
    }
  }
  /if (${Me.State.Equal[DUCK]}) /varset castReturn CAST_CANCELLED
  /goto :wait_cast_loop
}
/return

Sub Event_BeginCast
/if (${Defined[castReturn]}) /varset castReturn CAST_SUCCESS
/return

Sub Event_Collapse
/if (${Defined[castReturn]}) /varset castReturn CAST_COLLAPSE
/varset giveUpTimer 200
/return

Sub Event_FDFail(line,name)
/if (${name.Equal[${Me.Name}]} && ${Defined[castReturn]}) {
  /if (!${Me.Standing}) /stand
  /varset castReturn CAST_RESTART
}
/return

Sub Event_Fizzle
/if (${Defined[castReturn]}) /varset castReturn CAST_FIZZLE
/return

Sub Event_Immune
/if (${Defined[castReturn]}) /varset castReturn CAST_IMMUNE
/return

Sub Event_Interrupt
/if (${Defined[castReturn]}) /varset castReturn CAST_INTERRUPTED
/return

Sub Event_NoHold
/if (${Defined[spellNotHold]}) /varset spellNotHold 1
/return

Sub Event_NoLOS
/if (${Defined[castReturn]}) /varset castReturn CAST_CANNOTSEE
/return

Sub Event_NoTarget
/if (${Defined[castReturn]}) /varset castReturn CAST_NOTARGET
/return

Sub Event_NotReady
/if (${Defined[castReturn]}) /varset castReturn CAST_NOTREADY
/return

Sub Event_OutOfMana
/if (${Defined[castReturn]}) /varset castReturn CAST_OUTOFMANA
/return

Sub Event_OutOfRange
/if (${Defined[castReturn]}) /varset castReturn CAST_OUTOFRANGE
/return

Sub Event_Recover
/if (${Defined[castReturn]}) /varset castReturn CAST_RECOVER
/return

Sub Event_Resisted(line,name)
/if (${selfResist} && ${name.Equal[${selfResistSpell}]}) /varset selfResist 0
/if (${ResistCounter}) /varcalc ResistCounter ${ResistCounter}-1
/if (${Defined[castReturn]}) /varset castReturn CAST_RESISTED
/return

Sub Event_Resisted2(line,name)
/if (${Defined[selfResist]}) {
  /varset selfResist 1
  /varset selfResistSpell ${name}
}
/return

Sub Event_Standing
/stand
/if (${Defined[castReturn]}) /varset castReturn CAST_RESTART
/return

Sub Event_Stunned
/if (${Me.Stunned}) {
  /delay 3s !${Me.Stunned}
} else {
  /delay 7
}
/if (${Defined[castReturn]}) /varset castReturn CAST_STUNNED
/return
 
it

its there just wont load..its being dumb and stuff..
any help?..me and friend are trying to runn..hes going just fine but im having trouble.
 
hackersacker said:
its there just wont load..its being dumb and stuff..
any help?..me and friend are trying to runn..hes going just fine but im having trouble.

Part of looter code.
Code:
#include Spell_routines.inc

The capital S might be throwing it off. I got no idea what the /par means.
 
lsmm lockout

I am really beginning to think sony placed a lockout on lsmm. I can only do one mission a day. Trying to do more and I just get disconnected.

edit: Looks like my main char I used a lot b4. she cant be in the group when I initially get the mission. I have to task add her later. Otherwise, all my computers CTD.
 
Last edited:
- Restarting macro inside will reset Goblin count back to 0, in work

Is there a set number of mobs in the zone?

/who npc

# this is how many are in the zone so x-y=how many I've killed
 
will look into that, that could work if they're always the same, via ${Spawncount[npc goblin]}
 
So who's all having problems using MQ2Hail? It seems like that was a much cleaner way to save the captives.

And you're welcome to use MQ2MonsterMission / MQ2GetMission (I can't remember which one I released) to aquire the missions.. I could even throw together a LavaStorm plugin that lets you get the mission, and has a hail routine built in. :) Although with Lava, it was easy to get the mission by hailing, wasn't it?
 
Yeah normal hailing was working as effectively as /hailtarget for lava mission at least, cause even with /hailtarget there were a few occasions where it wouldn't update, but np macro just loops through until you get the success text. Only diff is less lines using mq2hail, but not really in functionality.
 
Bloodcell said:
I cant use mq2hail

Does it not do anything? Or does it give an error/CTD? (Sorry, I don't mean to hijack the thread. I'll move the response to a new thread) :)