PK Panic Button by younggoudaboi
Related: Snippet
Description: In progress "panic button" I use on my backstabber when I have no choice but to fight back against a PK. Bind to a hotkey and enable the script when you know you aren't getting away. Current version does a few basic things:
1) Checks first if you are hidden - script will not continue if you are still hidden.
2) Turns on War Mode.
3) Equips a katana by default (ideally poisoned).
4) Auto-targets the closest Red player.
5) Equips a chainmail tunic (for me, replaces platemail to help with Mind Blast dmg).
6) Drinks a Strength potion
7) Eats food.
8) Will drink a cure pot, heal pot, and use a pouch automatically after starting the script.
1#SUPPLIES:
2# Heal, cure, strength pots
3# Food
4# Chainmail chest
5# Poisoned katana
6# Trapped pouches
7
8#CHECK IF HIDDEN - WILL NOT EXECUTE SCRIPT IF HIDDEN
9if hidden
10 overhead "Hidden!"
11 stop
12endif
13
14
15
16#HEAL TIMERS
17clearsysmsg
18
19if not timerexists "healpot"
20 createtimer "healpot"
21 settimer "healpot" 11000
22endif
23if not timerexists "warning"
24 createtimer "warning"
25 settimer "warning" 31000
26endif
27if not timerexists "curepot"
28 createtimer "curepot"
29 settimer "curepot" 11000
30endif
31
32
33
34#BATTLE MODE
35warmode 'on'
36if findtype "katana" backpack as item
37 dclick item
38 wait 150
39endif
40
41target closest red
42
43if findtype "chainmail tunic" backpack as item
44 dclick item
45 wait 150
46endif
47
48if findtype "white potion" backpack as pot
49 dclick pot
50 wait 150
51endif
52
53if findtype "tray" backpack as food
54 dclick food
55 wait 150
56endif
57
58#HEALING SCRIPT
59while not dead
60
61 if insysmsg 'you cannot move' or insysmsg 'You must wait before using this command again'
62
63 say '[pouch'
64
65 endif
66
67 if poisoned and timer 'curepot' > 11000
68
69 potion 'cure'
70
71 wait 200
72
73 settimer 'curepot' 0
74
75 endif
76
77 if not findtype 'Yellow Potion' backpack and timer 'warning' > 30000
78 overhead 'No heal pots!' 34
79 wait 200
80 settimer 'warning' 0
81 endif
82
83 if hp < 100
84 if findtype "Yellow Potion" backpack
85
86 if timer "healpot" > 11000
87 overhead 'Drinking heal!'
88 wait 200
89 potion "heal"
90 wait 200
91 settimer "healpot" 0
92
93 endif
94 endif
95 endif
96endif
97wait 100
98endwhile