Attack Nearest with Halberd and Swap to Katana (V) by Jaseowns

1# Attack Nearest with Halberd and Swap to Katana by Jaseowns
2# UO Outlands
3
4if findtype "halberd" backpack 1790 as item
5    dclick item
6    wait 200
7endif
8
9hotkey "Target Closest Grey Monster"
10wait 200
11if insysmsg "no one matching"
12    // do nothing
13    stop
14else
15    attack lasttarget 
16endif
17
18while hidden
19    // wait to strike
20    wait 50
21endwhile
22
23if findtype "katana" backpack 1790 as item
24    dclick item
25elseif findtype "halberd" backpack 1790 as item
26    dclick item
27endif
28
29@clearignore
30if not hidden and findtype "Elven Spellblade" backpack and findtype "corpse" ground -1 -1 2 as jorpse
31    while not targetexists 
32        useskill 'forensicevaluation'
33    endwhile
34    if targetexists 
35        hotkey "Target Self"
36        @ignore jorpse
37    endif
38endif
39@clearignore