Code: Select all
Sub Main
/varset Pulled 0
/varset Pet 0
/varset Mob 0
/varset Dark 0
/varset Doted 0
/varset MobDead 0
/varset LootSlot 0
:Start
/target id $Mob
/if (n $spawn($Mob,hp,pct)<6 && $target(id)!=$Mob) /call TargetCorpse
/if n $MobDead==1 /call Loot
/goto :Start
/return
Sub TargetCorpse
/echo TargetCorpse
/target corpse
/varset MobDead 1
/echo Set
/return
Sub Loot
/echo Loot
/stand
:GoToCorpse
/if n $target(distance)>10 {
/face
/sendkey down up
/goto :GoToCorpse
}
/press up
/loot
/delay 10
/varset LootSlot 0
:LootLoop
/if $cursor(name)=="NULL" /goto :LootDone
/click left corpse $LootSlot
/delay 5
/if $cursor(name)"~~""ItemIDontWant" {
/click left destroy
} else /click left auto
/delay 4
/varadd $LootSlot 1
/goto :LootLoop
:LootDone
/delay 4
/press ESC
/returnThis isnt all the code but it is the only part that isnt working.
If I put in some debugint echos, it seems to get stuck looping between
Code: Select all
/if (n $spawn($Mob,hp,pct)<6 && $target(id)!=$Mob) /call TargetCorpseCode: Select all
Sub TargetCorpse
/echo TargetCorpse
/target corpse
/varset MobDead 1
/echo Set
/return




