Back to "snippet" tags

MonsterShuffle-Bro by nev0r

1//////////////////////////////
2//
3// Monster Shuffle Bot for UO Outlands, Version 1
4// by Alpha && Nevor
5// - Automatically plays the casino game monster shuffle (you have to be in a range of 2 tiles towards the game keg to play)
6// - This script will work without any change. There is an optional setup section below where you can find and adjust some parameters according to your own preferences
7// - By default it is set to autopilot and max runspeed
8// - WARNING: server system messages are needed to determine necessary actions, make sure they are not filtered for scripts: 
9//      Razor -> Filters -> Text&Messages ->
10//      - Uncheck "Filter repeating system messages"
11//      - "Enable text filter" and "Filter system messages" (list entry sub-menu) can be checked, however "Ignore filtered messages in overhead and scripts" (list entry sub-menu) has to be unchecked
12//
13//////////////////////////////
14
15######## MANUAL SETUP ########
16
17//Let the script or the user decide how to handle results:
18    //0 ... You have to manually click which creatures to keep and which ones to reroll
19    //1 ... The script decides how to handle results the best way possible
20    setvar! msAutoResolve 1
21
22//Wait time between rolls (to see the results), duration in milliseconds (0 - indefinite)
23    setvar! msShowResultDuration 0
24
25//What are we going to do if we need more gold to continue playing:
26    //0 ... Do not add more gold automatically (rational choice)
27    //1 ... MORE GOLD NOW!
28    setvar! msAutoAddFunds 0
29
30//Show additional status information for easier debugging
31    //0 ... Off
32    //1 ... On
33    setvar! msDebugMode 0
34    
35###### END MANUAL SETUP ######
36
37//////////////////////////////
38// 
39// Changelog
40//
41//////////////////////////////
42
43setvar! globalWaitForServerResponse 500
44setvar! globalWaitForObjectDelay 600
45if not timerexists globalObjectDelayTimer
46    settimer globalObjectDelayTimer globalWaitForObjectDelay
47endif
48
49@clearignore
50setvar! msGumpID 1312641219
51if insysmsg "You are out of funds."
52endif
53
54while findtype 3711 ground -1 -1 2 as localKeg and not insysmsg! "You are out of funds."
55
56    if msDebugMode > 0
57        sysmsg "---- NEW GAME ----" 52    
58        settimer msDebugTimer 0
59    endif
60
61    while find localKeg ground -1 -1 2 and not gumpexists msGumpID
62        while timer globalObjectDelayTimer < globalWaitForObjectDelay
63        endwhile
64        dclick localKeg
65        settimer globalObjectDelayTimer 0
66        waitforgump msGumpID globalWaitForServerResponse
67    endwhile
68
69    if not ingump "Roll!" 1312641219
70        //Try to reopen gump once to exclude auto-refresh error due to high runspeed
71        while timer globalObjectDelayTimer < globalWaitForObjectDelay
72        endwhile
73        dclick localKeg
74        settimer globalObjectDelayTimer 0
75        waitforgump msGumpID globalWaitForServerResponse
76        if not ingump "Roll!" 1312641219            
77            overhead "▶▶ FINISH GAME ◀◀" 1680
78            sysmsg "▶▶ FINISH GAME ◀◀" 1680
79            stop
80        endif
81    endif
82
83    //Set Jackpot
84    removelist msJackpotList
85    createlist msJackpotList
86    
87    if ingump "3x Otyugh" 1312641219
88        pushlist msJackpotList "Otyugh"
89    elseif ingump "3x Colossal Poison Dart Frog" 1312641219
90        pushlist msJackpotList "Colossal Poison Dart Frog"
91    elseif ingump "3x Colossal Black Widow" 1312641219
92        pushlist msJackpotList "Colossal Black Widow"
93    elseif ingump "3x Wildwood Reaper" 1312641219
94        pushlist msJackpotList "Wildwood Reaper"
95    elseif ingump "3x Hellhound" 1312641219
96        pushlist msJackpotList "Hellhound"
97    elseif ingump "3x Carrion Beetle" 1312641219
98        pushlist msJackpotList "Carrion Beetle"
99    elseif ingump "3x Daemon" 1312641219
100        pushlist msJackpotList "Daemon"
101    elseif ingump "3x Ratman" 1312641219
102        pushlist msJackpotList "Ratman"
103    elseif ingump "3x Dragon" 1312641219
104        pushlist msJackpotList "Dragon"
105    elseif ingump "3x Living Earth" 1312641219
106        pushlist msJackpotList "Living Earth"
107    elseif ingump "3x Horse" 1312641219
108        pushlist msJackpotList "Horse"
109    elseif ingump "3x Fey Spirit Matron" 1312641219
110        pushlist msJackpotList "Fey Spirit Matron"
111    elseif ingump "3x Deathstalk" 1312641219
112        pushlist msJackpotList "Deathstalk"
113    elseif ingump "3x Shadowguard" 1312641219
114        pushlist msJackpotList "Shadowguard"
115    elseif ingump "3x Sand Crawler" 1312641219
116        pushlist msJackpotList "Sand Crawler"
117    elseif ingump "3x Minotaur Runesmith" 1312641219
118        pushlist msJackpotList "Minotaur Runesmith"
119    elseif ingump "3x Ettin" 1312641219
120        pushlist msJackpotList "Ettin"
121    elseif ingump "3x Ophidian Matron" 1312641219
122        pushlist msJackpotList "Ophidian Matron"
123    elseif ingump "3x Opilion Conservator" 1312641219
124        pushlist msJackpotList "Opilion Conservator"
125    elseif ingump "3x Frenzied Ostard" 1312641219
126        pushlist msJackpotList "Frenzied Ostard"
127    elseif ingump "3x Abomination" 1312641219
128        pushlist msJackpotList "Abomination"
129    elseif ingump "3x Wyvern" 1312641219
130        pushlist msJackpotList "Wyvern"
131    elseif ingump "3x Molten Idol" 1312641219
132        pushlist msJackpotList "Molten Idol"
133    elseif ingump "3x Malform" 1312641219
134        pushlist msJackpotList "Malform"
135    elseif ingump "3x Skeletal Fiend" 1312641219
136        pushlist msJackpotList "Skeletal Fiend"
137    elseif ingump "3x Corpse Purger" 1312641219
138        pushlist msJackpotList "Corpse Purger"
139    elseif ingump "3x Temple Guardian" 1312641219
140        pushlist msJackpotList "Temple Guardian"
141    elseif ingump "3x Terathan Matron" 1312641219
142        pushlist msJackpotList "Terathan Matron"
143    elseif ingump "3x Lich Magus" 1312641219
144        pushlist msJackpotList "Lich Magus"
145    elseif ingump "3x Vampire" 1312641219
146        pushlist msJackpotList "Vampire"
147    endif
148
149    //Creatures
150    removelist msCreatureList
151    createlist msCreatureList
152
153    //  1 "Aberration"
154        pushlist msCreatureList "Calamity"
155        pushlist msCreatureList "Coagulator"
156        pushlist msCreatureList "Otyugh"
157    //  2 "Amphibian"
158        pushlist msCreatureList "Giant Frog"
159        pushlist msCreatureList "Chameleon"
160        pushlist msCreatureList "Colossal Poison Dart Frog"
161    //  3 "Arachnid"
162        pushlist msCreatureList "Swamp Spider"
163        pushlist msCreatureList "Giant Spider"
164        pushlist msCreatureList "Colossal Black Widow"
165    //  4 "Arboreal"
166        pushlist msCreatureList "Myconid"
167        pushlist msCreatureList "Wildwood Guardian"
168        pushlist msCreatureList "Wildwood Reaper"
169    //  5 "Canine"
170        pushlist msCreatureList "Wolf"
171        pushlist msCreatureList "Wolfhound"
172        pushlist msCreatureList "Hellhound"
173    //  6 "Carrion"
174        pushlist msCreatureList "Giant Rat"
175        pushlist msCreatureList "Corpse Eater"
176        pushlist msCreatureList "Carrion Beetle"
177    //  7 "Daemonic"
178        pushlist msCreatureList "Imp"
179        pushlist msCreatureList "Gargoyle"
180        pushlist msCreatureList "Daemon"
181    //  8 "Demihuman"
182        pushlist msCreatureList "Headless"
183        pushlist msCreatureList "Orc"
184        pushlist msCreatureList "Ratman"
185    //  9 "Draconic"
186        pushlist msCreatureList "Dragon Whelp"
187        pushlist msCreatureList "Drake"
188        pushlist msCreatureList "Dragon"
189    //  10 "Earthen"
190        pushlist msCreatureList "Earth Elemental"
191        pushlist msCreatureList "Volcanite"
192        pushlist msCreatureList "Living Earth"
193    //  11 "Farmland"
194        pushlist msCreatureList "Pig"
195        pushlist msCreatureList "Cow"
196        pushlist msCreatureList "Horse"
197    //  12 "Fey"
198        pushlist msCreatureList "Dryad"
199        pushlist msCreatureList "Faery"
200        pushlist msCreatureList "Fey Spirit Matron"
201    //  13 "Flora"
202        pushlist msCreatureList "Corpser"
203        pushlist msCreatureList "Noxweed"
204        pushlist msCreatureList "Deathstalk"
205    //  14 "Ghostly"
206        pushlist msCreatureList "Ghoul"
207        pushlist msCreatureList "Banshee"
208        pushlist msCreatureList "Shadowguard"
209    //  15 "Insectoid"
210        pushlist msCreatureList "Scorpion"
211        pushlist msCreatureList "Fire Ant"
212        pushlist msCreatureList "Sand Crawler"
213    //  16 "Minotaur"
214        pushlist msCreatureList "Minotaur"
215        pushlist msCreatureList "Minotaur Berserker"
216        pushlist msCreatureList "Minotaur Runesmith"
217    //  17 "Ogroid"
218        pushlist msCreatureList "Ogre"
219        pushlist msCreatureList "Troll"
220        pushlist msCreatureList "Ettin"
221    //  18 "Ophidian"
222        pushlist msCreatureList "Ophidian Warrior"
223        pushlist msCreatureList "Ophidian Mage"
224        pushlist msCreatureList "Ophidian Matron"
225    //  19 "Opilion"
226        pushlist msCreatureList "Opilion Worker"
227        pushlist msCreatureList "Opilion Attendant"
228        pushlist msCreatureList "Opilion Conservator"
229    //  20 "Ostard"
230        pushlist msCreatureList "Desert Ostard"
231        pushlist msCreatureList "Forest Ostard"
232        pushlist msCreatureList "Frenzied Ostard"
233    //  21 "Reanimated"
234        pushlist msCreatureList "Flesh Hound"
235        pushlist msCreatureList "Shambler"
236        pushlist msCreatureList "Abomination"
237    //  22 "Reptilian"
238        pushlist msCreatureList "Primordial"
239        pushlist msCreatureList "Lizardman"
240        pushlist msCreatureList "Wyvern"
241    //  23 "Sentinel"
242        pushlist msCreatureList "Observer"
243        pushlist msCreatureList "Overseer"
244        pushlist msCreatureList "Molten Idol"
245    //  24 "Shapeshifter"
246        pushlist msCreatureList "Garou"
247        pushlist msCreatureList "Lycanthrope"
248        pushlist msCreatureList "Malform"
249    //  25 "Skeletal"
250        pushlist msCreatureList "Skeleton"
251        pushlist msCreatureList "Skeletal Guardian"
252        pushlist msCreatureList "Skeletal Fiend"
253    //  26 "Spitter"
254        pushlist msCreatureList "Giant Swamp Slug"
255        pushlist msCreatureList "Colossal Swamp Slug"
256        pushlist msCreatureList "Corpse Purger"
257    //  27 "Stealther"
258        pushlist msCreatureList "Jaguar"
259        pushlist msCreatureList "Creeping Earth"
260        pushlist msCreatureList "Temple Guardian"
261    //  28 "Terathan"
262        pushlist msCreatureList "Terathan Drone"
263        pushlist msCreatureList "Terathan Warrior"
264        pushlist msCreatureList "Terathan Matron"
265    //  29 "Unliving"
266        pushlist msCreatureList "Zombie"
267        pushlist msCreatureList "Revenant"
268        pushlist msCreatureList "Lich Magus"
269    //  30 "Vampiric"
270        pushlist msCreatureList "Vampire Bat"
271        pushlist msCreatureList "Corpsebride"
272        pushlist msCreatureList "Vampire"
273
274    setvar! msCreatureMatch 0
275    setvar! msJackpotFound 0
276    removelist msFoundCreatureList
277    createlist msFoundCreatureList
278   
279    setvar! msType_1 0
280    setvar! msType_2 0
281    setvar! msType_3 0
282    setvar! msTypeMatch 0
283    removelist msFoundTypeList
284    createlist msFoundTypeList
285
286    removelist msResponseList
287    createlist msResponseList
288
289    if insysmsg "You must finish your current roll before playing again."
290    endif
291
292    overhead "◈ ROLLING! ◈ " 52
293#    sysmsg "◈ ROLLING! ◈ " 52
294    gumpresponse 6 msGumpID
295    waitforgump msGumpID 20000
296
297    for 3
298        if not find localKeg ground -1 -1 2 or insysmsg! "You are out of funds."
299            break
300        elseif ingump "Calamity" 1312641219 and inlist msCreatureList "Calamity"
301            poplist msCreatureList "Calamity"
302            pushlist msFoundCreatureList "Calamity"
303            pushlist msFoundTypeList 1
304        elseif ingump "Coagulator" 1312641219 and inlist msCreatureList "Coagulator"
305            poplist msCreatureList "Coagulator"
306            pushlist msFoundCreatureList "Coagulator"
307            pushlist msFoundTypeList 1
308        elseif ingump "Otyugh" 1312641219 and inlist msCreatureList "Otyugh" and not inlist msJackpotList "Otyugh"
309            poplist msCreatureList "Otyugh"
310            pushlist msFoundCreatureList "Otyugh"
311            pushlist msFoundTypeList 1
312        elseif ingump "Giant Frog" 1312641219 and inlist msCreatureList "Giant Frog"
313            poplist msCreatureList "Giant Frog"
314            pushlist msFoundCreatureList "Giant Frog"
315            pushlist msFoundTypeList 2
316        elseif ingump "Chameleon" 1312641219 and inlist msCreatureList "Chameleon"
317            poplist msCreatureList "Chameleon"
318            pushlist msFoundCreatureList "Chameleon"
319            pushlist msFoundTypeList 2
320        elseif ingump "Colossal Poison Dart Frog" 1312641219 and inlist msCreatureList "Colossal Poison Dart Frog" and not inlist msJackpotList "Colossal Poison Dart Frog"
321            poplist msCreatureList "Colossal Poison Dart Frog"
322            pushlist msFoundCreatureList "Colossal Poison Dart Frog"
323            pushlist msFoundTypeList 2
324        elseif ingump "Swamp Spider" 1312641219 and inlist msCreatureList "Swamp Spider"
325            poplist msCreatureList "Swamp Spider"
326            pushlist msFoundCreatureList "Swamp Spider"
327            pushlist msFoundTypeList 3
328        elseif ingump "Giant Spider" 1312641219 and inlist msCreatureList "Giant Spider"
329            poplist msCreatureList "Giant Spider"
330            pushlist msFoundCreatureList "Giant Spider"
331            pushlist msFoundTypeList 3
332        elseif ingump "Colossal Black Widow" 1312641219 and inlist msCreatureList "Colossal Black Widow" and not inlist msJackpotList "Colossal Black Widow"
333            poplist msCreatureList "Colossal Black Widow"
334            pushlist msFoundCreatureList "Colossal Black Widow"
335            pushlist msFoundTypeList 3
336        elseif ingump "Myconid" 1312641219 and inlist msCreatureList "Myconid"
337            poplist msCreatureList "Myconid"
338            pushlist msFoundCreatureList "Myconid"
339            pushlist msFoundTypeList 4
340        elseif ingump "Wildwood Guardian" 1312641219 and inlist msCreatureList "Wildwood Guardian"
341            poplist msCreatureList "Wildwood Guardian"
342            pushlist msFoundCreatureList "Wildwood Guardian"
343            pushlist msFoundTypeList 4
344        elseif ingump "Wildwood Reaper" 1312641219 and inlist msCreatureList "Wildwood Reaper" and not inlist msJackpotList "Wildwood Reaper"
345            poplist msCreatureList "Wildwood Reaper"
346            pushlist msFoundCreatureList "Wildwood Reaper"
347            pushlist msFoundTypeList 4
348        elseif ingump "Wolf" 1312641219 and not ingump "Wolfhound" 1312641219 and inlist msCreatureList "Wolf"
349            poplist msCreatureList "Wolf"
350            pushlist msFoundCreatureList "Wolf"
351            pushlist msFoundTypeList 5
352        elseif ingump "Wolfhound" 1312641219 and inlist msCreatureList "Wolfhound"
353            poplist msCreatureList "Wolfhound"
354            pushlist msFoundCreatureList "Wolfhound"
355            pushlist msFoundTypeList 5
356        elseif ingump "Hellhound" 1312641219 and inlist msCreatureList "Hellhound" and not inlist msJackpotList "Hellhound"
357            poplist msCreatureList "Hellhound"
358            pushlist msFoundCreatureList "Hellhound"
359            pushlist msFoundTypeList 5
360        elseif ingump "Giant Rat" 1312641219 and inlist msCreatureList "Giant Rat"
361            poplist msCreatureList "Giant Rat"
362            pushlist msFoundCreatureList "Giant Rat"
363            pushlist msFoundTypeList 6
364        elseif ingump "Corpse Eater" 1312641219 and inlist msCreatureList "Corpse Eater"
365            poplist msCreatureList "Corpse Eater"
366            pushlist msFoundCreatureList "Corpse Eater"
367            pushlist msFoundTypeList 6
368        elseif ingump "Carrion Beetle" 1312641219 and inlist msCreatureList "Carrion Beetle" and not inlist msJackpotList "Carrion Beetle"
369            poplist msCreatureList "Carrion Beetle"
370            pushlist msFoundCreatureList "Carrion Beetle"
371            pushlist msFoundTypeList 6
372        elseif ingump "Imp" 1312641219 and inlist msCreatureList "Imp"
373            poplist msCreatureList "Imp"
374            pushlist msFoundCreatureList "Imp"
375            pushlist msFoundTypeList 7
376        elseif ingump "Gargoyle" 1312641219 and inlist msCreatureList "Gargoyle"
377            poplist msCreatureList "Gargoyle"
378            pushlist msFoundCreatureList "Gargoyle"
379            pushlist msFoundTypeList 7
380        elseif ingump "Daemon" 1312641219 and not ingump "Imp" 1312641219 and not ingump "Gargoyle" 1312641219 and inlist msCreatureList "Daemon" and not inlist msJackpotList "Daemon"
381            poplist msCreatureList "Daemon"
382            pushlist msFoundCreatureList "Daemon"
383            pushlist msFoundTypeList 7
384        elseif ingump "Headless" 1312641219 and inlist msCreatureList "Headless"
385            poplist msCreatureList "Headless"
386            pushlist msFoundCreatureList "Headless"
387            pushlist msFoundTypeList 8
388        elseif ingump "Orc" 1312641219 and inlist msCreatureList "Orc"
389            poplist msCreatureList "Orc"
390            pushlist msFoundCreatureList "Orc"
391            pushlist msFoundTypeList 8
392        elseif ingump "Ratman" 1312641219 and inlist msCreatureList "Ratman" and not inlist msJackpotList "Ratman"
393            poplist msCreatureList "Ratman"
394            pushlist msFoundCreatureList "Ratman"
395            pushlist msFoundTypeList 8
396        elseif ingump "Dragon Whelp" 1312641219 and inlist msCreatureList "Dragon Whelp"
397            poplist msCreatureList "Dragon Whelp"
398            pushlist msFoundCreatureList "Dragon Whelp"
399            pushlist msFoundTypeList 9
400        elseif ingump "Drake" 1312641219 and inlist msCreatureList "Drake"
401            poplist msCreatureList "Drake"
402            pushlist msFoundCreatureList "Drake"
403            pushlist msFoundTypeList 9
404        elseif ingump "Dragon" 1312641219 and not ingump "Dragon Whelp" 1312641219 and inlist msCreatureList "Dragon" and not inlist msJackpotList "Dragon"
405            poplist msCreatureList "Dragon"
406            pushlist msFoundCreatureList "Dragon"
407            pushlist msFoundTypeList 9
408        elseif ingump "Earth Elemental" 1312641219 and inlist msCreatureList "Earth Elemental"
409            poplist msCreatureList "Earth Elemental"
410            pushlist msFoundCreatureList "Earth Elemental"
411            pushlist msFoundTypeList 10
412        elseif ingump "Volcanite" 1312641219 and inlist msCreatureList "Volcanite"
413            poplist msCreatureList "Volcanite"
414            pushlist msFoundCreatureList "Volcanite"
415            pushlist msFoundTypeList 10
416        elseif ingump "Living Earth" 1312641219 and inlist msCreatureList "Living Earth" and not inlist msJackpotList "Living Earth"
417            poplist msCreatureList "Living Earth"
418            pushlist msFoundCreatureList "Living Earth"
419            pushlist msFoundTypeList 10
420        elseif ingump "Pig" 1312641219 and inlist msCreatureList "Pig"
421            poplist msCreatureList "Pig"
422            pushlist msFoundCreatureList "Pig"
423            pushlist msFoundTypeList 11
424        elseif ingump "Cow" 1312641219 and inlist msCreatureList "Cow"
425            poplist msCreatureList "Cow"
426            pushlist msFoundCreatureList "Cow"
427            pushlist msFoundTypeList 11
428        elseif ingump "Horse" 1312641219 and inlist msCreatureList "Horse" and not inlist msJackpotList "Horse"
429            poplist msCreatureList "Horse"
430            pushlist msFoundCreatureList "Horse"
431            pushlist msFoundTypeList 11
432        elseif ingump "Dryad" 1312641219 and inlist msCreatureList "Dryad"
433            poplist msCreatureList "Dryad"
434            pushlist msFoundCreatureList "Dryad"
435            pushlist msFoundTypeList 12
436        elseif ingump "Faery" 1312641219 and inlist msCreatureList "Faery"
437            poplist msCreatureList "Faery"
438            pushlist msFoundCreatureList "Faery"
439            pushlist msFoundTypeList 12
440        elseif ingump "Fey Spirit Matron" 1312641219 and inlist msCreatureList "Fey Spirit Matron" and not inlist msJackpotList "Fey Spirit Matron"
441            poplist msCreatureList "Fey Spirit Matron"
442            pushlist msFoundCreatureList "Fey Spirit Matron"
443            pushlist msFoundTypeList 12
444        elseif ingump "Corpser" 1312641219 and inlist msCreatureList "Corpser"
445            poplist msCreatureList "Corpser"
446            pushlist msFoundCreatureList "Corpser"
447            pushlist msFoundTypeList 13
448        elseif ingump "Noxweed" 1312641219 and inlist msCreatureList "Noxweed"
449            poplist msCreatureList "Noxweed"
450            pushlist msFoundCreatureList "Noxweed"
451            pushlist msFoundTypeList 13
452        elseif ingump "Deathstalk" 1312641219 and inlist msCreatureList "Deathstalk" and not inlist msJackpotList "Deathstalk"
453            poplist msCreatureList "Deathstalk"
454            pushlist msFoundCreatureList "Deathstalk"
455            pushlist msFoundTypeList 13
456        elseif ingump "Ghoul" 1312641219 and inlist msCreatureList "Ghoul"
457            poplist msCreatureList "Ghoul"
458            pushlist msFoundCreatureList "Ghoul"
459            pushlist msFoundTypeList 14
460        elseif ingump "Banshee" 1312641219 and inlist msCreatureList "Banshee"
461            poplist msCreatureList "Banshee"
462            pushlist msFoundCreatureList "Banshee"
463            pushlist msFoundTypeList 14
464        elseif ingump "Shadowguard" 1312641219 and inlist msCreatureList "Shadowguard" and not inlist msJackpotList "Shadowguard"
465            poplist msCreatureList "Shadowguard"
466            pushlist msFoundCreatureList "Shadowguard"
467            pushlist msFoundTypeList 14
468        elseif ingump "Scorpion" 1312641219 and inlist msCreatureList "Scorpion"
469            poplist msCreatureList "Scorpion"
470            pushlist msFoundCreatureList "Scorpion"
471            pushlist msFoundTypeList 15
472        elseif ingump "Fire Ant" 1312641219 and inlist msCreatureList "Fire Ant"
473            poplist msCreatureList "Fire Ant"
474            pushlist msFoundCreatureList "Fire Ant"
475            pushlist msFoundTypeList 15
476        elseif ingump "Sand Crawler" 1312641219 and inlist msCreatureList "Sand Crawler" and not inlist msJackpotList "Sand Crawler"
477            poplist msCreatureList "Sand Crawler"
478            pushlist msFoundCreatureList "Sand Crawler"
479            pushlist msFoundTypeList 15
480        elseif ingump "Minotaur" 1312641219 and not ingump "Minotaur Berserker" 1312641219 and not ingump "Minotaur Runesmith" 1312641219 and inlist msCreatureList "Minotaur"
481            poplist msCreatureList "Minotaur"
482            pushlist msFoundCreatureList "Minotaur"
483            pushlist msFoundTypeList 16
484        elseif ingump "Minotaur Berserker" 1312641219 and inlist msCreatureList "Minotaur Berserker"
485            poplist msCreatureList "Minotaur Berserker"
486            pushlist msFoundCreatureList "Minotaur Berserker"
487            pushlist msFoundTypeList 16
488        elseif ingump "Minotaur Runesmith" 1312641219 and inlist msCreatureList "Minotaur Runesmith" and not inlist msJackpotList "Minotaur Runesmith"
489            poplist msCreatureList "Minotaur Runesmith"
490            pushlist msFoundCreatureList "Minotaur Runesmith"
491            pushlist msFoundTypeList 16
492        elseif ingump "Ogre" 1312641219 and inlist msCreatureList "Ogre"
493            poplist msCreatureList "Ogre"
494            pushlist msFoundCreatureList "Ogre"
495            pushlist msFoundTypeList 17
496        elseif ingump "Troll" 1312641219 and inlist msCreatureList "Troll"
497            poplist msCreatureList "Troll"
498            pushlist msFoundCreatureList "Troll"
499            pushlist msFoundTypeList 17
500        elseif ingump "Ettin" 1312641219 and inlist msCreatureList "Ettin" and not inlist msJackpotList "Ettin"
501            poplist msCreatureList "Ettin"
502            pushlist msFoundCreatureList "Ettin"
503            pushlist msFoundTypeList 17
504        elseif ingump "Ophidian Warrior" 1312641219 and inlist msCreatureList "Ophidian Warrior"
505            poplist msCreatureList "Ophidian Warrior"
506            pushlist msFoundCreatureList "Ophidian Warrior"
507            pushlist msFoundTypeList 18
508        elseif ingump "Ophidian Mage" 1312641219 and inlist msCreatureList "Ophidian Mage"
509            poplist msCreatureList "Ophidian Mage"
510            pushlist msFoundCreatureList "Ophidian Mage"
511            pushlist msFoundTypeList 18
512        elseif ingump "Ophidian Matron" 1312641219 and inlist msCreatureList "Ophidian Matron" and not inlist msJackpotList "Ophidian Matron"
513            poplist msCreatureList "Ophidian Matron"
514            pushlist msFoundCreatureList "Ophidian Matron"
515            pushlist msFoundTypeList 18
516        elseif ingump "Opilion Worker" 1312641219 and inlist msCreatureList "Opilion Worker"
517            poplist msCreatureList "Opilion Worker"
518            pushlist msFoundCreatureList "Opilion Worker"
519            pushlist msFoundTypeList 19
520        elseif ingump "Opilion Attendant" 1312641219 and inlist msCreatureList "Opilion Attendant"
521            poplist msCreatureList "Opilion Attendant"
522            pushlist msFoundCreatureList "Opilion Attendant"
523            pushlist msFoundTypeList 19
524        elseif ingump "Opilion Conservator" 1312641219 and inlist msCreatureList "Opilion Conservator" and not inlist msJackpotList "Opilion Conservator"
525            poplist msCreatureList "Opilion Conservator"
526            pushlist msFoundCreatureList "Opilion Conservator"
527            pushlist msFoundTypeList 19
528        elseif ingump "Desert Ostard" 1312641219 and inlist msCreatureList "Desert Ostard"
529            poplist msCreatureList "Desert Ostard"
530            pushlist msFoundCreatureList "Desert Ostard"
531            pushlist msFoundTypeList 20
532        elseif ingump "Forest Ostard" 1312641219 and inlist msCreatureList "Forest Ostard"
533            poplist msCreatureList "Forest Ostard"
534            pushlist msFoundCreatureList "Forest Ostard"
535            pushlist msFoundTypeList 20
536        elseif ingump "Frenzied Ostard" 1312641219 and inlist msCreatureList "Frenzied Ostard" and not inlist msJackpotList "Frenzied Ostard"
537            poplist msCreatureList "Frenzied Ostard"
538            pushlist msFoundCreatureList "Frenzied Ostard"
539            pushlist msFoundTypeList 20
540        elseif ingump "Flesh Hound" 1312641219 and inlist msCreatureList "Flesh Hound"
541            poplist msCreatureList "Flesh Hound"
542            pushlist msFoundCreatureList "Flesh Hound"
543            pushlist msFoundTypeList 21
544        elseif ingump "Shambler" 1312641219 and inlist msCreatureList "Shambler"
545            poplist msCreatureList "Shambler"
546            pushlist msFoundCreatureList "Shambler"
547            pushlist msFoundTypeList 21
548        elseif ingump "Abomination" 1312641219 and inlist msCreatureList "Abomination" and not inlist msJackpotList "Abomination"
549            poplist msCreatureList "Abomination"
550            pushlist msFoundCreatureList "Abomination"
551            pushlist msFoundTypeList 21
552        elseif ingump "Primordial" 1312641219 and inlist msCreatureList "Primordial"
553            poplist msCreatureList "Primordial"
554            pushlist msFoundCreatureList "Primordial"
555            pushlist msFoundTypeList 22
556        elseif ingump "Lizardman" 1312641219 and inlist msCreatureList "Lizardman"
557            poplist msCreatureList "Lizardman"
558            pushlist msFoundCreatureList "Lizardman"
559            pushlist msFoundTypeList 22
560        elseif ingump "Wyvern" 1312641219 and inlist msCreatureList "Wyvern" and not inlist msJackpotList "Wyvern"
561            poplist msCreatureList "Wyvern"
562            pushlist msFoundCreatureList "Wyvern"
563            pushlist msFoundTypeList 22
564        elseif ingump "Observer" 1312641219 and inlist msCreatureList "Observer"
565            poplist msCreatureList "Observer"
566            pushlist msFoundCreatureList "Observer"
567            pushlist msFoundTypeList 23
568        elseif ingump "Overseer" 1312641219 and inlist msCreatureList "Overseer"
569            poplist msCreatureList "Overseer"
570            pushlist msFoundCreatureList "Overseer"
571            pushlist msFoundTypeList 23
572        elseif ingump "Molten Idol" 1312641219 and inlist msCreatureList "Molten Idol" and not inlist msJackpotList "Molten Idol"
573            poplist msCreatureList "Molten Idol"
574            pushlist msFoundCreatureList "Molten Idol"
575            pushlist msFoundTypeList 23
576        elseif ingump "Garou" 1312641219 and inlist msCreatureList "Garou"
577            poplist msCreatureList "Garou"
578            pushlist msFoundCreatureList "Garou"
579            pushlist msFoundTypeList 24
580        elseif ingump "Lycanthrope" 1312641219 and inlist msCreatureList "Lycanthrope"
581            poplist msCreatureList "Lycanthrope"
582            pushlist msFoundCreatureList "Lycanthrope"
583            pushlist msFoundTypeList 24
584        elseif ingump "Malform" 1312641219 and inlist msCreatureList "Malform" and not inlist msJackpotList "Malform"
585            poplist msCreatureList "Malform"
586            pushlist msFoundCreatureList "Malform"
587            pushlist msFoundTypeList 24
588        elseif ingump "Skeleton" 1312641219 and inlist msCreatureList "Skeleton"
589            poplist msCreatureList "Skeleton"
590            pushlist msFoundCreatureList "Skeleton"
591            pushlist msFoundTypeList 25
592        elseif ingump "Skeletal Guardian" 1312641219 and inlist msCreatureList "Skeletal Guardian"
593            poplist msCreatureList "Skeletal Guardian"
594            pushlist msFoundCreatureList "Skeletal Guardian"
595            pushlist msFoundTypeList 25
596        elseif ingump "Skeletal Fiend" 1312641219 and inlist msCreatureList "Skeletal Fiend" and not inlist msJackpotList "Skeletal Fiend"
597            poplist msCreatureList "Skeletal Fiend"
598            pushlist msFoundCreatureList "Skeletal Fiend"
599            pushlist msFoundTypeList 25
600        elseif ingump "Giant Swamp Slug" 1312641219 and inlist msCreatureList "Giant Swamp Slug"
601            poplist msCreatureList "Giant Swamp Slug"
602            pushlist msFoundCreatureList "Giant Swamp Slug"
603            pushlist msFoundTypeList 26
604        elseif ingump "Colossal Swamp Slug" 1312641219 and inlist msCreatureList "Colossal Swamp Slug"
605            poplist msCreatureList "Colossal Swamp Slug"
606            pushlist msFoundCreatureList "Colossal Swamp Slug"
607            pushlist msFoundTypeList 26
608        elseif ingump "Corpse Purger" 1312641219 and inlist msCreatureList "Corpse Purger" and not inlist msJackpotList "Corpse Purger"
609            poplist msCreatureList "Corpse Purger"
610            pushlist msFoundCreatureList "Corpse Purger"
611            pushlist msFoundTypeList 26
612        elseif ingump "Jaguar" 1312641219 and inlist msCreatureList "Jaguar"
613            poplist msCreatureList "Jaguar"
614            pushlist msFoundCreatureList "Jaguar"
615            pushlist msFoundTypeList 27
616        elseif ingump "Creeping Earth" 1312641219 and inlist msCreatureList "Creeping Earth"
617            poplist msCreatureList "Creeping Earth"
618            pushlist msFoundCreatureList "Creeping Earth"
619            pushlist msFoundTypeList 27
620        elseif ingump "Temple Guardian" 1312641219 and inlist msCreatureList "Temple Guardian" and not inlist msJackpotList "Temple Guardian"
621            poplist msCreatureList "Temple Guardian"
622            pushlist msFoundCreatureList "Temple Guardian"
623            pushlist msFoundTypeList 27
624        elseif ingump "Terathan Drone" 1312641219 and inlist msCreatureList "Terathan Drone"
625            poplist msCreatureList "Terathan Drone"
626            pushlist msFoundCreatureList "Terathan Drone"
627            pushlist msFoundTypeList 28
628        elseif ingump "Terathan Warrior" 1312641219 and inlist msCreatureList "Terathan Warrior"
629            poplist msCreatureList "Terathan Warrior"
630            pushlist msFoundCreatureList "Terathan Warrior"
631            pushlist msFoundTypeList 28
632        elseif ingump "Terathan Matron" 1312641219 and inlist msCreatureList "Terathan Matron" and not inlist msJackpotList "Terathan Matron"
633            poplist msCreatureList "Terathan Matron"
634            pushlist msFoundCreatureList "Terathan Matron"
635            pushlist msFoundTypeList 28
636        elseif ingump "Zombie" 1312641219 and inlist msCreatureList "Zombie"
637            poplist msCreatureList "Zombie"
638            pushlist msFoundCreatureList "Zombie"
639            pushlist msFoundTypeList 29
640        elseif ingump "Revenant" 1312641219 and inlist msCreatureList "Revenant"
641            poplist msCreatureList "Revenant"
642            pushlist msFoundCreatureList "Revenant"
643            pushlist msFoundTypeList 29
644        elseif ingump "Lich Magus" 1312641219 and inlist msCreatureList "Lich Magus" and not inlist msJackpotList "Lich Magus"
645            poplist msCreatureList "Lich Magus"
646            pushlist msFoundCreatureList "Lich Magus"
647            pushlist msFoundTypeList 29
648        elseif ingump "Vampire Bat" 1312641219 and inlist msCreatureList "Vampire Bat"
649            poplist msCreatureList "Vampire Bat"
650            pushlist msFoundCreatureList "Vampire Bat"
651            pushlist msFoundTypeList 30
652        elseif ingump "Corpsebride" 1312641219 and inlist msCreatureList "Corpsebride"
653            poplist msCreatureList "Corpsebride"
654            pushlist msFoundCreatureList "Corpsebride"
655            pushlist msFoundTypeList 30
656        elseif ingump "Vampire" 1312641219 and not ingump "Vampire Bat" 1312641219 and inlist msCreatureList "Vampire" and not inlist msJackpotList "Vampire"
657            poplist msCreatureList "Vampire"
658            pushlist msFoundCreatureList "Vampire"
659            pushlist msFoundTypeList 30
660        else
661            //This is not perfect.. if 1 or 2 is rare, and the other is a common or uncommon creature of the jackpot creature group it is assumed pick 3 is a jackpot creature (and we will check out as unknown type match without rerolling), however it also may be a non jackpot creature match
662            //Checking for the actual name of a jackpot creature is useless, because the jackpot creature name is always shown in the gump
663            if inlist msCreatureList "Otyugh" and inlist msJackpotList "Otyugh" and ingump "Aberration" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
664                poplist msCreatureList "Otyugh"
665                poplist msJackpotList "Otyugh"
666                pushlist msFoundCreatureList "Otyugh"
667                pushlist msFoundTypeList 1
668            elseif inlist msCreatureList "Colossal Poison Dart Frog" and inlist msJackpotList "Colossal Poison Dart Frog" and ingump "Amphibian" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
669                poplist msCreatureList "Colossal Poison Dart Frog"
670                poplist msJackpotList "Colossal Poison Dart Frog"
671                pushlist msFoundCreatureList "Colossal Poison Dart Frog"
672                pushlist msFoundTypeList 2
673            elseif inlist msCreatureList "Colossal Black Widow" and inlist msJackpotList "Colossal Black Widow" and ingump "Arachnid" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
674                poplist msCreatureList "Colossal Black Widow"
675                poplist msJackpotList "Colossal Black Widow"
676                pushlist msFoundCreatureList "Colossal Black Widow"
677                pushlist msFoundTypeList 3
678            elseif inlist msCreatureList "Wildwood Reaper" and inlist msJackpotList "Wildwood Reaper" and ingump "Arboreal" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
679                poplist msCreatureList "Wildwood Reaper"
680                poplist msJackpotList "Wildwood Reaper"
681                pushlist msFoundCreatureList "Wildwood Reaper"
682                pushlist msFoundTypeList 4
683            elseif inlist msCreatureList "Hellhound" and inlist msJackpotList "Hellhound" and ingump "Canine" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
684                poplist msCreatureList "Hellhound"
685                poplist msJackpotList "Hellhound"
686                pushlist msFoundCreatureList "Hellhound"
687                pushlist msFoundTypeList 5
688            elseif inlist msCreatureList "Carrion Beetle" and inlist msJackpotList "Carrion Beetle" and ingump "Carrion" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
689                poplist msCreatureList "Carrion Beetle"
690                poplist msJackpotList "Carrion Beetle"
691                pushlist msFoundCreatureList "Carrion Beetle"
692                pushlist msFoundTypeList 6
693            elseif inlist msCreatureList "Daemon" and inlist msJackpotList "Daemon" and ingump "Daemonic" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
694                poplist msCreatureList "Daemon"
695                poplist msJackpotList "Daemon"
696                pushlist msFoundCreatureList "Daemon"
697                pushlist msFoundTypeList 7
698            elseif inlist msCreatureList "Ratman" and inlist msJackpotList "Ratman" and ingump "Demihuman" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
699                poplist msCreatureList "Ratman"
700                poplist msJackpotList "Ratman"
701                pushlist msFoundCreatureList "Ratman"
702                pushlist msFoundTypeList 8
703            elseif inlist msCreatureList "Dragon" and inlist msJackpotList "Dragon" and ingump "Draconic" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
704                poplist msCreatureList "Dragon"
705                poplist msJackpotList "Dragon"
706                pushlist msFoundCreatureList "Dragon"
707                pushlist msFoundTypeList 9
708            elseif inlist msCreatureList "Living Earth" and inlist msJackpotList "Living Earth" and ingump "Earthen" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
709                poplist msCreatureList "Living Earth"
710                poplist msJackpotList "Living Earth"
711                pushlist msFoundCreatureList "Living Earth"
712                pushlist msFoundTypeList 10
713            elseif inlist msCreatureList "Horse" and inlist msJackpotList "Horse" and ingump "Farmland" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
714                poplist msCreatureList "Horse"
715                poplist msJackpotList "Horse"
716                pushlist msFoundCreatureList "Horse"
717                pushlist msFoundTypeList 11
718            elseif inlist msCreatureList "Fey Spirit Matron" and inlist msJackpotList "Fey Spirit Matron" and ingump "Fey" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
719                poplist msCreatureList "Fey Spirit Matron"
720                poplist msJackpotList "Fey Spirit Matron"
721                pushlist msFoundCreatureList "Fey Spirit Matron"
722                pushlist msFoundTypeList 12
723            elseif inlist msCreatureList "Deathstalk" and inlist msJackpotList "Deathstalk" and ingump "Flora" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
724                poplist msCreatureList "Deathstalk"
725                poplist msJackpotList "Deathstalk"
726                pushlist msFoundCreatureList "Deathstalk"
727                pushlist msFoundTypeList 13
728            elseif inlist msCreatureList "Shadowguard" and inlist msJackpotList "Shadowguard" and ingump "Ghostly" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
729                poplist msCreatureList "Shadowguard"
730                poplist msJackpotList "Shadowguard"
731                pushlist msFoundCreatureList "Shadowguard"
732                pushlist msFoundTypeList 14
733            elseif inlist msCreatureList "Sand Crawler" and inlist msJackpotList "Sand Crawler" and ingump "Insectoid" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
734                poplist msCreatureList "Sand Crawler"
735                poplist msJackpotList "Sand Crawler"
736                pushlist msFoundCreatureList "Sand Crawler"
737                pushlist msFoundTypeList 15
738            elseif inlist msCreatureList "Minotaur Runesmith" and inlist msJackpotList "Minotaur Runesmith" and ingump "Minotaur" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
739                poplist msCreatureList "Minotaur Runesmith"
740                poplist msJackpotList "Minotaur Runesmith"
741                pushlist msFoundCreatureList "Minotaur Runesmith"
742                pushlist msFoundTypeList 16
743            elseif inlist msCreatureList "Ettin" and inlist msJackpotList "Ettin" and ingump "Ogroid" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
744                poplist msCreatureList "Ettin"
745                poplist msJackpotList "Ettin"
746                pushlist msFoundCreatureList "Ettin"
747                pushlist msFoundTypeList 17
748            elseif inlist msCreatureList "Ophidian Matron" and inlist msJackpotList "Ophidian Matron" and ingump "Ophidian" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
749                poplist msCreatureList "Ophidian Matron"
750                poplist msJackpotList "Ophidian Matron"
751                pushlist msFoundCreatureList "Ophidian Matron"
752                pushlist msFoundTypeList 18
753            elseif inlist msCreatureList "Opilion Conservator" and inlist msJackpotList "Opilion Conservator" and ingump "Opilion" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
754                poplist msCreatureList "Opilion Conservator"
755                poplist msJackpotList "Opilion Conservator"
756                pushlist msFoundCreatureList "Opilion Conservator"
757                pushlist msFoundTypeList 19
758            elseif inlist msCreatureList "Frenzied Ostard" and inlist msJackpotList "Frenzied Ostard" and ingump "Ostard" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
759                poplist msCreatureList "Frenzied Ostard"
760                poplist msJackpotList "Frenzied Ostard"
761                pushlist msFoundCreatureList "Frenzied Ostard"
762                pushlist msFoundTypeList 20
763            elseif inlist msCreatureList "Abomination" and inlist msJackpotList "Abomination" and ingump "Reanimated" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
764                poplist msCreatureList "Abomination"
765                poplist msJackpotList "Abomination"
766                pushlist msFoundCreatureList "Abomination"
767                pushlist msFoundTypeList 21
768            elseif inlist msCreatureList "Wyvern" and inlist msJackpotList "Wyvern" and ingump "Reptilian" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
769                poplist msCreatureList "Wyvern"
770                poplist msJackpotList "Wyvern"
771                pushlist msFoundCreatureList "Wyvern"
772                pushlist msFoundTypeList 22
773            elseif inlist msCreatureList "Molten Idol" and inlist msJackpotList "Molten Idol" and ingump "Sentinel" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
774                poplist msCreatureList "Molten Idol"
775                poplist msJackpotList "Molten Idol"
776                pushlist msFoundCreatureList "Molten Idol"
777                pushlist msFoundTypeList 23
778            elseif inlist msCreatureList "Malform" and inlist msJackpotList "Malform" and ingump "Shapeshifter" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
779                poplist msCreatureList "Malform"
780                poplist msJackpotList "Malform"
781                pushlist msFoundCreatureList "Malform"
782                pushlist msFoundTypeList 24
783            elseif inlist msCreatureList "Skeletal Fiend" and inlist msJackpotList "Skeletal Fiend" and ingump "Skeletal" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
784                poplist msCreatureList "Skeletal Fiend"
785                poplist msJackpotList "Skeletal Fiend"
786                pushlist msFoundCreatureList "Skeletal Fiend"
787                pushlist msFoundTypeList 25
788            elseif inlist msCreatureList "Corpse Purger" and inlist msJackpotList "Corpse Purger" and ingump "Spitter" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
789                poplist msCreatureList "Corpse Purger"
790                poplist msJackpotList "Corpse Purger"
791                pushlist msFoundCreatureList "Corpse Purger"
792                pushlist msFoundTypeList 26
793            elseif inlist msCreatureList "Temple Guardian" and inlist msJackpotList "Temple Guardian" and ingump "Stealther" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
794                poplist msCreatureList "Temple Guardian"
795                poplist msJackpotList "Temple Guardian"
796                pushlist msFoundCreatureList "Temple Guardian"
797                pushlist msFoundTypeList 27
798            elseif inlist msCreatureList "Terathan Matron" and inlist msJackpotList "Terathan Matron" and ingump "Terathan" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
799                poplist msCreatureList "Terathan Matron"
800                poplist msJackpotList "Terathan Matron"
801                pushlist msFoundCreatureList "Terathan Matron"
802                pushlist msFoundTypeList 28
803            elseif inlist msCreatureList "Lich Magus" and inlist msJackpotList "Lich Magus" and ingump "Unliving" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
804                poplist msCreatureList "Lich Magus"
805                poplist msJackpotList "Lich Magus"
806                pushlist msFoundCreatureList "Lich Magus"
807                pushlist msFoundTypeList 29
808            elseif inlist msCreatureList "Vampire" and inlist msJackpotList "Vampire" and ingump "Vampiric" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219
809                poplist msCreatureList "Vampire"
810                poplist msJackpotList "Vampire"
811                pushlist msFoundCreatureList "Vampire"
812                pushlist msFoundTypeList 30
813
814            //Correct potential mismatches (Wolf, Daemon, Dragon, Minotaur, Vampire)
815            elseif ingump "Wolf" 1312641219 and ingump "Common (1x Match Bonus)" 1312641219 and inlist msCreatureList "Wolf" and msTypeMatch > 0
816                poplist msCreatureList "Wolf"
817                pushlist msFoundCreatureList "Wolf"
818                pushlist msFoundTypeList 5
819            elseif ingump "Daemon" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219 and inlist msCreatureList "Daemon" and msTypeMatch > 0
820                poplist msCreatureList "Daemon"
821                pushlist msFoundCreatureList "Daemon"
822                pushlist msFoundTypeList 7
823            elseif ingump "Dragon" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219 and inlist msCreatureList "Dragon" and msTypeMatch > 0
824                poplist msCreatureList "Dragon"
825                pushlist msFoundCreatureList "Dragon"
826                pushlist msFoundTypeList 9
827            elseif ingump "Minotaur" 1312641219 and ingump "Common (1x Match Bonus)" 1312641219 and inlist msCreatureList "Minotaur" and msTypeMatch > 0
828                poplist msCreatureList "Minotaur"
829                pushlist msFoundCreatureList "Minotaur"
830                pushlist msFoundTypeList 16
831            elseif ingump "Vampire" 1312641219 and ingump "Rare (5x Match Bonus)" 1312641219 and inlist msCreatureList "Vampire" and msTypeMatch > 0
832                poplist msCreatureList "Vampire"
833                pushlist msFoundCreatureList "Vampire"
834                pushlist msFoundTypeList 30
835            endif
836        endif
837
838        //Check jackpot creature gump position
839        if 0 = index and list msJackpotList = 0
840            setvar! msJackpotFound 2
841        elseif 1 = index and list msJackpotList = 0 and msJackpotFound != 2
842            setvar! msJackpotFound 3
843        elseif 2 = index and list msJackpotList = 0 and msJackpotFound != 2 and msJackpotFound != 3
844            setvar! msJackpotFound 4
845        endif
846
847        //Check for creature type match
848        if list msFoundTypeList > 0
849            if poplist msFoundTypeList front as localCreatureType
850                if 0 = index
851                    setvar! msType_1 localCreatureType
852                elseif 1 = index
853                    setvar! msType_2 localCreatureType
854                elseif 2 = index
855                    setvar! msType_3 localCreatureType
856                endif
857            endif
858        endif
859        if msType_1 > 0 and msType_2 > 0 and msType_3 > 0 and msType_1 = msType_2 and msType_2 = msType_3
860            setvar! msTypeMatch 123
861        elseif msType_1 > 0 and msType_2 > 0 and msType_1 = msType_2
862            setvar! msTypeMatch 12
863        elseif msType_1 > 0 and msType_3 > 0 and msType_1 = msType_3
864            setvar! msTypeMatch 13
865        elseif msType_2 > 0 and msType_3 > 0 and msType_2 = msType_3
866            setvar! msTypeMatch 23
867        endif
868
869        //Check outcome
870        if 1 = index and list msFoundCreatureList = 1
871            //Creature pair 1 & 2 -> Reroll 3 next run if it does not match
872            if msDebugMode > 0
873                sysmsg "[ MATCH FOUND 1&2 ]" 100
874            endif
875            if list msJackpotList = 0
876                if msDebugMode > 0
877                    sysmsg "[ JACKPOT PAIR ]" 100
878                endif
879                setvar! msCreatureMatch 2
880            else
881                setvar! msCreatureMatch 1
882            endif
883            setvar! msTypeMatch 12
884            setvar! msType_2 msType_1
885        elseif 2 = index and list msFoundCreatureList = 1
886            //Creature pair 1 & 2 & 3 -> Checkout
887            if msDebugMode > 0
888                sysmsg "[ MATCH FOUND 1&2&3 ]" 100
889            endif
890            pushlist msResponseList 2
891            pushlist msResponseList 3
892            pushlist msResponseList 4
893        elseif 2 = index and list msFoundCreatureList = 2
894            if msCreatureMatch > 0
895                if msCreatureMatch = 1 and msTypeMatch = 123
896                    if msDebugMode > 0
897                        sysmsg "[ TYPE MATCH 3 ]" 100
898                    endif
899                    //Creature pair 1 & 2 (not jackpot), type match with 3 -> Checkout without rerolling
900                    pushlist msResponseList 2
901                    pushlist msResponseList 3
902                    pushlist msResponseList 4
903                else
904                    //Creature pair 1 & 2, reroll 3
905                    pushlist msResponseList 2
906                    pushlist msResponseList 3
907                endif
908            elseif list msJackpotList = 0
909                //Unknown creature pair -> Check for jackpot creature
910                if msDebugMode > 0
911                    overhead "[ JACKPOT PAIR SUSPECTED ]" 33
912                    overhead "[ SAFETY BREAK ]" 33
913                    sysmsg "[ JACKPOT PAIR SUSPECTED ]" 33
914                    sysmsg "[ SAFETY BREAK ]" 33
915                endif
916                pushlist msResponseList 0
917            else
918                //Unknown creature pair -> Checkout without rerolling
919                if msDebugMode > 0
920                    sysmsg "[ UNKNOWN PAIR ]" 100
921                    sysmsg "[ KEEPING ALL ]" 100
922                endif
923                pushlist msResponseList 2
924                pushlist msResponseList 3
925                pushlist msResponseList 4
926            endif
927        elseif 2 = index and msTypeMatch > 0
928            if msTypeMatch = 123
929                if msDebugMode > 0
930                    sysmsg "[ GROUP FOUND 1&2&3 ]" 100
931                endif
932                if list msJackpotList = 0
933                    if msDebugMode > 0
934                        overhead "[ TYPE MATCH WITH JACKPOT ]" 33
935                        overhead "[ SAFETY BREAK ]" 33 
936                        sysmsg "[ TYPE MATCH WITH JACKPOT ]" 33
937                        sysmsg "[ SAFETY BREAK ]" 33
938                    endif
939                    pushlist msResponseList 0
940                endif
941                //Checkout without rerolling
942                pushlist msResponseList 2
943                pushlist msResponseList 3
944                pushlist msResponseList 4
945            elseif list msJackpotList = 0
946                if msDebugMode > 0
947                    sysmsg "[ TYPE MATCH WITH JACKPOT ]" 100
948                    sysmsg "[ KEEPING JACKPOT ]" 100
949                endif
950            elseif msTypeMatch = 12
951                //Type pair 1 & 2 -> Reroll 3
952                if msDebugMode > 0
953                    sysmsg "[ GROUP FOUND 1&2 ]" 100
954                endif
955                pushlist msResponseList 2
956                pushlist msResponseList 3
957            elseif msTypeMatch = 13
958                //Type pair 1 & 3 -> Reroll 2
959                if msDebugMode > 0
960                    sysmsg "[ GROUP FOUND 1&3 ]" 100
961                endif
962                pushlist msResponseList 2
963                pushlist msResponseList 4
964            elseif msTypeMatch = 23
965                //Type pair 2 & 3 -> Reroll 1
966                if msDebugMode > 0
967                    sysmsg "[ GROUP FOUND 2&3 ]" 100
968                endif
969                pushlist msResponseList 3
970                pushlist msResponseList 4
971            else
972                //Unknown type pair -> Checkout
973                if msDebugMode > 0
974                    sysmsg "[ UNKNOWN TYPE PAIR ]" 100
975                    sysmsg "[ KEEPING ALL ]" 100
976                endif
977                pushlist msResponseList 2
978                pushlist msResponseList 3
979                pushlist msResponseList 4
980            endif
981        endif
982
983        //Always keep a jackpot creature
984        if msJackpotFound > 0 and not inlist msResponseList msJackpotFound
985            pushlist msResponseList msJackpotFound front
986        endif
987
988        //Runspeed management
989        if 0 = index
990            while not insysmsg "You must finish your current roll before playing again." and find localKeg ground -1 -1 2 and not insysmsg! "You are out of funds."
991                gumpresponse 6 msGumpID
992                waitforgump msGumpID 20000
993            endwhile
994            wait globalWaitForServerResponse
995        elseif 1 = index
996            while timer globalObjectDelayTimer < globalWaitForObjectDelay
997            endwhile
998            dclick localKeg
999            settimer globalObjectDelayTimer 0
1000            settimer globalSafetyTimer 0
1001            waitforgump msGumpID 20000
1002            wait globalWaitForServerResponse
1003        endif
1004
1005    endfor
1006
1007    if not gumpexists msGumpID or not find localKeg ground -1 -1 2 or insysmsg! "You are out of funds."
1008        break
1009    endif
1010
1011    if msDebugMode > 0
1012        foreach localCreature in msFoundCreatureList
1013            if 2 < index
1014                break
1015            endif
1016            sysmsg "... {{index}}: {{localCreature}}" 100
1017            if list msFoundCreatureList = 1
1018                sysmsg "... 2: {{localCreature}}" 100
1019                sysmsg "... 3: {{localCreature}}" 100
1020                break
1021            elseif 1 = index and list msFoundCreatureList = 2
1022                sysmsg "... 3: unknown" 100
1023                break
1024            endif
1025        endfor
1026        sysmsg "... 1st set: {{msDebugTimer}} ms" 100
1027        if msAutoResolve > 0
1028            wait msShowResultDuration
1029        endif
1030    endif
1031    
1032    if msAutoResolve > 0
1033        if list msResponseList > 0
1034            while timer globalSafetyTimer < 2000
1035                //wait until 2 s auto gump refresh is done, or we may lose some already executed selections
1036            endwhile
1037            getlabel backpack waitForPing
1038            foreach localGumpButton in msResponseList
1039                if 0 = localGumpButton
1040                    overhead "▷▷ PLAYER NEEDED! ◁◁" 2760
1041                    overhead "▷▷ SCRIPT STOPPED ◁◁" 2760
1042                    sysmsg "▷▷ PLAYER NEEDED! ◁◁" 2760
1043                    sysmsg "▷▷ SCRIPT STOPPED ◁◁" 2760
1044                    stop
1045                endif
1046                gumpresponse localGumpButton msGumpID
1047                waitforgump msGumpID globalWaitForServerResponse
1048            endfor
1049            if list msResponseList > 0 and not ingump "Keep" 1312641219
1050                //Auto gump refresh hit us hard
1051                overhead "▶▶ GUMP ERROR ◀◀" 1680
1052                overhead "▶▶ SCRIPT STOPPED ◀◀" 1680
1053                sysmsg "▶▶ GUMP ERROR ◀◀" 1680
1054                sysmsg "▶▶ SCRIPT STOPPED ◀◀" 1680
1055            endif
1056        endif
1057        gumpresponse 5 msGumpID
1058        waitforgump msGumpID globalWaitForServerResponse
1059        dclick localKeg
1060        settimer globalObjectDelayTimer 0
1061        waitforgump msGumpID 20000
1062    else
1063        overhead "[Press -RESOLVE- to Continue]" 90
1064        sysmsg "[Manual Mode: Awaiting RESOLVE Press]" 90
1065    endif
1066    clearlist msResponseList
1067
1068    //Wait for game to finish
1069    settimer globalSafetyTimer 1000
1070    while find localKeg ground -1 -1 2 and not ingump "Roll!" 1312641219
1071        if msAutoResolve > 0 and timer globalSafetyTimer > 1000
1072            gumpresponse 5 msGumpID
1073            waitforgump msGumpID globalWaitForServerResponse
1074            while timer globalObjectDelayTimer < globalWaitForObjectDelay
1075            endwhile
1076            dclick localKeg
1077            settimer globalObjectDelayTimer 0
1078            settimer globalSafetyTimer 0
1079        elseif msAutoResolve = 0 and not ingump "Resolve" 1312641219
1080            while timer globalObjectDelayTimer < globalWaitForObjectDelay
1081            endwhile
1082            dclick localKeg
1083            settimer globalObjectDelayTimer 0
1084        endif
1085        waitforgump msGumpID globalWaitForServerResponse
1086    endwhile
1087
1088    if ingump "You have won" 1312641219
1089        overhead "◆◆ YOU HAVE WON! ◆◆" 2884
1090        if msDebugMode > 0
1091            sysmsg "... Game won: {{msDebugTimer}} ms" 2884
1092        endif
1093    else
1094        overhead "◈◈ NO MATCHES ◈◈" 52
1095        if msDebugMode > 0
1096            sysmsg "... Game lost: {{msDebugTimer}} ms" 50
1097        endif
1098    endif
1099
1100    //User defined wait between rolls
1101    wait msShowResultDuration
1102
1103endwhile
1104
1105if not findtype 3711 ground -1 -1 2
1106    overhead "▶▶ NO GAME FOUND ◀◀" 1680
1107    sysmsg "▶▶ NO GAME FOUND ◀◀" 1680
1108elseif insysmsg "You are out of funds."
1109    if msAutoAddFunds > 0
1110        overhead "▶▶ ADDING GOLD ◀◀" 52
1111        sysmsg "▶▶ ADDING GOLD ◀◀" 52
1112        gumpresponse 7 msGumpID
1113        waitforgump msGumpID globalWaitForServerResponse
1114        replay
1115    else
1116        overhead "▶▶ NO GOLD ◀◀" 1680
1117        sysmsg "▶▶ NO GOLD ◀◀" 1680
1118    endif
1119endif
1120
1121overhead "▶▶ SCRIPT STOPPED ◀◀" 1680
1122sysmsg "▶▶ SCRIPT STOPPED ◀◀" 1680