Attack Nearby Monster or Harvest by tang_67330
Description: Tested with 1 tool & 1 weapon. 1 on hand and 1 in backpack.
1//tool in backpack and weapon on hand
2if findtype "pickaxe" backpack
3
4 //if red nearby
5 hotkey 'Target Random Murderer Player'
6 wait 500
7
8 if insysmsg "No one matching that was found on your screen"
9
10 hotkey "Target Closest Grey Monster"
11 wait 200
12 if insysmsg "no one matching"
13
14 // do nothing
15 stop
16
17 else
18
19 attack lasttarget
20
21 endif
22
23 else
24
25 attack lasttarget
26
27 endif
28
29else
30
31 // tool on hand
32 while not insysmsg "You do not see any harvestable resources nearby"
33 hotkey "Use Item In Hand"
34 endwhile
35
36endif