Sub Loot
:again
/if (${Zone.ID}==31) {
/autoinventory
/call Fade
/If (${Cursor.ID}) /autoinventory
/target id ${Spawn[object 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