Back to "spiritspeak" tags

Auto Summoner w/auto healing by dennozz

1#Auto-summoner ver.3.11
2
3#********** INFORMATION **********# 
4
5#Made by @dennozz on discord. 
6#Inspired/learned by other scrips in https://outlands.uorazorscripts.com/
7
8#This script will auto summon your desired followers and also auto heal you.
9
10#********** SET YOUR SETTINGS **********# 
11
12@setvar! earthElementals 1
13@setvar! waterElementals 1
14@setvar! airElementals 0
15@setvar! fireElementals 0
16@setvar! summonDaemons 0
17@setvar! summonCreature 1
18
19#--- Set Necromancy Spells ---#
20
21@setvar! NecroVengefulSpirit 0
22@setvar! NecroBloodOath 0
23@setvar! NecroWither 0
24
25#--- Set mushrooms ---#
26
27@setvar! mushroomCount 4
28@setvar! mushroomTimerCD 60000
29settimer mushroomTimer mushroomTimerCD
30
31#--- Set meditation ---#
32
33@setvar! useMeditation 1
34@setvar! meditateManaReach 50
35@setvar! meditateUntilManaReach 55
36
37#--- Set Mage auto heals ---#
38
39@setvar! miniHeal 1
40@setvar! greaterHeal 1
41@setvar! cureSpell 1
42
43#--- Set Mage Buffs ---#
44
45@setvar! magicReflect 1
46@setvar! bless 1
47@setvar! armorReflect 1
48@setvar! protectionSpell 1
49@setvar! miniumManaToBuff 50
50
51#--- Set potions ---#
52
53@setvar! drinkStr 1
54@setvar! drinkAgility 0
55@setvar! drinkMagicResist 0
56@setvar! drinkHeal 1
57@setvar! drinkCure 1
58@setvar! drinkRefresh 1
59
60@setvar! strengthLowerThan 100
61@setvar! staminaLowerThan 10
62
63#--- Auto healing hp diffs ---#
64
65@setvar! lowDiff 12 
66@setvar! medDiff 25
67@setvar! highDiff 40
68@setvar! extremeDiff 60
69@setvar! criticalDiff 75
70
71#--- Optional : Have a cooldown named `Heal Pot` ---#
72
73@setvar! healingPotCD 11000
74
75@setvar! maxwaittimeinms 650
76
77#********** DO NOT EDIT FROM HERE BELOW **********# 
78
79if not varexist castingEarth 
80    @setvar! castingEarth 0
81endif
82if not varexist castingWater 
83    @setvar! castingWater 0
84endif
85if not varexist castingFire 
86    @setvar! castingFire 0
87endif
88if not varexist castingAir 
89    @setvar! castingAir 0
90endif
91if not varexist castingDaemon 
92    @setvar! castingDaemon 0
93endif
94if not varexist castingCreature 
95    @setvar! castingCreature 0
96endif
97
98@setvar! necroGump 622436516
99@setvar! unholyPoints 0
100
101#-- elementals variables --#
102
103@setvar! maxFollowers 0
104@setvar! currentFollowers 0
105
106removelist maxFollowersList
107createlist maxFollowersList
108    
109if earthElementals  = 1
110    pushlist maxFollowersList x 
111    pushlist maxFollowersList x 
112elseif earthElementals = 2
113    pushlist maxFollowersList x 
114    pushlist maxFollowersList x 
115    pushlist maxFollowersList x 
116    pushlist maxFollowersList x
117endif
118
119if waterElementals = 1
120    pushlist maxFollowersList x 
121    pushlist maxFollowersList x 
122elseif waterElementals = 2
123    pushlist maxFollowersList x 
124    pushlist maxFollowersList x 
125    pushlist maxFollowersList x 
126    pushlist maxFollowersList x
127endif
128
129if airElementals  = 1
130    pushlist maxFollowersList x 
131    pushlist maxFollowersList x 
132elseif airElementals  = 2
133    pushlist maxFollowersList x 
134    pushlist maxFollowersList x 
135    pushlist maxFollowersList x 
136    pushlist maxFollowersList x
137endif
138
139if fireElementals  = 1
140    pushlist maxFollowersList x 
141    pushlist maxFollowersList x 
142elseif fireElementals  = 2
143    pushlist maxFollowersList x 
144    pushlist maxFollowersList x 
145    pushlist maxFollowersList x 
146    pushlist maxFollowersList x
147endif
148
149if summonDaemons  = 1
150    pushlist maxFollowersList x 
151    pushlist maxFollowersList x 
152elseif summonDaemons  = 2
153    pushlist maxFollowersList x 
154    pushlist maxFollowersList x 
155    pushlist maxFollowersList x 
156    pushlist maxFollowersList x
157endif
158
159if summonCreature = 1
160    pushlist maxFollowersList x 
161elseif summonCreature = 2
162    pushlist maxFollowersList x 
163    pushlist maxFollowersList x 
164elseif summonCreature = 3
165    pushlist maxFollowersList x 
166    pushlist maxFollowersList x 
167    pushlist maxFollowersList x 
168elseif summonCreature = 4
169    pushlist maxFollowersList x 
170    pushlist maxFollowersList x 
171    pushlist maxFollowersList x 
172    pushlist maxFollowersList x 
173elseif summonCreature = 5
174    pushlist maxFollowersList x 
175    pushlist maxFollowersList x 
176    pushlist maxFollowersList x 
177    pushlist maxFollowersList x 
178    pushlist maxFollowersList x 
179endif
180
181if list maxFollowersList = 0 
182    @setvar! maxFollowers 0
183    
184elseif list maxFollowersList = 1
185    @setvar! maxFollowers 1
186    
187elseif list maxFollowersList = 2
188    @setvar! maxFollowers 2
189    
190elseif list maxFollowersList = 3
191    @setvar! maxFollowers 3
192    
193elseif list maxFollowersList = 4
194    @setvar! maxFollowers 4
195else 
196    @setvar! maxFollowers 5
197endif
198
199if not varexist earthFirsty or followers = 0
200    @setvar! earthFirsty 0
201endif
202
203if not varexist earthSecondly or followers = 0
204    @setvar! earthSecondly 0
205endif
206
207if not varexist waterFirsty or followers = 0
208    @setvar! waterFirsty 0
209endif
210
211if not varexist waterSecondly or followers = 0
212    @setvar! waterSecondly 0
213endif
214
215if not varexist airFirsty or followers = 0
216    @setvar! airFirsty 0
217endif
218
219if not varexist airSecondly or followers = 0
220    @setvar! airSecondly 0
221endif
222
223if not varexist fireFirsty or followers = 0
224    @setvar! fireFirsty 0
225endif
226
227if not varexist fireSecondly or followers = 0
228    @setvar! fireSecondly 0
229endif
230
231if not varexist daemonFirsty or followers = 0
232    @setvar! daemonFirsty 0
233endif
234
235if not varexist daemonSecondly or followers = 0
236    @setvar! daemonSecondly 0
237endif
238
239if not varexist creatureFirsty or followers = 0
240    @setvar! creatureFirsty 0
241endif
242
243if not varexist creatureSecondly or followers = 0
244    @setvar! creatureSecondly 0
245endif
246
247if not varexist creatureThirdy or followers = 0
248    @setvar! creatureThirdy 0
249endif
250
251if not varexist creatureFourthy or followers = 0
252    @setvar! creatureFourthy 0
253endif
254
255if not varexist creatureFithy or followers = 0
256    @setvar! creatureFithy 0
257endif
258
259#-- list creation --#
260
261if not listexists earthListy or followers = 0
262    removelist earthListy
263    createlist earthListy
264endif
265
266if not listexists waterListy or followers = 0
267    removelist waterListy
268    createlist waterListy
269endif
270
271if not listexists airListy or followers = 0
272    removelist airListy
273    createlist airListy
274endif
275
276if not listexists fireListy or followers = 0
277    removelist fireListy
278    createlist fireListy
279endif
280
281if not listexists daemonListy or followers = 0
282    removelist daemonListy
283    createlist daemonListy
284endif
285
286if not listexists creatureListy or followers = 0
287    removelist creatureListy
288    createlist creatureListy
289endif
290
291@setvar! globalMessageCD 5000
292settimer globalMessageTimer globalMessageCD
293
294@setvar! summonMsgCD 1500
295settimer summonMsgTimer summonMsgCD
296
297@setvar! manaMsgCD 2500
298settimer manaMsgTimer manaMsgCD
299
300@setvar! guardMessageCD 5000
301settimer guardMessageTimer guardMessageCD
302
303#--- Script msgs timers ---#
304
305@setvar! noRegsMessageCD 3000
306settimer noRegsMessageTimer noRegsMessageCD
307
308#--- Resources timers ---#
309
310@setvar! pouchMessageCD 5000
311settimer pouchMessageTimer pouchMessageCD
312
313@setvar! aidsMessageCD 4000
314settimer aidsMessageTimer aidsMessageCD
315
316@setvar! whiteMessageCD 3000
317settimer whiteMessageTimer whiteMessageCD
318
319@setvar! blueMessageCD 3000
320settimer blueMessageTimer blueMessageCD
321
322@setvar! blackMessageCD 2500
323settimer blackMessageTimer blackMessageCD
324
325@setvar! orangeMessageCD 2000
326settimer orangeMessageTimer orangeMessageCD
327
328@setvar! yellowMessageCD 1500
329settimer yellowMessageTimer yellowMessageCD
330
331@setvar! redMessageCD 1000
332settimer redMessageTimer redMessageCD
333
334#--- Magery buffs timers ---#
335
336@setvar! magicReflectCD 15000
337settimer magicReflectTimer 15000
338
339@setvar! armorReflectCD 15000
340settimer armorReflectTimer 15000
341
342@setvar! protectionCD 15000
343settimer protectionTimer 15000
344
345#sysmsg "MAX: {{maxFollowers}}" 34
346
347while not dead
348
349    if timer globalMessageTimer > globalMessageCD
350        overhead "* Auto summoning *" 11
351        settimer globalMessageTimer 0
352    endif
353
354#********* EAT TRAY FOOD *********
355    
356    if not findbuff "food" and findtype "tray" backpack as fody    
357        dclick fody
358        wait 200
359    endif
360        
361#********** AUTO HEALING START  **********#         
362
363    while diffhits >= lowDiff or paralyzed or poisoned
364    
365        #sysmsg "auto-healing activated" 11   
366        
367        #--- Trapped ---#
368        
369        if paralyzed 
370            if findtype "pouch" backpack 38 
371                yell "[pouch"            
372                wait 200
373            else
374                if timer pouchMessageTimer > pouchMessageCD
375                    overhead "Out of Pouches!" 34
376                    settimer pouchMessageTimer 0
377                endif
378            endif
379        endif
380            
381        #--- Self bandage ---#
382        
383        if diffhits >= 1 and not bandaging
384            if skill 'healing' >= 50 or skill "veterinary" >= 50
385                if findtype 'clean bandage%s%' backpack
386                
387                    if targetexists
388                        hotkey 'cancel current target'  
389                    endif
390                    dclicktype 'clean bandage%s%'
391                    waitfortarget maxwaittimeinms
392                    target 'self'
393                    wait 200            
394                else
395                    if timer aidsMessageTimer > aidsMessageCD
396                        overhead "Out of bandages" 34
397                        settimer aidsMessageTimer 0
398                    endif
399                endif
400            endif
401        endif
402        
403        #--- Drink str pot ---#
404        
405        if drinkStr = 1 and str < strengthLowerThan
406            if not findbuff "Strength" 
407                if findtype "White Potion" self
408                    dclicktype "White Potion"
409                    wait 200
410                else
411                    if timer whiteMessageTimer > whiteMessageCD
412                        overhead "Out of str pots" 34
413                        settimer whiteMessageTimer 0 
414                    endif
415                endif
416            endif
417        endif
418        
419        #--- Drink agility pot ---#
420        
421        if drinkAgility = 1
422            if not findbuff "Agility" 
423                if findtype "Blue Potion" self
424                    dclicktype "Blue Potion"
425                    wait 200
426                else
427                    if timer blueMessageTimer > blueMessageCD
428                        overhead "Out of agility pots" 34
429                        settimer blueMessageTimer 0 
430                    endif
431                endif
432            endif
433        endif
434            
435        #--- Drink magic resist pot ---#
436    
437        if drinkMagicResist = 1
438            if not findbuff "Magic Resist" 
439                if findtype "Black Potion" self
440                    dclicktype "Black Potion"
441                    wait 200
442                else
443                    if timer blackMessageTimer > blackMessageCD
444                        overhead "Out of resist pots" 34
445                        settimer blackMessageTimer 0
446                    endif
447                endif
448            endif
449        endif
450            
451        #--- Poisoned ---#
452        
453        if 1 = drinkCure or 1 = cureSpell
454            while poisoned
455                if findtype "Orange Potion" self
456                    dclicktype "Orange Potion"
457                    wait 200
458                else
459                    if timer orangeMessageTimer > orangeMessageCD
460                        overhead "Out of cure pots" 34
461                        settimer orangeMessageTimer 0
462                    endif
463                    
464                    if diffhits > highDiff or not findtype 3972 self or not findtype 3973 self
465                        break
466                    endif
467                    
468                    if skill 'magery' >= 40 and mana >= 6 and 1 = cureSpell and not casting
469                        cast 'cure'
470                        wait 50
471                        while not casting                   
472                            if targetexists
473                                hotkey 'cancel current target'
474                            endif
475                            cast 'cure'  
476                            wait 50
477                        endwhile  
478                        while not targetexists and casting
479                        endwhile
480                        waitfortarget maxwaittimeinms
481                        target 'self' 
482                        wait 200
483                    else 
484                        break
485                    endif
486                endif
487                
488            endwhile
489        endif
490            
491        #--- Drink Heal Pot ---#
492        
493        if diffhits >= highDiff and 1 = drinkHeal
494            if findtype "Yellow Potion" self as hPot
495                getlabel hPot potLabel
496                if "next" in potLabel
497                    #do nothing
498                else
499                    @setvar! ch 0
500                    
501                    if counttype 3852 self as c
502                        @setvar! ch c
503                    endif
504                    clearsysmsg  
505                    
506                    dclicktype 3852
507                    getlabel backpack xxx
508                    wait 200
509                                
510                    if ch != counttype 3852 self or insysmsg "potion satchel used"
511                        cooldown "Heal Pot" healingPotCD
512                    endif
513                endif
514            else
515                if timer yellowMessageTimer > yellowMessageCD
516                    overhead "Out of heals pots" 34
517                    settimer yellowMessageTimer 0
518                endif
519            endif
520        endif
521                
522        #--- Drink red pot ---#
523        
524        if stam < staminaLowerThan and 1 = drinkRefresh
525            if findtype "Red Potion" self
526                dclicktype "Red Potion"
527                wait 200
528            else
529                if timer redMessageTimer > redMessageCD
530                    overhead "Out of refresh pots" 34
531                    settimer redMessageTimer 0 
532                endif
533            endif
534        endif
535            
536        #--- Cast heals ---#
537        
538        if skill 'magery' >= 40 and diffhits >= lowDiff and diffhits < medDiff and mana >= 4 and miniHeal = 1 and not casting
539            cast 'heal'
540            while not casting                   
541                if targetexists
542                    hotkey 'cancel current target'
543                endif
544                cast 'heal'
545            endwhile  
546            
547            while not targetexists and casting
548            endwhile
549            
550            waitfortarget maxwaittimeinms
551            target 'self' 
552            wait 200  
553            
554        elseif skill 'magery' >= 60 and diffhits >= medDiff and diffhits <= highDiff mana >= 11 and greaterHeal = 1 and not casting
555            cast 'greater heal'         
556            while not casting                   
557                if targetexists
558                    hotkey 'cancel current target'
559                endif
560                cast 'greater heal'
561            endwhile  
562            
563            while not targetexists and casting
564                
565                #--- Poisoned ---#
566                
567                if 1 = drinkCure
568                    while poisoned
569                        if findtype "Orange Potion" self
570                            dclicktype "Orange Potion"
571                            wait 200
572                        else
573                            if timer orangeMessageTimer > orangeMessageCD
574                                overhead "Out of cure pots" 34
575                                settimer orangeMessageTimer 0
576                                break
577                            endif
578            
579                        endif
580                    endwhile
581                endif            
582            
583                #--- Drink Heal Pot ---#
584                
585                if diffhits >= highDiff and 1 = drinkHeal
586                    if findtype "Yellow Potion" self as hPot
587                        getlabel hPot potLabel
588                        if "next" in potLabel
589                            #do nothing
590                        else
591                            @setvar! ch 0
592                            
593                            if counttype 3852 self as c
594                                @setvar! ch c
595                            endif
596                            clearsysmsg  
597                            
598                            dclicktype 3852
599                            getlabel backpack xxx
600                            wait 200
601                                        
602                            if ch != counttype 3852 self or insysmsg "potion satchel used"
603                                cooldown "Heal Pot" healingPotCD
604                            endif
605                        endif
606                    else
607                        if timer yellowMessageTimer > yellowMessageCD
608                            overhead "Out of heals pots" 34
609                            settimer yellowMessageTimer 0
610                        endif
611                    endif
612                endif
613        
614            endwhile
615            
616            waitfortarget maxwaittimeinms
617            target 'self' 
618            wait 200 
619            
620        elseif skill 'magery' >= 40 and diffhits > highDiff and mana >= 4 and miniHeal = 1 and not casting
621            cast 'heal'     
622            while not casting                   
623                if targetexists
624                    hotkey 'cancel current target'
625                endif
626                cast 'heal' 
627            endwhile  
628            
629            while not targetexists and casting
630            endwhile
631            
632            waitfortarget maxwaittimeinms
633            target 'self' 
634            wait 200  
635        
636        endif 
637    
638    endwhile
639    
640#********** CHECK FOR ANY DEAD ELEMENTAL **********# 
641
642    while followers < maxFollowers and diffhits < medDiff
643
644        if counttype 29012 backpack = 0
645            while counttype 29012 backpack < mushroomCount
646                cast 'create food'
647                wait 100
648            endwhile
649        endif
650        
651        if 1 = castingEarth 
652            sysmsg "fixing earth" 44
653            while findtype 158|14 ground -1 -1 12 as ele 
654                menu ele 1
655                waitfortarget maxwaittimeinms
656                if targetexists 
657                    if ele != earthFirsty and ele != earthSecondly
658                        hotkey 'cancel current target'
659                        
660                        if earthFirsty = 0 
661                            @setvar! earthFirsty ele
662                            sysmsg "add earth 1" 11
663                            overhead "Earth 1" 634 ele
664                        else 
665                            @setvar! earthSecondly ele
666                            sysmsg "add earth 2" 11
667                            overhead "Earth 2" 634 ele
668                        endif
669                        
670                        break
671                    endif
672                endif
673                @ignore ele
674            endwhile    
675            @clearignore
676            @setvar! castingEarth 0
677            
678        elseif 1 = castingWater
679            sysmsg "fixing water" 44
680            while findtype 740|16 ground -1 -1 12 as ele 
681                menu ele 1
682                waitfortarget maxwaittimeinms
683                if targetexists 
684                    if ele != waterFirsty and ele != waterSecondly
685                        hotkey 'cancel current target'
686                        
687                        if waterFirsty = 0 
688                            @setvar! waterFirsty ele
689                            sysmsg "add water 1" 11
690                            overhead "Water 1" 399 ele
691                        else 
692                            @setvar! waterSecondly ele
693                            sysmsg "add water 2" 11
694                            overhead "Water 2" 399 ele
695                        endif
696                        
697                        break
698                    endif
699                endif
700                @ignore ele
701            endwhile
702            @clearignore
703            @setvar! castingWater 0
704            
705        elseif 1 = castingAir   
706            while findtype 306|13 ground -1 -1 12 as ele 
707                menu ele 1
708                waitfortarget maxwaittimeinms
709                if targetexists 
710                    if ele != airFirsty and ele != airSecondly
711                        hotkey 'cancel current target'
712                        
713                        if airFirsty = 0 
714                            @setvar! airFirsty ele
715                            sysmsg "add air 1" 11
716                            overhead "Air 1" 933 ele
717                        else 
718                            @setvar! airSecondly ele
719                            sysmsg "add air 2" 11
720                            overhead "Air 2" 933 ele
721                        endif
722                        
723                        break
724                    endif
725                endif
726                @ignore ele
727            endwhile    
728            @clearignore
729            @setvar! castingAir 0
730            
731        elseif 1 = castingFire
732            while findtype 24|15 ground -1 -1 12 as ele 
733                menu ele 1
734                waitfortarget maxwaittimeinms
735                if targetexists 
736                    if ele != fireFirsty and ele != fireSecondly
737                        hotkey 'cancel current target'
738                        
739                        if fireFirsty = 0 
740                            @setvar! fireFirsty ele
741                            sysmsg "add fire 1" 11
742                            overhead "Fire 1" 353 ele
743                        else 
744                            @setvar! fireSecondly ele
745                            sysmsg "add fire 2" 11
746                            overhead "Fire 2" 353 ele
747                        endif
748                        
749                        break
750                    endif
751                endif
752                @ignore ele
753            endwhile
754            @clearignore
755            @setvar! castingFire 0
756            
757        elseif 1 = castingDaemon
758            while findtype 9|722 ground -1 -1 12 as ele 
759                menu ele 1
760                waitfortarget maxwaittimeinms
761                if targetexists 
762                    if ele != daemonFirsty and ele != daemonSecondly
763                        hotkey 'cancel current target'
764                        
765                        if daemonFirsty = 0 
766                            @setvar! daemonFirsty ele
767                            sysmsg "add daemon 1" 11
768                            overhead "Daemon 1" 11 ele
769                        else 
770                            @setvar! daemonSecondly ele
771                            sysmsg "add daemon 2" 235
772                            overhead "Daemon 2" 235 ele
773                        endif
774                        
775                        break
776                    endif
777                endif
778                @ignore ele
779            endwhile     
780            @clearignore
781            @setvar! castingDaemon 0
782            
783        elseif 1 = castingCreature
784            while findtype 215|211|302|317|225|212|202|213|716|729|51|74|214|206|776|737|718|739|718|29|776|317|302|39|56|26|3|57|50|382 ground -1 -1 12 as ele 
785                menu ele 1
786                waitfortarget maxwaittimeinms
787                if targetexists 
788                    if ele != creatureFirsty and ele != creatureSecondly and ele != creatureThirdy and ele != creatureFourthy and ele != creatureFithy
789                        hotkey 'cancel current target'
790                        
791                        if creatureFirsty = 0 
792                            @setvar! creatureFirsty ele
793                            sysmsg "Creature 1" 11
794                            overhead "Creature 1" 11 ele
795                        elseif creatureSecondly = 0 
796                            @setvar! creatureSecondly ele
797                            sysmsg "add creature 2" 11
798                            overhead "Creature 2" 11 ele
799                        elseif creatureThirdy = 0 
800                            @setvar! creatureThirdy ele
801                            sysmsg "add creature 3" 11
802                            overhead "Creature 3" 11 ele
803                        elseif creatureFourthy = 0 
804                            @setvar! creatureFourthy ele
805                            sysmsg "add creature 4" 11
806                            overhead "Creature 4" 11 ele
807                        elseif creatureFithy = 0 
808                            @setvar! creatureFithy ele
809                            sysmsg "add creature 5" 11
810                            overhead "Creature 5" 11 ele
811                        endif
812                        
813                        break
814                    endif
815                endif
816                @ignore ele
817            endwhile 
818            @clearignore
819            @setvar! castingCreature 0
820        endif
821        
822        if earthFirsty != 0 and dead earthFirsty
823            if list earthListy != 0
824                poplist earthListy 'front' 
825                sysmsg "pop earth 1"
826            endif 
827            @setvar! earthFirsty 0
828        endif
829            
830        if earthSecondly != 0 and dead earthSecondly
831            if list earthListy != 0
832                poplist earthListy 'front'  
833                sysmsg "pop earth 2"
834            endif  
835            @setvar! earthSecondly 0
836        endif
837            
838        if waterFirsty != 0 and dead waterFirsty
839            if list waterListy != 0
840                poplist waterListy 'front'  
841                sysmsg "pop water 1"
842            endif
843            @setvar! waterFirsty 0
844        endif
845            
846        if waterSecondly != 0 and dead waterSecondly
847            if list waterListy != 0
848                poplist waterListy 'front' 
849                sysmsg "pop water 2"
850            endif
851            @setvar! waterSecondly 0
852        endif
853            
854        if airFirsty != 0 and dead airFirsty
855            if list airListy != 0
856                poplist airListy 'front'
857            endif
858            @setvar! airFirsty 0
859        endif
860            
861        if airSecondly != 0 and dead airSecondly 
862            if list airListy != 0
863                poplist airListy 'front'
864            endif 
865            @setvar! airSecondly 0
866        endif
867            
868        if fireFirsty != 0 and dead fireFirsty 
869            if list fireListy != 0
870                poplist fireListy 'front'   
871            endif
872            @setvar! fireFirsty 0
873        endif
874            
875        if fireSecondly != 0 and dead fireSecondly 
876            if list fireListy != 0
877                poplist fireListy 'front'   
878            endif 
879            @setvar! fireSecondly 0
880        endif
881            
882        if daemonFirsty != 0 and dead daemonFirsty
883            if list daemonListy != 0
884                poplist daemonListy 'front'
885            endif
886            @setvar! daemonFirsty 0
887        endif
888            
889        if daemonSecondly != 0 and dead daemonSecondly 
890            if list daemonListy != 0
891                poplist daemonListy 'front'
892            endif 
893            @setvar! daemonSecondly 0
894        endif
895            
896        if creatureFirsty != 0 and dead creatureFirsty 
897            if list creatureListy != 0
898                poplist creatureListy 'front'
899                sysmsg "pop creature 1"
900            endif 
901            @setvar! creatureFirsty 0
902        endif
903            
904        if creatureSecondly != 0 and dead creatureSecondly 
905            if list creatureListy != 0
906                poplist creatureListy 'front'
907                sysmsg "pop creature 2"
908            endif 
909            @setvar! creatureSecondly 0
910        endif
911            
912        if creatureThirdy != 0 and dead creatureThirdy 
913            if list creatureListy != 0
914                poplist creatureListy 'front'
915                sysmsg "pop creature 3"
916            endif 
917            @setvar! creatureThirdy 0
918        endif
919            
920        if creatureFourthy != 0 and dead creatureFourthy 
921            if list creatureListy != 0
922                poplist creatureListy 'front'
923                sysmsg "pop creature 4"
924            endif 
925            @setvar! creatureFourthy 0
926        endif
927            
928        if creatureFithy != 0 and dead creatureFithy 
929            if list creatureListy != 0
930                poplist creatureListy 'front'
931                sysmsg "pop creature 5"
932            endif 
933            @setvar! creatureFithy 0
934        endif
935
936#********* CREATE MUSHROOMS *********
937
938        if mana <= 50
939            if timer mushroomTimer > mushroomTimerCD
940                if counttype 29012 backpack as c
941                    @setvar! cm c
942                
943                    dclicktype 29012 backpack
944                    wait 200
945                    
946                    if cm != counttype 29012 backpack
947                        settimer mushroomTimer 0
948                    endif
949                else 
950                    overhead "No mushrooms found!" 34
951                endif
952            endif            
953        endif
954        
955        if mana < meditateManaReach and 1 = useMeditation
956            skill 'meditation'
957            getlabel backpack xxx
958            wait 200
959            if findbuff 'meditating'
960                while mana < meditateUntilManaReach and diffhits < medDiff
961                    #interrupt here if hp is low
962                    if not findbuff 'meditating'
963                        break
964                    endif
965                endwhile
966            endif
967        endif    
968    
969        if mana < 50
970            if timer manaMsgTimer > manaMsgCD
971                overhead "No mana to summon" 34
972                settimer manaMsgTimer 0
973            endif
974            break
975        endif
976        
977        @clearsysmsg
978        @setvar! wasInterrupted 0
979        
980#********** ACTIVATE NECROMANCER BAR IF USING ANY NECRO SPELLS **********# 
981        
982        if NecroVengefulSpirit = 1 or NecroBloodOath = 1
983            if findtype 'necromancer book' backpack
984                yell '[necromancyhotbar'
985                while not gumpexists 622436516
986                    yell '[necromancyhotbar'
987                    waitforgump 622436516 maxwaittimeinms
988                endwhile
989            endif
990        endif
991        
992#********** ACTIVATE NECROMANCER VENGEFUL SPIRIT SPELL **********# 
993        
994        if ingump "20/" 622436516
995            @setvar! unholyPoints 20
996        elseif ingump "19/" 622436516
997            @setvar! unholyPoints 19
998        elseif ingump "18/" 622436516
999            @setvar! unholyPoints 18
1000        elseif ingump "17/" 622436516
1001            @setvar! unholyPoints 17
1002        elseif ingump "16/" 622436516
1003            @setvar! unholyPoints 16
1004        elseif ingump "15/" 622436516
1005            @setvar! unholyPoints 15
1006        elseif ingump "14/" 622436516
1007            @setvar! unholyPoints 14
1008        elseif ingump "13/" 622436516
1009            @setvar! unholyPoints 13
1010        elseif ingump "12/" 622436516
1011            @setvar! unholyPoints 12
1012        elseif ingump "11/" 622436516
1013            @setvar! unholyPoints 11
1014        elseif ingump "10/" 622436516
1015            @setvar! unholyPoints 10
1016        elseif ingump "9/" 622436516
1017            @setvar! unholyPoints 9
1018        elseif ingump "8/" 622436516
1019            @setvar! unholyPoints 8
1020        elseif ingump "7/" 622436516
1021            @setvar! unholyPoints 7
1022        elseif ingump "6/" 622436516
1023            @setvar! unholyPoints 6
1024        elseif ingump "5/" 622436516
1025            @setvar! unholyPoints 5
1026        elseif ingump "4/" 622436516
1027            @setvar! unholyPoints 4
1028        elseif ingump "3/" 622436516
1029            @setvar! unholyPoints 3
1030        elseif ingump "2/" 622436516
1031            @setvar! unholyPoints 2
1032        elseif ingump "1/" 622436516
1033            @setvar! unholyPoints 1
1034        else 
1035            @setvar unholyPoints 0
1036        endif
1037        
1038        if 1 = NecroVengefulSpirit and 0 < unholyPoints
1039            clearsysmsg
1040            yell '[vengefulspirit'
1041            wait 200 
1042            
1043            while not insysmsg! "unholy symbols remaining" and not insysmsg! "you must wait another"
1044                yell '[vengefulspirit'
1045                wait 200
1046            endwhile
1047            
1048            if insysmsg "unholy symbols"
1049                say '[>Vengeful Spirits<]' 44
1050            endif
1051  
1052        endif 
1053        
1054#********** ACTIVATE NECROMANCER BLOOD OATH SPELL **********# 
1055        
1056        if ingump "20/" 622436516
1057            @setvar! unholyPoints 20
1058        elseif ingump "19/" 622436516
1059            @setvar! unholyPoints 19
1060        elseif ingump "18/" 622436516
1061            @setvar! unholyPoints 18
1062        elseif ingump "17/" 622436516
1063            @setvar! unholyPoints 17
1064        elseif ingump "16/" 622436516
1065            @setvar! unholyPoints 16
1066        elseif ingump "15/" 622436516
1067            @setvar! unholyPoints 15
1068        elseif ingump "14/" 622436516
1069            @setvar! unholyPoints 14
1070        elseif ingump "13/" 622436516
1071            @setvar! unholyPoints 13
1072        elseif ingump "12/" 622436516
1073            @setvar! unholyPoints 12
1074        elseif ingump "11/" 622436516
1075            @setvar! unholyPoints 11
1076        elseif ingump "10/" 622436516
1077            @setvar! unholyPoints 10
1078        elseif ingump "9/" 622436516
1079            @setvar! unholyPoints 9
1080        elseif ingump "8/" 622436516
1081            @setvar! unholyPoints 8
1082        elseif ingump "7/" 622436516
1083            @setvar! unholyPoints 7
1084        elseif ingump "6/" 622436516
1085            @setvar! unholyPoints 6
1086        elseif ingump "5/" 622436516
1087            @setvar! unholyPoints 5
1088        elseif ingump "4/" 622436516
1089            @setvar! unholyPoints 4
1090        elseif ingump "3/" 622436516
1091            @setvar! unholyPoints 3
1092        elseif ingump "2/" 622436516
1093            @setvar! unholyPoints 2
1094        elseif ingump "1/" 622436516
1095            @setvar! unholyPoints 1
1096        else 
1097            @setvar unholyPoints 0
1098        endif
1099                
1100        if 1 = NecroBloodOath and 3 < unholyPoints
1101            clearsysmsg
1102            yell '[bloodoath'
1103            wait 200 
1104            
1105            while not insysmsg! "unholy symbols remaining" and not insysmsg! "you must wait another"
1106                yell '[bloodoath'
1107                wait 200
1108            endwhile
1109            
1110            if insysmsg "unholy symbols"
1111                say '[>Blood Oath<]' 55
1112            endif
1113        endif
1114        
1115#********** ACTIVATE NECROMANCER WITHER SPELL **********# 
1116        
1117        if ingump "20/" 622436516
1118            @setvar! unholyPoints 20
1119        elseif ingump "19/" 622436516
1120            @setvar! unholyPoints 19
1121        elseif ingump "18/" 622436516
1122            @setvar! unholyPoints 18
1123        elseif ingump "17/" 622436516
1124            @setvar! unholyPoints 17
1125        elseif ingump "16/" 622436516
1126            @setvar! unholyPoints 16
1127        elseif ingump "15/" 622436516
1128            @setvar! unholyPoints 15
1129        elseif ingump "14/" 622436516
1130            @setvar! unholyPoints 14
1131        elseif ingump "13/" 622436516
1132            @setvar! unholyPoints 13
1133        elseif ingump "12/" 622436516
1134            @setvar! unholyPoints 12
1135        elseif ingump "11/" 622436516
1136            @setvar! unholyPoints 11
1137        elseif ingump "10/" 622436516
1138            @setvar! unholyPoints 10
1139        elseif ingump "9/" 622436516
1140            @setvar! unholyPoints 9
1141        elseif ingump "8/" 622436516
1142            @setvar! unholyPoints 8
1143        elseif ingump "7/" 622436516
1144            @setvar! unholyPoints 7
1145        elseif ingump "6/" 622436516
1146            @setvar! unholyPoints 6
1147        elseif ingump "5/" 622436516
1148            @setvar! unholyPoints 5
1149        elseif ingump "4/" 622436516
1150            @setvar! unholyPoints 4
1151        elseif ingump "3/" 622436516
1152            @setvar! unholyPoints 3
1153        elseif ingump "2/" 622436516
1154            @setvar! unholyPoints 2
1155        elseif ingump "1/" 622436516
1156            @setvar! unholyPoints 1
1157        else 
1158            @setvar unholyPoints 0
1159        endif
1160                
1161        if 1 = NecroWither and 4 < unholyPoints and skill 'necromancy' >= 90
1162            clearsysmsg
1163            yell '[wither'
1164            wait 200 
1165            
1166            while not insysmsg! "unholy symbols remaining" and not insysmsg! "you must wait another"
1167                yell '[wither'
1168                wait 200
1169            endwhile
1170            
1171            if insysmsg "unholy symbols"
1172                say '[>Wither<]' 66
1173            endif
1174            
1175        endif
1176        
1177        if list earthListy = 0 
1178            #sysmsg "Earth List = 0"
1179        elseif list earthListy = 1
1180            #sysmsg "Earth List = 1"
1181        elseif list earthListy = 2
1182            #sysmsg "Earth List = 2"
1183        endif
1184        
1185        if list waterListy = 0 
1186            #sysmsg "Water List = 0"
1187        elseif list waterListy = 1
1188            #sysmsg "Water List = 1"
1189        elseif list waterListy = 2
1190            #sysmsg "Water List = 2"
1191        endif
1192        
1193        if list creatureListy = 0 
1194            #sysmsg "Creature List = 0"
1195        elseif list creatureListy = 1
1196            #sysmsg "Creature List = 1"
1197        elseif list creatureListy = 2
1198            #sysmsg "Creature List = 2"
1199        elseif list creatureListy = 2
1200            #sysmsg "Creature List = 2"
1201        elseif list creatureListy = 2
1202            #sysmsg "Creature List = 2"
1203        endif
1204        
1205        sysmsg 'begin casting elementals...' 11
1206        
1207        if not findtype 3963 backpack or not findtype 3974 backpack or not findtype 3981 backpack
1208            if timer noRegsMessageTimer > noRegsMessageCD
1209                overhead 'Out of regs!' 34
1210                settimer noRegsMessageTimer 0
1211            endif
1212        elseif fireElementals = 1 and not findtype 3980 backpack 
1213            if timer noRegsMessageTimer > noRegsMessageCD
1214                overhead 'Out of regs!' 34
1215                settimer noRegsMessageTimer 0
1216            endif
1217        elseif summonDaemons = 1 and not findtype 3980 backpack 
1218            if timer noRegsMessageTimer > noRegsMessageCD
1219                overhead 'Out of regs!' 34
1220                settimer noRegsMessageTimer 0
1221            endif
1222            
1223#********** CAST EARTH ELEMENTAL **********# 
1224    
1225        elseif earthElementals != 0 and list earthListy < earthElementals and followers < 4 and diffhits < medDiff and not casting      
1226        
1227            cast 'Earth Elemental'
1228            @setvar! castingEarth 1
1229            while not casting                   
1230                cast 'Earth Elemental'  
1231                if targetexists
1232                    hotkey 'cancel current target'
1233                endif
1234            endwhile  
1235            
1236            while not dead
1237                
1238                if diffhits >= medDiff
1239                    @setvar! wasInterrupted 1 
1240                    sysmsg "interrupted low health" 33
1241                    interrupt
1242                    break
1243                endif
1244                
1245                if not casting
1246                    getlabel backpack xxx
1247                    wait 200
1248                    
1249                    if insysmsg "Your concentration"
1250                        @setvar! wasInterrupted 1 
1251                        sysmsg "interrupted concentration" 33   
1252                    else 
1253                        sysmsg "casting finished" 11
1254                    endif
1255                    
1256                    break
1257                endif
1258                
1259                if timer summonMsgTimer > summonMsgCD
1260                    overhead "* summoning earth... *" 634
1261                    sysmsg "* summoning earth... *" 634
1262                    settimer summonMsgTimer 0
1263                    settimer globalMessageTimer 0
1264                endif
1265                
1266            endwhile
1267
1268            if 0 = wasInterrupted
1269                sysmsg "Summon Earth Successful" 
1270                pushlist earthListy 'x' 'front'
1271                
1272                while not dead
1273                    if findtype 158|14 ground -1 -1 12 as ele 
1274                        menu ele 1
1275                        waitfortarget maxwaittimeinms
1276                        if targetexists 
1277                            if ele != earthFirsty and ele != earthSecondly
1278                                hotkey 'cancel current target'
1279                                
1280                                if earthFirsty = 0 
1281                                    @setvar! earthFirsty ele
1282                                    sysmsg "add earth 1" 11
1283                                    overhead "Earth 1" 634 ele
1284                                else 
1285                                    @setvar! earthSecondly ele
1286                                    sysmsg "add earth 2" 11
1287                                    overhead "Earth 2" 634 ele
1288                                endif
1289                                
1290                                break
1291                            endif
1292                        endif
1293                        @ignore ele
1294                    endif
1295                endwhile
1296                
1297                @clearignore
1298                @setvar! castingEarth 0
1299            endif
1300            
1301#********** CAST WATER ELEMENTAL **********# 
1302        
1303        elseif waterElementals != 0 and list waterListy < waterElementals and followers < 4 and diffhits < medDiff and not casting
1304            cast 'Water Elemental'
1305            @setvar! castingWater 1
1306            while not casting                   
1307                cast 'Water Elemental'  
1308                if targetexists
1309                    hotkey 'cancel current target'
1310                endif
1311            endwhile 
1312            
1313            while not dead
1314                
1315                if diffhits >= medDiff
1316                    @setvar! wasInterrupted 1 
1317                    sysmsg "interrupted low health" 33
1318                    interrupt
1319                    break
1320                endif
1321                
1322                if not casting
1323                    getlabel backpack xxx
1324                    wait 200
1325                    
1326                    if insysmsg "Your concentration"
1327                        @setvar! wasInterrupted 1 
1328                        sysmsg "interrupted concentration" 33   
1329                    else 
1330                        sysmsg "casting finished" 11
1331                    endif
1332                    
1333                    break
1334                endif
1335                
1336                if timer summonMsgTimer > summonMsgCD
1337                    overhead "* summoning water... *" 399
1338                    sysmsg "* summoning water... *" 399
1339                    settimer summonMsgTimer 0
1340                    settimer globalMessageTimer 0
1341                endif
1342                
1343            endwhile
1344
1345            if 0 = wasInterrupted
1346                sysmsg "Summon Water Successful" 
1347                pushlist waterListy 'x' 'front'
1348                
1349                while not dead
1350                    if findtype 740|16 ground -1 -1 12 as ele 
1351                        menu ele 1
1352                        waitfortarget maxwaittimeinms
1353                        if targetexists 
1354                            if ele != waterFirsty and ele != waterSecondly
1355                                hotkey 'cancel current target'
1356                                
1357                                if waterFirsty = 0 
1358                                    @setvar! waterFirsty ele
1359                                    sysmsg "add water 1" 11
1360                                    overhead "Water 1" 399 ele
1361                                else 
1362                                    @setvar! waterSecondly ele
1363                                    sysmsg "add water 2" 11
1364                                    overhead "Water 2" 399 ele
1365                                endif
1366                                
1367                                break
1368                            endif
1369                        endif
1370                        @ignore ele
1371                    endif
1372                endwhile
1373                
1374                @clearignore
1375                @setvar! castingWater 0
1376            endif
1377        
1378#********** CAST AIR ELEMENTAL **********# 
1379        
1380        elseif airElementals != 0 and list airListy < airElementals and followers < 4 and diffhits < medDiff and not casting                       
1381            cast 'Air Elemental'
1382            @setvar! castingAir 1
1383            while not casting                   
1384                cast 'Air Elemental'  
1385                if targetexists
1386                    hotkey 'cancel current target'
1387                endif
1388            endwhile  
1389            
1390            while not dead
1391                
1392                if diffhits >= medDiff
1393                    @setvar! wasInterrupted 1 
1394                    sysmsg "interrupted low health" 33
1395                    interrupt
1396                    break
1397                endif
1398                
1399                if not casting
1400                    getlabel backpack xxx
1401                    wait 200
1402                    
1403                    if insysmsg "Your concentration"
1404                        @setvar! wasInterrupted 1 
1405                        sysmsg "interrupted concentration" 33   
1406                    else 
1407                        sysmsg "casting finished" 11
1408                    endif
1409                    
1410                    break
1411                endif
1412                
1413                if timer summonMsgTimer > summonMsgCD
1414                    overhead "* summoning air... *" 933
1415                    sysmsg "* summoning air... *" 933
1416                    settimer summonMsgTimer 0
1417                    settimer globalMessageTimer 0
1418                endif
1419                
1420            endwhile
1421            
1422            if 0 = wasInterrupted
1423                sysmsg "Summon Air Successful" 
1424                pushlist airListy 'x' 'front'
1425                
1426                while not dead
1427                    if findtype 306|13 ground -1 -1 12 as ele 
1428                        menu ele 1
1429                        waitfortarget maxwaittimeinms
1430                        if targetexists 
1431                            if ele != airFirsty and ele != airSecondly
1432                                hotkey 'cancel current target'
1433                                
1434                                if airFirsty = 0 
1435                                    @setvar! airFirsty ele
1436                                    sysmsg "add air 1" 11
1437                                    overhead "Air 1" 933 ele
1438                                else 
1439                                    @setvar! airSecondly ele
1440                                    sysmsg "add air 2" 11
1441                                    overhead "Air 2" 933 ele
1442                                endif
1443                                
1444                                break
1445                            endif
1446                        endif
1447                        @ignore ele
1448                    endif
1449                endwhile
1450                @clearignore
1451                @setvar! castingAir 0
1452            endif
1453        
1454#********** CAST FIRE ELEMENTAL **********# 
1455        
1456        elseif fireElementals != 0 and list fireListy < fireElementals and followers < 4 and diffhits < medDiff and not casting                       
1457            cast 'Fire Elemental'
1458            @setvar! castingFire 1
1459            while not casting                   
1460                cast 'Fire Elemental'  
1461                if targetexists
1462                    hotkey 'cancel current target'
1463                endif
1464            endwhile  
1465            
1466            while not dead
1467                
1468                if diffhits >= medDiff
1469                    @setvar! wasInterrupted 1 
1470                    sysmsg "interrupted low health" 33
1471                    interrupt
1472                    break
1473                endif
1474                
1475                if not casting
1476                    getlabel backpack xxx
1477                    wait 200
1478                    
1479                    if insysmsg "Your concentration"
1480                        @setvar! wasInterrupted 1 
1481                        sysmsg "interrupted concentration" 33   
1482                    else 
1483                        sysmsg "casting finished" 11
1484                    endif
1485                    
1486                    break
1487                endif
1488                
1489                if timer summonMsgTimer > summonMsgCD
1490                    overhead "* summoning fire... *" 353
1491                    sysmsg "* summoning fire... *" 353
1492                    settimer summonMsgTimer 0
1493                    settimer globalMessageTimer 0
1494                endif
1495                
1496            endwhile
1497            
1498            if 0 = wasInterrupted
1499                sysmsg "Summon Fire Successful" 
1500                pushlist fireListy 'x' 'front'
1501                
1502                while not dead
1503                    if findtype 24|15 ground -1 -1 12 as ele 
1504                        menu ele 1
1505                        waitfortarget maxwaittimeinms
1506                        if targetexists 
1507                            if ele != fireFirsty and ele != fireSecondly
1508                                hotkey 'cancel current target'
1509                                
1510                                if fireFirsty = 0 
1511                                    @setvar! fireFirsty ele
1512                                    sysmsg "add fire 1" 11
1513                                    overhead "Fire 1" 353 ele
1514                                else 
1515                                    @setvar! fireSecondly ele
1516                                    sysmsg "add fire 2" 11
1517                                    overhead "Fire 2" 353 ele
1518                                endif
1519                                
1520                                break
1521                            endif
1522                        endif
1523                        @ignore ele
1524                    endif
1525                endwhile
1526                @clearignore
1527                @setvar! castingFire 0
1528            endif
1529            
1530#********** CAST DAEMON **********# 
1531        
1532        elseif summonDaemons != 0 and list daemonListy < summonDaemons and followers < 4 and diffhits < medDiff and not casting                       
1533            cast 'Summon Daemon'
1534            @setvar! castingDaemon 1
1535            while not casting                   
1536                cast 'Summon Daemon'  
1537                if targetexists
1538                    hotkey 'cancel current target'
1539                endif
1540            endwhile  
1541            
1542            while not dead
1543                
1544                if diffhits >= medDiff
1545                    @setvar! wasInterrupted 1 
1546                    sysmsg "interrupted low health" 33
1547                    interrupt
1548                    break
1549                endif
1550                
1551                if not casting
1552                    getlabel backpack xxx
1553                    wait 200
1554                    
1555                    if insysmsg "Your concentration"
1556                        @setvar! wasInterrupted 1 
1557                        sysmsg "interrupted concentration" 33   
1558                    else 
1559                        sysmsg "casting finished" 11
1560                    endif
1561                    
1562                    break
1563                endif
1564                
1565                if timer summonMsgTimer > summonMsgCD
1566                    overhead "* summoning daemon... *" 235
1567                    sysmsg "* summoning daemon... *" 235
1568                    settimer summonMsgTimer 0
1569                    settimer globalMessageTimer 0
1570                endif
1571                
1572            endwhile
1573            
1574            if 0 = wasInterrupted
1575                sysmsg "Summon Daemon Successful" 
1576                pushlist daemonListy 'x' 'front'
1577                
1578                while not dead
1579                    if findtype 9|722 ground -1 -1 12 as ele 
1580                        menu ele 1
1581                        waitfortarget maxwaittimeinms
1582                        if targetexists 
1583                            if ele != daemonFirsty and ele != daemonSecondly
1584                                hotkey 'cancel current target'
1585                                
1586                                if daemonFirsty = 0 
1587                                    @setvar! daemonFirsty ele
1588                                    sysmsg "add daemon 1" 11
1589                                    overhead "Daemon 1" 11 ele
1590                                else 
1591                                    @setvar! daemonSecondly ele
1592                                    sysmsg "add daemon 2" 235
1593                                    overhead "Daemon 2" 235 ele
1594                                endif
1595                                
1596                                break
1597                            endif
1598                        endif
1599                        @ignore ele
1600                    endif
1601                endwhile
1602                @clearignore
1603                @setvar! castingDaemon 0
1604            endif
1605            
1606#********** CAST SUMMON CREATURE **********# 
1607        
1608        elseif summonCreature != 0 and list creatureListy < summonCreature and followers < 5 and diffhits < medDiff and not casting                   
1609            cast 'Summ. Creature'
1610            @setvar! castingCreature 1
1611            while not casting                   
1612                cast 'Summ. Creature'  
1613                if targetexists
1614                    hotkey 'cancel current target'
1615                endif
1616            endwhile  
1617            
1618            while not dead
1619                
1620                if diffhits >= medDiff
1621                    @setvar! wasInterrupted 1 
1622                    sysmsg "interrupted low health" 33
1623                    interrupt
1624                    break
1625                endif
1626                
1627                if not casting
1628                    getlabel backpack xxx
1629                    wait 200
1630                    
1631                    if insysmsg "Your concentration"
1632                        @setvar! wasInterrupted 1 
1633                        sysmsg "interrupted concentration" 33   
1634                    else 
1635                        sysmsg "casting finished" 11
1636                    endif
1637                    
1638                    break
1639                endif
1640                
1641                if timer summonMsgTimer > summonMsgCD
1642                    overhead "* summon creature... *" 881
1643                    sysmsg "* summon creature... *" 881
1644                    settimer summonMsgTimer 0
1645                    settimer globalMessageTimer 0
1646                endif
1647                
1648            endwhile
1649
1650            if 0 = wasInterrupted
1651                sysmsg "Summon Creature Successful" 
1652                pushlist creatureListy 'x' 'front'
1653                while not dead
1654                    if findtype 215|211|302|317|225|212|202|213|716|729|51|74|214|206|776|737|718|739|718|29|776|317|302|39|56|26|3|57|50|382 ground -1 -1 12 as ele 
1655                        menu ele 1
1656                        waitfortarget maxwaittimeinms
1657                        if targetexists 
1658                            if ele != creatureFirsty and ele != creatureSecondly and ele != creatureThirdy and ele != creatureFourthy and ele != creatureFithy
1659                                hotkey 'cancel current target'
1660                                
1661                                if creatureFirsty = 0 
1662                                    @setvar! creatureFirsty ele
1663                                    sysmsg "add creature 1" 11 
1664                                    overhead "Creature 1" 11 ele
1665                                elseif creatureSecondly = 0 
1666                                    @setvar! creatureSecondly ele
1667                                    sysmsg "add creature 2" 11
1668                                    overhead "Creature 2" 11 ele
1669                                elseif creatureThirdy = 0 
1670                                    @setvar! creatureThirdy ele
1671                                    sysmsg "add creature 3" 11
1672                                    overhead "Creature 3" 11 ele
1673                                elseif creatureFourthy = 0 
1674                                    @setvar! creatureFourthy ele
1675                                    sysmsg "add creature 4" 11
1676                                    overhead "Creature 4" 11 ele
1677                                elseif creatureFithy = 0 
1678                                    @setvar! creatureFithy ele
1679                                    sysmsg "add creature 5" 11
1680                                    overhead "Creature 5" 11 ele
1681                                endif
1682                                
1683                                break
1684                            endif
1685                        endif
1686                        @ignore ele
1687                    endif
1688                endwhile
1689                
1690                @clearignore
1691                @setvar! castingCreature 0
1692            endif
1693            
1694        endif
1695        
1696        if followers > 0
1697            say 'ALL Guard ME' 11
1698        endif
1699    
1700    endwhile
1701    
1702#********** AUTO-MAGERY BUFFS IF NEEDED **********          
1703
1704    if magicReflect = 1 and skill 'magery' >= 70 and not findbuff "Magic Reflection" and mana >= miniumManaToBuff and diffhits < lowDiff
1705        if timer magicReflectTimer > magicReflectCD
1706            cast 'Magic Reflection'
1707            while not casting and diffhits < lowDiff    
1708                getlabel backpack xxx
1709                wait 200
1710                if insysmsg "that spell will not" or insysmsg "that spell is already"
1711                    settimer magicReflectTimer 0
1712                    break  
1713                endif
1714                if targetexists
1715                    hotkey 'cancel current target'
1716                endif
1717                cast 'Magic Reflection'
1718            endwhile 
1719            
1720            while casting and diffhits < highDiff   
1721            
1722                #--- Poisoned ---#
1723                
1724                if 1 = drinkCure
1725                    while poisoned
1726                        if findtype "Orange Potion" self
1727                            dclicktype "Orange Potion"
1728                            wait 200
1729                        else
1730                            if timer orangeMessageTimer > orangeMessageCD
1731                                overhead "Out of cure pots" 34
1732                                settimer orangeMessageTimer 0
1733                                break
1734                            endif
1735            
1736                        endif
1737                    endwhile
1738                endif            
1739            
1740                #--- Drink Heal Pot ---#
1741                
1742                if diffhits >= highDiff and 1 = drinkHeal
1743                    if findtype "Yellow Potion" self as hPot
1744                        getlabel hPot potLabel
1745                        if "next" in potLabel
1746                            #do nothing
1747                        else
1748                            @setvar! ch 0
1749                            
1750                            if counttype 3852 self as c
1751                                @setvar! ch c
1752                            endif
1753                            clearsysmsg  
1754                            
1755                            dclicktype 3852
1756                            getlabel backpack xxx
1757                            wait 200
1758                                        
1759                            if ch != counttype 3852 self or insysmsg "potion satchel used"
1760                                cooldown "Heal Pot" healingPotCD
1761                            endif
1762                        endif
1763                    else
1764                        if timer yellowMessageTimer > yellowMessageCD
1765                            overhead "Out of heals pots" 34
1766                            settimer yellowMessageTimer 0
1767                        endif
1768                    endif
1769                endif
1770                
1771            endwhile
1772            wait 200  
1773        endif    
1774    endif
1775    
1776    if armorReflect = 1 and skill 'magery' >= 30 and not findbuff "Reactive Armor" and mana >= miniumManaToBuff and diffhits < lowDiff
1777        if timer magicReflectTimer > magicReflectCD
1778            cast 'Reactive Armor'
1779            while not casting and diffhits < highDiff       
1780                getlabel backpack xxx
1781                wait 200
1782                if insysmsg "that spell will not" or insysmsg "that spell is already"
1783                    settimer armorReflectTimer 0
1784                    break  
1785                endif
1786                if targetexists
1787                    hotkey 'cancel current target'
1788                endif
1789                cast 'Reactive Armor'
1790            endwhile  
1791            
1792            while casting and diffhits < lowDiff   
1793            endwhile
1794            wait 200  
1795        endif    
1796    endif     
1797    
1798    if protectionSpell = 1 and skill 'magery' >= 40 and not findbuff "Protection" and mana >= miniumManaToBuff and diffhits < lowDiff
1799        cast 'Protection'
1800        while not casting and diffhits < highDiff 
1801            if targetexists
1802                hotkey 'cancel current target'
1803            endif
1804            cast 'Protection'
1805        endwhile  
1806        while casting and diffhits < lowDiff   
1807        endwhile
1808        wait 200  
1809    endif 
1810    
1811    if bless = 1 and skill 'magery' >= 50 and not findbuff "Cunning" and mana >= miniumManaToBuff and diffhits < lowDiff
1812        sysmsg 'blessing..'
1813        cast 'Bless'         
1814        while not casting and diffhits < highDiff                   
1815            if targetexists
1816                hotkey 'cancel current target'
1817            endif
1818            cast 'Bless'
1819            wait 50
1820        endwhile  
1821        
1822        while not targetexists and casting
1823        endwhile
1824        
1825        waitfortarget maxwaittimeinms
1826        target 'self' 
1827        wait 200  
1828    endif  
1829    
1830endwhile