Back to "b" tags

Distillation/Map-bot 3000 by daklue

Description: SCGuy on discord wanted something slightly different that Lurch bot and came up with this. I added T-map decoder into it as well.

1///////////////////////////////////////////////////////////   
2# Distillation/Map-bot 3000
3# UO Outlands
4# By: SCGuy
5# Minor Edits by DaKlue 
6# Most Scripts copied and modified from uorazorscritpts.com
7///////////////////////////////////////////////////////////
8
9# select the drop bag where people will place extracts
10if not varexist chestToLookIn
11    overhead 'Select the bag to watch for all items in.'
12    @setvar! chestToLookIn
13    dclick chestToLookIn
14endif
15
16if not varexist chestToDropIn
17    overhead 'Select the bag to drop all items after bot has finished with it.'
18    @setvar! chestToDropIn
19    dclick chestToDropIn
20endif
21
22@setvar! alchGumpID 949095101
23@setvar! aspectPageID 108
24@setvar! nextPageResponse 11
25
26if not timerexists "botTimer"
27    createtimer "botTimer"
28    settimer "botTimer" 0
29endif
30if timer botTimer >= 60000
31    wait 1000
32    say "Distillation/Map-bot 3000  ONLINE!" 88
33    wait 500
34    settimer "botTimer" 0
35endif
36
37if not findtype "bottle" backpack
38    dclick chestToLookIn
39    wait 200
40    overhead "Restock Extract" 88
41    if findtype "bottle" chestToLookIn as bottle
42        lift bottle
43        drop backpack -1 -1 -1
44        wait 650
45    endif
46endif
47    
48if findtype 'bottle' self as extract
49    overhead "Found a extract. Give us a moment as we turn it into a distilation." 88
50    # pickup bottles on the floor
51    if counttype 'empty bottle%s%' self = 0
52        @setvar bottleID 0
53        if findtype 'empty bottle%s%' ground -1 -1 2 as bottles
54            @setvar bottleID bottles 
55        elseif findtype 'empty bottle%s%'  as bottles
56            @setvar bottleID bottles 
57        endif
58        
59        if bottleID > 0
60            lift bottleID 60000
61            drop backpack -1 -1 -1
62            say 'Thank you for the bottles!'
63            wait 1000
64        endif
65    endif
66
67    # pickup mortal and pestle on the floor
68    if counttype 'mortar and pestle' self = 0 
69        @setvar! toolID 0
70        if findtype 'mortar and pestle' ground -1 -1 2 as tool
71            @setvar! toolID tool
72        elseif findtype 'mortar and pestle' chestToLookIn as tool
73            @setvar! toolID tool
74        endif
75        
76        if toolID > 0
77            lift toolID 60000
78            drop backpack -1 -1 -1
79            say 'Thank you for the tools!'
80            wait 1000
81       endif
82    endif
83
84    # check for an extract in the drop bag
85    @setvar! foundExtract 0
86    @setvar! shouldSpeak 1
87    while findtype 'bottle' chestToLookIn as extract
88        @setvar! foundExtract 1
89        overhead 'Found an extract! Creating a new distill...'
90        getlabel extract extractName
91        
92        if shouldSpeak = 1
93            @setvar! shouldSpeak 0
94            say 'Ah, an extract. Let me distill that for you...'
95            wait 250
96        endif
97
98        # check for empty bottles
99        if not findtype 'empty bottle%s%' self
100            overhead 'Need more empty bottles!' 38
101            say "I am out of empty bottles! Please drop some on the floor for me."
102            wait 3000
103            loop
104        endif
105
106        # open the alch gump, and go to page 2
107        # of the aspect section where distills begin
108        if findtype 'mortar and pestle' self as tool
109            gumpclose alchGumpID
110            dclick tool
111            waitforgump alchGumpID
112            
113            # goto 'Aspect Items'
114            gumpresponse aspectPageID
115            waitforgump alchGumpID
116            wait 650
117            
118            # goto page 3
119            gumpresponse nextPageResponse
120            waitforgump alchGumpID
121            wait 650
122            gumpresponse nextPageResponse
123            waitforgump alchGumpID
124            wait 650
125        else
126            overhead 'Need more mortal and pestles!' 38
127            say "I am out of mortar and pestles! Please drop some on the floor for me."
128            wait 3000
129            loop
130        endif
131
132        # move the extract once we know we can make a distill
133        lift extract 1
134        drop backpack -1 -1 -1
135        wait 650
136
137        # go to the page for this extract,
138        # then create it
139        // page 3
140        if 'Air' in extractName
141            overhead 'Air' 1001
142            gumpresponse 200 alchGumpID
143
144        elseif 'Artisan' in extractName
145            overhead 'Artisan' 544
146            gumpresponse 201 alchGumpID
147
148        elseif 'Blood' in extractName
149            overhead 'Blood' 38        
150            gumpresponse 202 alchGumpID
151            
152        elseif 'Command' in extractName
153            overhead 'Command' 68
154            gumpresponse 203 alchGumpID
155
156        elseif 'Death' in extractName
157            overhead 'Death' 923
158            gumpresponse 204 alchGumpID
159
160        elseif 'Discipline' in extractName
161            overhead 'Discipline' 442
162            gumpresponse 205 alchGumpID
163
164        elseif 'Earth' in extractName
165            overhead 'Earth' 544
166            gumpresponse 206 alchGumpID
167
168        elseif 'Eldritch' in extractName
169            overhead 'Eldritch' 24
170            gumpresponse 207 alchGumpID
171
172        elseif 'Fire' in extractName
173            overhead 'Fire' 38
174            gumpresponse 208 alchGumpID
175
176        elseif 'Fortune' in extractName
177            overhead 'Fortune' 53
178            gumpresponse 209 alchGumpID
179        
180        // page 4
181        elseif 'Gadget' in extractName
182            overhead 'Gadget' 53
183            gumpresponse nextPageResponse alchGumpID
184            waitforgump alchGumpID
185            gumpresponse 200 alchGumpID
186            
187        elseif 'Harvest' in extractName
188            overhead 'Harvest' 53
189            gumpresponse nextPageResponse alchGumpID
190            waitforgump alchGumpID
191            gumpresponse 201 alchGumpID
192
193        elseif 'Holy' in extractName
194            overhead 'Holy' 53
195            gumpresponse nextPageResponse alchGumpID
196            waitforgump alchGumpID
197            gumpresponse 202 alchGumpID
198
199        elseif 'Lyric' in extractName
200            overhead 'Lyric' 38
201            gumpresponse nextPageResponse alchGumpID
202            waitforgump alchGumpID
203            gumpresponse 203 alchGumpID
204
205        elseif 'Poison' in extractName
206            overhead 'Poison' 68
207            gumpresponse nextPageResponse alchGumpID
208            waitforgump alchGumpID
209            gumpresponse 204 alchGumpID
210
211        elseif 'Shadow' in extractName
212            overhead 'Shadow' 923
213            gumpresponse nextPageResponse
214            waitforgump alchGumpID
215            gumpresponse 205 alchGumpID
216
217        elseif 'Void' in extractName
218            overhead 'Void' 14
219            gumpresponse nextPageResponse alchGumpID
220            waitforgump alchGumpID
221            gumpresponse 206 alchGumpID
222
223        elseif 'War' in extractName
224            overhead 'War' 44
225            gumpresponse nextPageResponse alchGumpID
226            waitforgump alchGumpID
227            gumpresponse 207 alchGumpID
228            
229        elseif 'Water' in extractName
230            overhead 'Water' 8
231            gumpresponse nextPageResponse alchGumpID
232            waitforgump alchGumpID
233            gumpresponse 208 alchGumpID
234
235        else 
236            overhead 'Unknown extract type! {{extractName}}' 38
237            say 'DISTILLO-BOT FATAL ERROR! CANNOT COMPUTE! CANNOT COMPUTE!'
238        endif
239
240        waitforgump alchGumpID 1000
241        gumpclose alchGumpID
242        wait 3000
243    endwhile
244else 
245    overhead "Out of Extracts!" 34
246    wait 650
247endif
248
249# move the new distillations back into the drop bag
250while findtype 'flask' self as distillation
251    lift distillation 99
252    drop chestToDropIn -1 -1 -1
253    wait 1500
254endwhile
255
256if foundExtract == 1
257    say 'There you go! Thank you for using Distillo-bot 3000 and have a nice day.'
258endif
259
260
261
262
263@setvar! globalTimeout 650
264
265
266#################################
267##### Item Id
268###########################
269
270if skill "Item Identification" >= 120
271    
272    if not find chestToLookIn ground -1 -1 2
273        unsetvar chestToLookIn
274        replay
275    endif
276    
277    if not timerexists "itemIdTimer"
278        createtimer "itemIdTimer"
279        settimer "itemIdTimer" 20000
280    endif
281    
282    if not timerexists "detectHidingPlayersTimer"
283        createtimer "detectHidingPlayersTimer"
284        settimer "detectHidingPlayersTimer" 11000
285    endif
286    
287    getlabel chestToLookIn descItemId
288    
289    if "0 items, 0 stones" in descItemId
290        // do nothing
291    elseif timer "detectHidingPlayersTimer" >= 11000 and timer "itemIdTimer" >= 20000
292        useskill 'itemidentification'
293        wft 500
294        target chestToLookIn
295        settimer "detectHidingPlayersTimer" 9000
296        settimer "itemIdTimer" 0
297    endif
298endif
299
300
301
302
303if skill "Lockpicking" >= 50
304        
305    if not timerexists "unlockChestTimer"
306        createtimer "unlockChestTimer"
307        settimer "unlockChestTimer" 2000
308    endif
309
310    if not varexist haveParagonToOpen
311        @setvar! haveParagonToOpen 0
312    endif
313
314    if findtype "lockpicks" backpack and findtype "drill" backpack
315        @clearignore
316        if not varexist chestToLookIn
317            overhead "Select a chest to look in" 88
318            @setvar! chestToLookIn
319        endif
320
321        if not find chestToLookIn ground -1 -1 2
322            unsetvar chestToLookIn
323            replay
324        endif
325
326        if haveParagonToOpen = 0
327            while findtype 2473|3644|3645|3646|3647|3710|3701|3702|29832|29833|2472|2475|3648|3649|3708|29078|41449|41450|3705|3712|2474|3709|3650|3651|29077 chestToLookIn as container
328                getlabel container desc
329                if "sealed" in desc
330                    overhead "paragon found"
331                    lift container
332                    drop backpack -1 -1 -1
333                    wait globalTimeout
334                endif
335                
336                if find container backpack
337                    @setvar! haveParagonToOpen container
338                else
339                    @ignore! container
340                endif
341            endwhile
342        elseif timer unlockChestTimer >= 3500
343            if gumpexists 736038070
344                if ingump "Cleared of Traps" 736038070
345                    gumpresponse 4 736038070
346                else
347                    overhead "Remove Trap"
348                    gumpresponse 7 736038070        
349                endif
350                settimer unlockChestTimer 0
351            else
352                getlabel haveParagonToOpen sealedDesc
353                if "sealed" in sealedDesc
354                    dclick haveParagonToOpen
355                else
356                    overhead "we done"
357                    lift haveParagonToOpen
358                    drop chestToLookIn -1 -1 -1
359                    wait globalTimeout
360                    if not find haveParagonToOpen backpack
361                        @setvar! haveParagonToOpen 0
362                    endif
363                endif
364            endif
365        endif
366    else
367        overhead "No more lockpicks or drills bro" 34
368    endif
369
370endif
371
372# All types of map decoder by Jaseowns
373if skill 'cartography' >= 50
374    if not findtype "spyglass" backpack
375        if findtype "spyglass" chestToLookIn as item
376            overhead "Grabbing spyglass" 34
377            lift item
378            drop backpack -1 -1 -1
379            wait 650
380        else
381            overhead "Need spyglass" 34
382            wait 5000        
383        endif
384        replay
385    endif
386
387    if not findtype "map" backpack
388        dclick chestToLookIn
389        wait 200
390        overhead "Restock Map" 88
391        if findtype "map" chestToLookIn as map
392            lift map
393            drop backpack -1 -1 -1
394            wait 650
395        endif
396    endif
397
398    # Close map gump
399    // ore
400    gumpclose 3367641484
401    // skinning
402    gumpclose 3473029237
403    // lumber
404    gumpclose 1332805401
405    // treasure
406    gumpclose 1520869851
407    // fishing
408    gumpclose 2589357942
409
410
411    if findtype "map" backpack as my_map
412        getlabel my_map desc
413        overhead desc   
414        dclicktype "spyglass" backpack
415        wft 1500
416        target my_map
417        
418        @setvar! gumpIdToCheck 0
419        
420        if "ore" in desc
421            @setvar! gumpIdToCheck 3367641484
422        elseif "skinning" in desc
423            @setvar! gumpIdToCheck 3473029237
424        elseif "lumber" in desc
425            @setvar! gumpIdToCheck 1332805401
426        elseif "treasure" in desc
427            @setvar! gumpIdToCheck 1520869851
428        elseif "fishing" in desc
429            @setvar! gumpIdToCheck 2589357942
430        else
431           overhead "Unknown gump!" 34
432        endif
433        
434        waitforgump gumpIdToCheck 1000
435        
436        if "[100.0%" in desc or "(100.0%" in desc
437            dclick chestToDropIn
438            wait 200
439            overhead "Moving map..." 88
440            lift my_map
441            drop chestToDropIn -1 -1 -1
442            wait 650
443        else
444            overhead "Updating..."
445            clearsysmsg 
446            while gumpexists gumpIdToCheck
447                gumpresponse 4 gumpIdToCheck
448                wait 500
449                if insysmsg "maximum accuracy"
450                    gumpclose gumpIdToCheck
451                    lift my_map
452                    drop chestToDropIn -1 -1 -1
453                    wait 650
454                endif
455            endwhile
456        endif    
457        wait 200
458        replay
459    else
460        overhead "Out of maps!" 34
461        wait 5000
462        replay
463    endif
464endif
465if not listexists "friendsofthehouse"
466    createlist "friendsofthehouse"
467endif
468
469if not timerexists "detectHidingPlayersTimer"
470    createtimer "detectHidingPlayersTimer"
471    settimer "detectHidingPlayersTimer" 11000
472endif
473
474if not timerexists "sayBanTimer"
475    createtimer "sayBanTimer"
476    settimer "sayBanTimer" 2000
477endif
478
479if timer "detectHidingPlayersTimer" >= 11000
480    useskill 'detectinghidden'
481    wft 500
482    target 'self'
483    settimer "detectHidingPlayersTimer" 0
484endif
485
486hotkey 'Next non-friendly player target'
487wait 200
488if insysmsg "no one matching"
489    // do nothing
490else 
491    @setvar! removeTarget lasttarget
492    if inlist "friendsofthehouse" removeTarget 
493        // do nothing
494    elseif timer sayBanTimer >= 2000
495        say "I ban thee" 
496        wft 1000
497        target removeTarget 
498        wait 200
499        if insysmsg "You cannot eject a friend of the house!"
500            pushlist "friendsofthehouse" removeTarget 
501        endif  
502        settimer "sayBanTimer" 0
503    endif
504endif
505
506wait 50
507loop