I am starting off with this macro, and building on top to make this work specificaly for my monk. The macro kills, and loots just fine, but there are two problems I have here.
First, the macro tends to target mobs from accross the zone - I really dont want it doing that. Ive made changes in KS Radius and such, as a trial and error test, but it still does the same. Is there a way to change this?
Also, the macro loots fine, the only problem is destroying the loot. The cursor is moved about an inch below the destroy button, every time. Any suggestions there? I am using the EQ default UI... I'll post the code below. Thanks all.
Code: Select all
#define MyXLOC v40
#define MyYLOC v41
#define KSRadius v42
#define NotSee v43
#define TooFar v44
#define MyTarget v45
#define TargetDead v46
#define HasTarget v47
#define MobToHunt v48
#define ObstCount v49
#define LootSlot v50
#define CheckLoot v51
#define LootTotal v52
#define MobArraySize v53
#define MobDistance v54
Sub Main
/zapvars
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
/varset LootSlot 0
/varset CheckLoot 0
/varset a(1,0) "substance"
/varset LootTotal 1
/varset a(2,0) "sonic"
/varset a(2,1) "owlbear"
/varset KSRadius 10
/varset HasTarget 0
/varset ObstCount 0
/varset MobArraySize 2
/varset MobDistance 5
/delay 1s
/lootn never
:Start
/call GetTarget
/if $HasTarget=="1" /call MoveToMob
/if $HasTarget=="1" /call CheckKs
/if $HasTarget=="1" /call CombatSub
/if $HasTarget=="1" /call MoveToMob
/if $HasTarget=="1" /call LootMob
/call ResetSub
/goto :Start
/return
sub GetTarget
:Aquire
/target nopcnear $KSRadius npc "$a(2,$rand($MobArraySize))"
/varset MyTarget $target(id)
/varset TargetDead 0
/if n $target(id)==0 /goto :Aquire
/if $target()=="False" /goto :Aquire
/varset HasTarget 1
/return
sub MoveToMob
/delay 2s
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/if n $target(distance)<=$MobDistance {
/face fast nopredict
/return
}
/sendkey down up
:Movementloop
/varadd ObstCount 1
/if $target()=="FALSE" {
/varset HasTarget 0
/return
}
/face fast nopredict
/if n $target(distance)<=$MobDistance {
/face fast
/sendkey up up
/return
}
/if $ObstCount>=3 {
/call CheckObst
/goto :Movementloop
}
/if n $target(distance)>$MobDistance /goto :MovementLoop
/return
sub CheckKS
/if $target()=="FALSE" {
/varset HasTarget 0
/return
}
/target nopcnear $KSRadius npc "$MobToHunt"
/if $target(id)!=$MyTarget {
/echo Target $target(id) and MyTrgId $MyTarget does not match
/echo Starting fresh with new target.
/varset HasTarget 0
/return
}
/return
sub CombatSub
/if $target()=="FALSE" {
/varset HasTarget 0
/return
}
/attack on
:combatloop
/face fast nopredict
/if n $target(distance)>13 {
/sendkey down up
/goto :combatloop
}
/if n $target(distance)<=$MobDistance /sendkey up up
/face fast nopredict
/if n $target(id)==0 /varset TargetDead 1
/if n $TargetDead!=1 /goto :combatloop
/delay 1s
/target id $MyTarget
/return
sub LootMob
/loot
/delay 2s
:lootloop
/if n $LootSlot==0 /click left corpse $LootSlot
/if n $LootSlot==1 /click left corpse $LootSlot
/if n $LootSlot==2 /click left corpse $LootSlot
/if n $LootSlot==3 /click left corpse $LootSlot
/if n $LootSlot==4 /click left corpse $LootSlot
/if n $LootSlot==5 /click left corpse $LootSlot
/if n $LootSlot==6 /click left corpse $LootSlot
/if n $LootSlot==7 /click left corpse $LootSlot
/if n $LootSlot==8 /click left corpse $LootSlot
/if n $LootSlot==9 /goto :doneloot
/delay 1s
/if "$cursor()"!="TRUE" /goto :doneloot
:lootChecker
/if "$cursor(name)"~~"$a(1,$CheckLoot)" {
/delay 1s
/click left auto
/varadd LootSlot 1
/goto :lootloop
}
/varadd CheckLoot 1
/if "$cursor()"=="TRUE" {
/if n $CheckLoot<$LootTotal /goto :lootchecker
}
/if "$cursor()"=="TRUE" {
/delay 1s
/click left destroy
/delay 1s
}
/varadd LootSlot 1
/varset CheckLoot 0
/goto :lootloop
:doneloot
/varset LootSlot 0
/return
sub ResetSub
/sendkey up up
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
/varset CheckLoot 0
/varset HasTarget 0
/varset ObstCount 0
/delay 1s
/return
sub CheckObst
/if n $MyXLOC==$char(x) /if n $MyYLOC==$char(y) /call HitObst 5
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
/return
sub HitObst
/sendkey up up
/sendkey down down
/if n $rand(99)>50 {
/delay 3s
/sendkey up down
/sendkey down Right
/delay $p0
/sendkey up Right
/sendkey down up
/delay 3s
/sendkey up up
} else {
/delay 3s
/sendkey up down
/sendkey down left
/delay $p0
/sendkey up left
/sendkey down up
/delay 3s
/sendkey up up
}
/sendkey up down
/sendkey up Right
/sendkey up Left
/sendkey down up
/return


