Back to "disco" tags

Auto-DISCO by dennozz

1#Auto-DISCO 1.22
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 discordance the closest gray creature, if the creature is already discorded it will start looking for other nearby creatures.
9
10#Optional: Set overhead messages on Razor > Display/Counters > Overhead messages
11           #Add overhead messages when success discordance, fail discordance or skill needs to wait for use.
12
13#********** SET YOUR SETTINGS **********#            
14
15@setvar! attackClosestMonster 1
16
17#********** DO NOT EDIT FROM HERE UNLESS YOU KNOW HOW TO SCRIPT **********# 
18
19@setvar! currentTarget 0
20@setvar! foundTarget 0
21
22removelist discordedCreatures
23createlist discordedCreatures
24
25#********** SET INSTRUMENT **********# 
26
27if not varexist myInstruz
28    @setvar! myInstruz 0
29endif
30
31while findtype 3740|3742|3762|3763|10245|20006|20008|20010|20012|20014|20016 backpack as inst 
32    getlabel inst myLabel
33    
34    if "supremely" in myLabel or "exceedingly" in myLabel
35        @setvar! myInstruz inst
36        break
37    endif
38    
39    @ignore inst
40endwhile
41
42@clearignore
43
44if not find myInstruz backpack
45    clearsysmsg
46    overhead "Select instrument:" 55
47    @setvar! myInstruz
48    wait 100
49    while not targetexists and not insysmsg "Select"
50        @setvar! myInstruz    
51    endwhile
52    wait 200
53    getlabel backpack xxx
54    if find myInstruz backpack as inst
55        getlabel inst iLabel
56        
57        if "flute" in iLabel or "drums" in iLabel or "harp" in iLabel or "lute" in iLabel or "tambourine" in iLabel or "gemshorn" in iLabel or "hurdy" in iLabel or "psaltery" in iLabel or "sackbut" in iLabel or "shawm" in iLabel or "Vielle" in iLabel
58            dclick inst
59            wait 200
60        else 
61            @setvar! myInstruz 0
62            overhead "Not an instrument!" 33
63            stop
64        endif
65    else
66        @setvar! myInstruz 0
67        overhead "Not in backpack" 33
68        stop    
69    endif
70endif
71
72if not timerexists discoTimer
73    settimer discoTimer 0
74endif
75
76clearsysmsg
77
78if targetexists
79    hotkey 'cancel current target'
80endif
81
82#********* AUTO-SELECT NEW TARGET *********
83
84sysmsg "Discord Start.." 65
85settimer testTimer 0
86hotkey 'target closest grey monster'
87wait 25
88
89if not find lasttarget ground -1 -1 12
90    overhead 'No target found' 33
91else
92    if 1 = attackClosestMonster
93        attack lasttarget
94    endif
95    
96    while index != 20
97        @setvar! tempTarget lasttarget 
98        if index != 0 
99            hotkey "next non-friendly monster target"
100            @setvar! tempTarget lasttarget 
101            #overhead "*{{index}}*" 34 tempTarget
102            
103            if index = 1
104                @setvar! firstTarget lasttarget
105            elseif firstTarget = tempTarget
106                @setvar! foundTarget 2
107                break
108            endif
109        endif
110        
111        if find tempTarget ground -1 -1 12
112            getlabel tempTarget targetLabel
113                        
114            if "discord" in targetLabel
115                #next
116                pushlist discordedCreatures tempTarget
117            elseif "-" in targetLabel
118                sysmsg "Label error, replaying search.." 34
119                replay
120            else 
121                clearsysmsg
122                
123                skill 'begging'
124                waitfortarget 325
125                target tempTarget
126                wait 100
127                getlabel backpack xxx
128                if insysmsg "Target cannot be seen"
129                    sysmsg "*Not visible* [{{index}}]" 44
130                    overhead  "*Not visible* [{{index}}]" 44 tempTarget
131                elseif insysmsg "That is too far away"
132                    overhead "*Too far* [{{index}}]" 44 tempTarget
133                elseif insysmsg "You must wait"
134                    overhead "*Skill cooldown*" 11
135                    sysmsg "*Skill cooldown*" 11
136                    break
137                else 
138                    @setvar! foundTarget 1 
139                    @setvar! currentTarget tempTarget
140                    getlabel currentTarget myLabel
141                    sysmsg "Target: {{myLabel}}" 55
142                    break
143                endif
144                
145            endif
146        endif
147        wait 50
148    endwhile
149endif
150
151#********* DISCO IF TARGET FOUND *********
152
153if 1 = foundTarget
154    skill 'discordance'
155    waitfortarget 650 
156    getlabel backpack xxx
157    
158    if insysmsg "What instrument"    
159        target myInstruz
160        replay
161    else 
162        target currentTarget
163    endif
164    
165    wait 100
166    getlabel backpack xxx
167    
168    if insysmsg 'You fail to discord'
169        overhead "Discord FAILED" 44 currentTarget
170    elseif insysmsg "You play successfully, disrupting" 
171        getlabel currentTarget myLabel
172        overhead "{{myLabel}}" 88 currentTarget
173    endif
174    
175    getlabel myInstruz instLabel
176    
177    if "(10/" in instLabel
178        overhead "Instrument : 10 uses left" 33
179        sysmsg "Instrument : 10 uses left" 33
180    elseif "(8/" in instLabel
181        overhead "Instrument : 8 uses left" 33
182        sysmsg "Instrument : 8 uses left" 33
183    elseif "(6/" in instLabel
184        overhead "Instrument : 6 uses left" 33
185        sysmsg "Instrument : 6 uses left" 33
186    elseif "(4/" in instLabel
187        overhead "Instrument : 4 uses left" 33
188        sysmsg "Instrument : 4 uses left" 33
189    elseif "(2/" in instLabel
190        overhead "Instrument : 2 uses left" 33
191        sysmsg "Instrument : 2 uses left" 33
192    elseif "(1/" in instLabel
193        overhead "Instrument : 1 use left" 33
194        sysmsg "Instrument : 1 use left" 33
195    endif
196    
197    if 1 = attackClosestMonster
198        attack currentTarget
199    endif
200    
201    if followers > 0
202        say 'all guard me' 32
203    endif
204    
205elseif 2 = foundTarget
206    if followers > 0
207        say 'all guard me' 32
208    endif
209    
210    #look here for closest discordedCreatures target on a list
211    #foreach creature in discordedCreatures
212        
213    #endfor
214    ###
215endif
216
217#********* SONG BUFF *********
218
219if not findbuff "Song Of Discordance"
220    wait 650
221    skill 'discordance'
222    wait 100
223    getlabel backpack xxx
224    
225    if insysmsg "You must wait"
226        overhead "Disco Buff Cooldown" 11
227    else
228        waitfortarget 650
229        target backpack
230    endif
231endif
232
233sysmsg "Disco Finish! Time passed: {{testTimer}}" 44