Back to "spiritspeak" tags

Keep Me Alive by promess

Related: SpiritSpeak

Description: This is my keep alive script. It essentially runs a constant loop to check for status effects. I cast spells by interrupting the script with another script, and then kicking off the loop again once it's done. The loop has some default targeting in it too.

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