#Event PoK "You have entered The Plane of Knowledge."
Sub main
/alert add 1 ${Me.Name}
|ENTER ALL YOUR TOONS NAME HERE eg.
/lootnodrop never
/declare MyXLOCA int outer 0
/declare MyYLOCA int outer 0
/declare BreakLoop int outer 0
/declare AnchorX int outer ${Me.X}
/declare AnchorY int outer ${Me.Y}
/declare LootSlot int outer 0
/declare LootCheck int outer 0
/declare LootTotal int outer 0
/declare locv1 int outer 0
/declare xDistance int outer 0
:Loopa
/call GMCheck
/call PCCheck
/call AnimatedCheck
/call Loot
/call CheckAnchor
/delay 1m
/goto :Loopa
/endmacro
Sub Loot
:LtLoop
/varcalc locv1 ${locv1}+1
/target corpse radius 390
/if (!${Target.ID} || ${Target.Type.NotEqual[Corpse]}) /return
/varset xDistance 5
/call GotoBody ${Target.ID}
/if (${Target.ID}) /face nolook fast
/loot
/delay 40 ${Window[LootWnd].Open}
/if (!${Corpse.Items}) {
/goto :ExitSWLt
}
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/itemnotify loot${LootSlot} rightmouseup
/delay 10 ${Cursor.ID}
/notify InventoryWindow IW_CharacterView rightmouseup
/delay 10
:NextSWLt
/next LootSlot
:ExitSWLt
/cleanup
/delay 10
/if (${locv1}<4) /goto :LtLoop
/return
Sub GotoBody(BodyID)
/varset BreakLoop 0
/if (${Me.Mount.ID}) {
/dismount
/delay 10
}
/if (${Me.Sitting}) /stand
/if (${Target.ID}!=${BodyID}) {
/keypress clear_target
/delay 3
/target id ${BodyID}
/delay 3
}
:KeepGoingBody
/doevents
/delay 0
/if (${BreakLoop}==1) /return
/if (${Target.Distance}>=10) {
/face nolook fast
/keypress forward hold
}
/if (${Target.Distance}<10) {
/varset BreakLoop 1
/keypress forward
/return
}
/call CheckObstacle
/if (${BreakLoop}!=1) /goto :KeepGoingBody
/return
|# Checks to see if we may have bumped into something that is stopping us
sub CheckObstacle
|# Record our current position, wait a moment and then check if its the same
/varset MyXLOCA ${Me.X}
/varset MyYLOCA ${Me.Y}
/delay 2
/if (${MyXLOCA}==${Me.X} && ${MyYLOCA}==${Me.Y}) /call Obstacle
/return
|# Uses strafe and randomness to try and get around things
sub Obstacle
/keypress forward
/keypress back hold
/delay 5
/keypress back
/if (${Math.Rand[2]}) {
/keypress strafe_right hold
/delay 3
/keypress strafe_right
} else {
/keypress strafe_left hold
/delay 3
/keypress strafe_left
}
/keypress forward hold
/return
Sub CheckAnchor
/if (${Math.Distance[${AnchorY},${AnchorX}]}>12) /call MoveToAnchor
/return
Sub MoveToAnchor
/declare iCount int local
/varset iCount 0
/echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}.
:AnchorMoveLoop
/delay 1
/doevents
/face nolook loc ${AnchorY},${AnchorX}
/if (${Math.Distance[${AnchorY},${AnchorX}]}>12) {
/keypress forward hold
} else {
/keypress forward
/face away loc ${AnchorY},${AnchorX}
/return
}
/if (${iCount}>2) {
/call Detectobst
/face nolook loc ${AnchorY},${AnchorX}
/varset iCount 0
}
/varcalc iCount ${iCount}+1
/goto :AnchorMoveLoop
/return
Sub Detectobst
/return
/endmacro
sub PCCheck
|If any PCs are too close, go into standby.
/if (${Spawn[pc noalert 1 radius 550].ID}) {
/echo Holding.... until PC out of Range..
/echo Foreign PC (${Spawn[pc noalert 1 radius 550].Name}) detected inside Paranoia Range - going into Standby mode.
/mqlog Foreign PC (${Spawn[pc noalert 1 radius 550].Name}) detected inside Paranoia Range - going into Standby mode.
}
/doevents
:Standby
/if (${Math.Calc[${Spawn[pc noalert 1 radius 550].ID}==NULL]}) {
/echo No PC characters in range...
/return
} else {
/delay 5s
/goto :Standby
}
/return
Sub Event_Chat(string ChatType,string Sender,string ChatText)
/mqlog ${ChatType}: ${Sender} tells you: ${ChatText}
/return
Sub Event_PoK
/echo DEAD! Ending macro!
/camp desktop
/endmacro
/return
Sub AnimatedCheck
:Hold
/if ( ${NearestSpawn[npc a guardian of marr radius 350].ID} || ${NearestSpawn[npc protector radius 350].ID} || ${NearestSpawn[npc animated radius 350].ID}) {
/echo Avoid enemy in range, aborting Loot functions... holding..
/delay 1m
/goto :Hold
} else {
/echo No Loot killers in range...
/return
}
/return
Sub GMCheck
/if (${Spawn[gm].ID}) {
/beep
/beep
/beep
/echo GM has entered the zone!
/echo $&#* HIM but ending the macro...
/keypress forward
/keypress back
/quit
/endmacro
}
/return