|LSMain.mac
|Written by Booges 20 APR 06
|Version: 2.1
|-Required Plugins: MQ2MoveUtils, MQ2MMOBUGSTOOLS, MQ2Exchange
|
|- 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
#include Spell_routines.inc
#turbo 10
#Chat Group
#Chat Tell
#Event Camping "It will take you about 30 seconds to prepare#*#"
#event Goblindeath "You have slain#*#"
#event Goblindeath "#1# has been slain by #*#"
#event Lava "#*#You have entered The Lavastorm Mountains#*#"
#event Nogroup "#*#this shared task because your party does not contain the minimum#*#"
#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
|--------------------------------------------------------------------
/declare Password string outer "Fuck You"
|--------------------------------------------------------------------
|## NO EDIT
|--------------------------------------------------------------------
/declare Waittimer int outer 0
/declare Missiontimer timer outer 0
/declare WinCount int outer 0
/declare Goblincount int outer 0
/declare Currentzone string outer ${Zone.ID}
/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] -723 -543 44
/varset Goblinloc[19] -435 -869 42
/varset Goblinloc[20] -387 -890 44
/varset Goblinloc[21] -439 -922 43
/varset Goblinloc[22] -356 -614 56
/varset Goblinloc[23] -338 -663 56
/varset Goblinloc[24] -365 -778 44
/varset Goblinloc[25] -330 -744 44
/Echo ==============+==============
/Echo ## Lavastorm AFK V2.1 ##
/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
/if (${Spawn[npc "goblin" radius 20].ID}) /call Fight
/Call Hostages
:Checkgobs
/if (${Goblincount}<42) {
/call DoGoblins
/goto :Checkgobs
}
/if (${Spawn[npc "goblin" radius 20].ID}) /call Fight
/if (${Zone.ID}==27) /return
/delay 2s
/target clear
/return
|--
|##40 Goblin Script
|------------------
Sub DoGoblins
/declare intcount int local
/exchange "Reinforced Armor Plating" Chest
/delay 1s
/exchange "Diamond Tipped Drill Bit" mainhand
/delay 1s
/for intcount 1 to 25
/if (${Currentzone}!=${Zone.ID}) /call Event_Lava
/squelch /target clear
/warp loc ${Goblinloc[${intcount}]}
/delay 4s
/keypress back hold
/delay 3
/keypress back
/delay 1s
/if (${Spawn[npc radius 5].ID}) /target goblin npc
/if (${Me.AbilityReady[kick]}) /doability kick
/warp s
/face heading 90
/delay 5s
:wait1
/if (${Target.Distance}>27) /goto :wait1
/call Fight
/doevents
/if (${Target.ID} || ${Spawncount[npc goblin radius 30]} || ${Me.Buff["Root"].ID} || ${Me.Buff["Instill"].ID} || ${Me.PctHPs}<58) /goto :wait1
/next intcount
/return
|--
|##Retrieve the Mission and zone in
|----------------------------------
Sub Reset
/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
:OMGWAIT1
/if (${Window[TaskSelectWnd].Open}) {
/notify TaskSelectWnd AcceptButton leftmouseup
/delay 3s
/goto :Okyourgood1
}
/goto :OMGWAIT1
:Okyourgood1
/delay 1s
/doevents
/delay 1s
:OMGWAIT2
/if (${Window[TaskTemplateSelectWnd].Open}) {
/notify TaskTemplateSelectWnd TaskTemplateSelectListOptional listselect ${Window[TaskTemplateSelectWnd].Child[TaskTemplateSelectListOPtional].List[Juggernaut]}
/delay 1s
/notify TaskTemplateSelectWnd TaskTemplateSelectAcceptButton leftmouseup
/delay 3s
/goto :Okyourgood2
}
/goto :OMGWAIT2
:Okyourgood2
/cleanup
/tar Clockwork_Commander_Cogswain
/face
/delay 2s
/stick 10
/varset Goblincount 0
/varset Missiontimer 45m
/delay 10s
/squelch /stick off
:hailwait
/keypress h
/delay 15s
/if (${Zone.ID}==27) /goto :hailwait
/delay 10s
/call Start
/return
|--
|##Loot Sub, checks for nearby mob
|---------------------------------
Sub Loot
:again
/if (${Zone.ID}==31) {
/If (${Cursor.ID}) /autoinventory
/call Fight
/target Chest
/target id ${Spawn[npc race "Chest"].ID}
/delay 1s
/If (${Target.Distance}>8) /warp target
/delay 1s
/open
/delay 1s
/target corpse
/if (${Target.Type.NotEqual[corpse]}) /call Fade
/delay 3s
/loot
/delay 3s
/doevents Hostile
/itemnotify loot2 rightmouseup
/delay 3s
/notify ConfirmationDialogBox Yes_Button leftmouseup
/delay 2s
/notify LootWnd DoneButton Leftmouseup
/delay 3s
/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 4m
/call Fight
:Forever
/if (!${Missiontimer}) && (${Zone.ID}==31)) {
/target Comm
/delay 1s
/warp t
/delay 5
/say evac
/delay 5s
}
/if (${Currentzone}!=${Zone.ID}) /call Event_Lava
/doevents
/goto :Forever
} else {
/call Reset
}
/return
|--
|##Attack mobs if they prevent you from looting
|----------------------------------------------
Sub Fight
:Checkfight
/If (${Zone.ID}!=31) /return
/If (${Spawn[npc "goblin" radius 25].LineOfSight}) {
/if (${Spawn[npc Shaman radius 25].ID}) {
/target Shaman npc
/goto :Targeted
} else /if (${Spawn[npc Wizard radius 25].ID}) {
/target Wizard npc
/goto :Targeted
} else /if (${Spawn[npc Rogue radius 25].ID}) {
/target Rogue npc
/goto :Targeted
} else {
/target goblin npc
}
:Targeted
/delay 5
/stick 10
:Mob
/attack on
/doevents
/If (${FindItem["Anti-Infantry Bomb"].InvSlot} && ${Target.LineOfSight}) {
/delay 1s
/call Cast "Anti-Infantry Bomb" item 3s
}
/If (${FindItem["Heat Sinks"].InvSlot} && !${Me.Buff["Heat Sink Activated"].ID}) /Call Cast "Heat Sinks" item
/If (${Target.Type.Equal[NPC]} && ${Spawn[npc "goblin" radius 24].LineOfSight}) {
/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,int pointnum)
/declare StartZone int local ${Zone.ID}
/declare StuckXLoc int local ${Me.X}
/declare StuckYLoc int local ${Me.Y}
/declare iCount int local
/varset iCount 0
/squelch /stick off
/if ((${MoveX}==9999) && (${MoveY}==9999)) {
/varcalc MoveX ${Target.X}+1
/varcalc MoveY ${Target.Y}-10
}
/keypress forward hold
/keypress Space
:AnchorMoveLoop
/if (${Zone.ID}!=${StartZone}) /return
/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 10
/keypress strafe_right
/keypress strafe_left
}
/if (${Zone.ID}!=${StartZone}) /return
} else {
/keypress forward
/return
}
/if (${iCount}>2) {
/face nolook loc ${MoveY},${MoveX}
/varset iCount 0
/if (${Zone.ID}!=${StartZone}) /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(junk, Killer)
|-----------------------
Sub Event_Goblindeath
/declare AmtKilled string local ${Killer}
/if ((${AmtKilled.Equal[{${Group.Member[1]}]}) || (${AmtKilled.Equal[{${Group.Member[2]}]}) || (${AmtKilled.Equal[{${Group.Member[3]}]}) || (${AmtKilled.Equal[{${Group.Member[4]}]}) || (${AmtKilled.Equal[{${Group.Member[5]}]})) /return
/varcalc Goblincount ${Goblincount}+1
/echo Goblin Dead! ${Math.Calc[40-${Goblincount}]} To Go!
/return
|--
|##Remove task upon zoning to Lavastorm
|--------------------------------------
Sub Event_Lava
/declare g int local 0
/declare g2 int local 0
/doevents flush
/delay 10s
/varset Currentzone ${Zone.ID}
/If (${Me.Sitting}) /stand
/for g 0 to ${Group.Members}
/varcalc g2 ${Group.Members}-${g}
/taskremove ${Group.Member[${g2}]}
/next g
/delay 5m
/call Reset
/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
/varset Currentzone ${Zone.ID}
/if (${Zone.ID}==27) /call Event_Lava
/return
|--
|##Hailing Hostages now
|------------------------------------------------
Sub Hostages
/echo ! Saving the Hostages !
/exchange "Reinforced Armor Plating" Chest
/delay 1s
/exchange "Diamond Tipped Drill Bit" mainhand
/delay 1s
:1
/target hostage01
/if (!${Target.ID}) /goto :2
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:2
/target hostage02
/if (!${Target.ID}) /goto :3
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:3
/target hostage03
/if (!${Target.ID}) /goto :4
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:4
/target hostage04
/if (!${Target.ID}) /goto :5
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:5
/target hostage05
/if (!${Target.ID}) /goto :6
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
/warp s
/delay 1s
/fade
/delay 20s
:6
/target hostage06
/if (!${Target.ID}) /goto :7
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:7
/target hostage07
/if (!${Target.ID}) /goto :8
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:8
/target hostage08
/if (!${Target.ID}) /goto :9
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:9
/target hostage09
/if (!${Target.ID}) /goto :10
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:10
/target hostage10
/if (!${Target.ID}) /goto :11
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
/warp s
/delay 1s
/fade
/delay 20s
:11
/target hostage11
/if (!${Target.ID}) /goto :12
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:12
/target hostage12
/if (!${Target.ID}) /goto :13
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:13
/target hostage13
/if (!${Target.ID}) /goto :NONE
/delay 5
/warp t
/keypress h
/delay 30
/keypress h
/delay 2s
/keypress h
/delay 10
/autoinventory
:None
/doevents
/delay 5
/autoinventory
/delay 5
/warp s
/delay 1s
/fade
/return