Keep Me Alive v1.2 by ProMess
Related: Snippet
Description: A keep alive script to... well... keep you alive... You have to cast everything, this just keeps you alive as best it can.
1// This script is kind of a branch of of Jaseown's script...
2// Basically it's more interactive? It tells me how many pets I have up, and then keeps me alive.
3// I was set up for Discording targets before, but I've changed off of it for economic reasons
4//
5// In order to cast spells I actually set up scripts to use from hotkeys to cast the spell then
6// start the script running again. If you don't weird things start to happen. Here's an Example:
7//
8//hotkey '> interrupt'
9//cast 'curse'
10//sysmsg 'Curse'
11//wft
12//hotkey 'Play Script: Keep Me Alive'
13
14
15@setvar! minimumWaitForPing 200
16// todo @setvar! cdReactiveArmor 61000
17@setvar! cdMushroom 61000
18
19@setvar! canYouMakeAMushroom 1
20@setvar! cdLightning 20000
21@setvar! cdMagicArrow 20000
22@setvar! cdHarm 20000
23@setvar! cdFireball 60000
24
25@setvar! hpCheckToTriggerGreaterHealSpell 40
26@setvar! hpCheckToTriggerMiniEmergencyHealSpell 65
27@setvar! hpCheckToTriggerHealPotion 50
28@setvar! hpCheckToTriggerCurePotion 45
29
30//statuses
31@setvar! canMushroom 1
32@setvar! canDiscord 0
33@setvar! isDiscorded 0
34
35@setvar! firstPet 0
36@setvar! secondPet 0
37
38
39if not timerexists magicMushroomTimer
40 createtimer magicMushroomTimer
41endif
42
43if not timerexists meditationTimer
44 createtimer meditationTimer
45 settimer meditationTimer 0
46endif
47
48if not timerexists statusM
49 createtimer statusM
50 settimer statusM 21000
51endif
52
53if not timerexists cdMushroom
54 createtimer cdMushroom
55endif
56
57if not timerexists musicTimer
58 createtimer musicTimer
59endif
60
61if not timerexists antispam
62 createtimer antispam
63endif
64
65if not timerexists ssTimer
66 createtimer ssTimer
67endif
68
69if timer statusM > 20000
70 sysmsg 'Keeping you up'
71 if followers = 1
72 sysmsg 'one follower, probably bs'
73 elseif followers = 2
74 sysmsg 'one pet'
75 elseif followers = 3
76 sysmsg 'big + bs'
77 elseif followers = 4
78 sysmsg 'two pets'
79 elseif followers = 5
80 sysmsg 'two pets + bs'
81 else
82 overhead 'no pets'
83 endif
84 settimer statusM 0
85endif
86
87if not listexists petNameList
88 createlist petNameList
89endif
90
91if list petNameList = 0
92 pushlist petNameList "ThiccBoi"
93 pushlist petNameList "Disposable"
94 pushlist petNameList "BadName"
95 #pushlist petNameList "Timmy"
96 #pushlist petNameList "Harry"
97endif
98
99if not listexists nameToChange
100 createlist nameToChange
101endif
102
103if paralyzed
104 say [pouch
105 say 'Get the fuck off me'
106endif
107
108if poisoned
109 if diffhits >= hpCheckToTriggerCurePotion and findtype "Orange Potion" backpack as pot
110 dclick pot
111 wait 200
112 endif
113
114 while not targetexists beneficial
115 if not poisoned
116 hotkey '> Interrupt'
117 say 'Not today!'
118 break
119 else
120 cast 'Cure'
121 wait 50
122 endif
123 endwhile
124 if targetexists beneficial
125 hotkey "Target Self"
126 wait 500
127 endif
128 say 'Not today!'
129endif
130
131if diffhits >= hpCheckToTriggerGreaterHealSpell
132 if targetexists
133 hotkey 'Cancel Current Target'
134 endif
135 while not targetexists 'beneficial'
136 if diffhits >= hpCheckToTriggerMiniEmergencyHealSpell
137 cast 'Heal'
138 else
139 cast 'Greater Heal'
140 endif
141 wait 50
142 endwhile
143 if targetexists 'beneficial'
144 hotkey "Target Self"
145 endif
146 if diffhits >= hpCheckToTriggerHealPotion and findtype "Yellow Potion" backpack as pot
147 getlabel pot desc
148 if "next usable" in desc
149 // do nothing
150 else
151 dclick pot
152 wait 650
153 endif
154 endif
155 replay
156endif
157
158if diffmana > 41
159 if timer magicMushroomTimer >= cdMushroom and findtype "mushroom" backpack as shroom
160 if timer antispam > 10000
161 overhead "Eating shrooms" 66
162 endif
163 dclick shroom
164 wait 200
165 if insysmsg "You consume a magic mushroom and restore some mana."
166 settimer magicMushroomTimer 0
167 elseif insysmsg "before you may consume another magic mushroom" or insysmsg "been in combat with another"
168 settimer magicMushroomTimer 30000
169 endif
170 if followers > 0 and timer antispam > 10000
171 say "all guard me"
172 endif
173 endif
174
175 if not findbuff "actively meditating"
176 if meditationTimer > cdMeditation
177 useskill 'Meditation'
178 settimer meditationTimer 0
179 sysmsg 'meditating'
180 overhead 'Meditating, chill'
181 endif
182 endif
183endif
184
185@setvar! autoTarg lasttarget
186if not warmode
187 if targetexists beneficial
188 if noto autoTarg = 'friend','innocent' #or noto lasttarget = 'innocent'
189 wait 600
190 target lasttarget
191 else
192 wait 600
193 @setvar! myFriend
194 target myFriend
195 endif
196 elseif targetexists harmful
197 if dead myKillTarget
198 wait 600
199 target closest gray,red
200 @setvar myKillTarget lasttarget
201 elseif noto autoTarg = 'hostile' or noto autoTarg = 'criminal' or noto autoTarg = 'enemy' or noto autoTarg = 'murderer'
202 target lasttarget
203 else
204
205 endif
206 endif
207 if insysmsg "Target cannot be seen"
208 overhead "Cannot see target, move closer."
209 endif
210else
211 waitfortarget
212endif
213
214if skill "Discordance" >= 50
215 if canDiscord = 1
216 if not dead myKillTarget
217 getlabel myKillTarget discordDesc
218 if "discord" in discordDesc
219 @setvar isDiscorded 1
220 endif
221 endif
222 if timer musicTimer >= 11000 and isDiscorded = 0
223 if not dead myKillTarget
224 useskill 'Discordance'
225 wft 500
226 endif
227 if insysmsg "What instrument"
228 if findtype "bamboo flute" backpack as inny
229 target inny
230 elseif findtype "tambourine" backpack as inny
231 target inny
232 elseif findtype "drum" backpack as inny
233 target inny
234 elseif findtype "lute" backpack as inny
235 target inny
236 elseif findtype "harp" backpack as inny
237 target inny
238 elseif findtype "lap harp" backpack as inny
239 target inny
240 else
241 overhead "I do not have an inny" 34
242 @setvar! canDiscord 0
243 endif
244 wft 500
245 endif
246 if targetexists and not dead myKillTarget
247 target myKillTarget
248 overhead "Discorded" 88 myKillTarget
249 wait 100
250 else
251 // do nothing intentionally
252 endif
253 settimer musicTimer 5000
254 endif
255 endif
256
257 if not findbuff "song of discordance" and timer musicTimer >= 11000 and canDiscord = 1
258 useskill 'Discordance'
259 wft 500
260 if insysmsg "What instrument"
261 if findtype "bamboo flute" backpack as inny
262 target inny
263 elseif findtype "tambourine" backpack as inny
264 target inny
265 elseif findtype "drum" backpack as inny
266 target inny
267 elseif findtype "lute" backpack as inny
268 target inny
269 elseif findtype "harp" backpack as inny
270 target inny
271 elseif findtype "lap harp" backpack as inny
272 target inny
273 else
274 overhead "I do not have an inny" 34
275 @setvar! canDiscord 0
276 endif
277 wft 500
278 endif
279 target backpack
280 settimer musicTimer 0
281 endif
282endif
283
284if dead
285 overhead "Rip" 34
286 for 10
287 if gumpexists 2957810225
288 gumpresponse 1 2957810225
289 break
290 endif
291 wait 500
292 endfor
293 replay
294endif
295
296if skill "Tracking" > 0
297 if not findbuff "tracking"
298 clearsysmsg
299 while not gumpexists 4267467659
300 useskill 'tracking'
301 wait minimumWaitForPing
302 endwhile
303 if gumpexists 4267467659
304 while not insysmsg "You will now hunt all hostile players."
305 gumpresponse 8 4267467659
306 waitforgump 4267467659 5000
307 endwhile
308 gumpresponse 6 4267467659
309 wait minimumWaitForPing
310 endif
311 gumpclose 4267467659
312 endif
313endif
314
315// 15 - a fire elemental
316// 9 - a demon
317// 14 - a earth elemental
318// 16 - a water elemental
319// 574 - blade spirit
320if findtype 16|9|14|15|574 ground -1 -1 3 as myPet and followers > 0
321 if noto myPet = "friend" and list petNameList > 0
322 wait 200
323 if insysmsg 'getlabel - Skipped getting label because serial'
324 @ignore myPet
325 endif
326 getlabel myPet petLabel
327 sysmsg petLabel
328 overhead "Renaming..."
329 foreach petName in petNameList
330 sysmsg petName
331 rename myPet petName
332 break
333 endfor
334 poplist petNameList "front"
335 wait 500
336 @ignore myPet
337 endif
338endif
339
340if timer antispam > 11000
341 settimer antispam 0
342endif
343
344if timer ssTimer > 20000
345 skill 'spiritspeak'
346 settimer ssTimer 0
347endif
348
349loop