Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.24 KB | None | 0 0
  1. #Moonmage Training Setup Menu
  2.  
  3. #debug 10
  4.  
  5. ##Guild Verification
  6. GuildCheck:
  7. action (guild) var guild $1 when Guild: (\w+|\w+\s+\w+)$
  8. action (guild) on
  9. send info
  10. waitfor Debt
  11. action (guild) off
  12. if !(%guild = Moon Mage) then
  13. {
  14. echo You're not a Moon Mage. You can't use this script.
  15. exit
  16. }
  17.  
  18. Setup:
  19. if matchre("$scriptlist", "mm_train.cmd") then put #script pause mm_train
  20. if !def("MM_IS_SETUP") then
  21. {
  22. echo This is your first time running the Moon Mage Training script.
  23. echo All training sections are set to ON by default.
  24. echo Toggle for the Time Tracker Plugin and Prediction Interpretor are OFF by Default.
  25. echo These may be toggled ON under the Astrology menu.
  26. echo To toggle a section OFF, click the menu for the section then click the 'Train' link.
  27. echo Please set values for variables in all sections.
  28. put #var MM_TRAIN_MAGIC ON
  29. put #var MM_TRAIN_ASTROLOGY ON
  30. put #var MM_TRAIN_MECH ON
  31. put #var MM_TRAIN_FORAGE ON
  32. put #var MM_TRAIN_JUGGLE ON
  33. put #var MM_PREDICT_INTERPRET OFF
  34. put #var MM_USE_HARNESS ON
  35. put #var MM_USE_CAMBRINTH ON
  36. put #var MM_TT_PLUGIN OFF
  37.  
  38. ##Moonmage Triggers for Moon states.
  39. put #trigger {^Katamba is a.+moon and is not visible\.} {#var moonKatamba Down;#parse @Update Moons}
  40. put #trigger {^Katamba is nowhere to be seen\.} {#var moonKatamba Down;#parse @Update Moons}
  41. put #trigger {^Katamba sets, slowly dropping below the horizon\.} {#var moonKatamba Down;#parse @Update Moons}
  42. put #trigger {^Katamba slowly rises above the horizon\.} {#var moonKatamba Up;#parse @Update Moons}
  43. put #trigger {^Set within the black disc of the.+is the image} {#var moonKatamba Up;#parse @Update Moons}
  44. put #trigger {^Set within the black disc of the.+is the outline} {#var moonKatamba Down;#parse @Update Moons}
  45. put #trigger {^Set within the blue disc of the.+is the image} {#var moonXibar Up;#parse @Update Moons}
  46. put #trigger {^Set within the blue disc of the.+is the outline} {#var moonXibar Down;#parse @Update Moons}
  47. put #trigger {^Set within the red disc of the.+is the image} {#var moonYavash Up;#parse @Update Moons}
  48. put #trigger {^Set within the red disc of the.+is the outline} {#var moonYavash Down;#parse @Update Moons}
  49. put #trigger {^Xibar is a.+moon and is not visible\.} {#var moonXibar Down;#parse @Update Moons}
  50. put #trigger {^Xibar is nowhere to be seen\.} {#var moonXibar Down;#parse @Update Moons}
  51. put #trigger {^Xibar sets, slowly dropping below the horizon\.} {#var moonXibar Down;#parse @Update Moons}
  52. put #trigger {^Xibar slowly rises above the horizon\.} {#var moonXibar Up;#parse @Update Moons}
  53. put #trigger {^Yavash is a.+moon and is not visible\.} {#var moonYavash Down;#parse @Update Moons}
  54. put #trigger {^Yavash is nowhere to be seen\.} {#var moonYavash Down;#parse @Update Moons}
  55. put #trigger {^Yavash sets, slowly dropping below the horizon\.} {#var moonYavash Down;#parse @Update Moons}
  56. put #trigger {^Yavash slowly rises above the horizon\.} {#var moonYavash Up;#parse @Update Moons}
  57. put #trigger {^You're certain that Katamba is} {#var moonKatamba Up;#parse @Update Moons}
  58. put #trigger {^You're certain that Xibar is} {#var moonXibar Up;#parse @Update Moons}
  59. put #trigger {^You're certain that Yavash is} {#var moonYavash Up;#parse @Update Moons}
  60. put #trigger {by a miniature luminescent version of the moon Katamba\.} {#var moonKatamba Up;#var moonYavash Down;#var moonXibar Down;#parse @Update Moons}
  61. put #trigger {by a miniature luminescent version of the moon Xibar\.} {#var moonXibar Up;#var moonKatamba Down;#var moonYavash Down;#parse @Update Moons}
  62. put #trigger {by a miniature luminescent version of the moon Yavash\.} {#var moonYavash Up;#var moonKatamba Down;#var moonXibar Down;#parse @Update Moons}
  63. put #trigger {by three miniature luminescent versions of the moons Katamba, xibar, and Yavash\.} {#var moonKatamba Up;#var moonYavash Up;#var moonXibar Up;#parse @Update Moons}
  64. put #trigger {by three miniature luminescent versions of the moons Katamba, Yavash, and Xibar\.} {#var moonKatamba Up;#var moonYavash Up;#var moonXibar Up;#parse @Update Moons}
  65. put #trigger {by three miniature luminescent versions of the moons Xibar, Katamba, and Yavash\.} {#var moonKatamba Up;#var moonYavash Up;#var moonXibar Up;#parse @Update Moons}
  66. put #trigger {by three miniature luminescent versions of the moons Xibar, Yavash, and Katamba\.} {#var moonKatamba Up;#var moonYavash Up;#var moonXibar Up;#parse @Update Moons}
  67. put #trigger {by three miniature luminescent versions of the moons Yavash, Katamba, and Xibar\.} {#var moonKatamba Up;#var moonYavash Up;#var moonXibar Up;#parse @Update Moons}
  68. put #trigger {by three miniature luminescent versions of the moons Yavash, Xibar, and Katamba\.} {#var moonKatamba Up;#var moonYavash Up;#var moonXibar Up;#parse @Update Moons}
  69. put #trigger {by three translucent spheres that seem to drift about without purpose or reason\.} {#var moonKatamba Down;#var moonYavash Down;#var moonXibar Down;#parse @Update Moons}
  70. put #trigger {by two miniature luminescent versions of the moons Katamba and Xibar\.} {#var moonXibar Up;#var moonKatamba Up;#var moonYavash Down;#parse @Update Moons}
  71. put #trigger {by two miniature luminescent versions of the moons Katamba and Yavash\.} {#var moonYavash Up;#var moonKatamba Up;#var moonXibar Down;#parse @Update Moons}
  72. put #trigger {by two miniature luminescent versions of the moons Xibar and Katamba\.} {#var moonXibar Up;#var moonKatamba Up;#var moonYavash Down;#parse @Update Moons}
  73. put #trigger {by two miniature luminescent versions of the moons Xibar and Yavash\.} {#var moonXibar Up;#var moonYavash Up;#var moonKatamba Down;#parse @Update Moons}
  74. put #trigger {by two miniature luminescent versions of the moons Yavash and Katamba\.} {#var moonYavash Up;#var moonKatamba Up;#var moonXibar Down;#parse @Update Moons}
  75. put #trigger {by two miniature luminescent versions of the moons Yavash and Xibar\.} {#var moonXibar Up;#var moonYavash Up;#var moonKatamba Down;#parse @Update Moons}
  76. }
  77. var MAIN Magic|Astrology|Extra|Done
  78. var ASTROLOGY Train Astrology|CV Prep|PG Prep|Divination Tool|Deal Times|TT Plugin|Predict Interpret|Wait Mode|Wait Script|Back
  79. var MAGIC Train Magic|Warding Spell|Warding Prep|Augmentation Spell|Augmentation Prep|Utility Spell|Utility Prep|Harness|Use Harness|Cambrinth|Charge|Use Cambrinth|Back
  80. var EXTRA Train Mech|Mech Material|Train Forage|Collect Item|Train Juggle|Jugglie|Back
  81. var TOGGLES TRAIN|PREDICT|USE|PLUGIN
  82. var MENU_WINDOW Moonmage Training Menu
  83. var CV_PREP_DESC This is the mana amount to prepare the Clear Vision Spell during the Astrology section.
  84. var PG_PREP_DESC This is the mana amount to prepare the Piercing Gaze Spell during the Astrology section.
  85. var DIVINATION_TOOL_DESC This is the method used to make predicitons. The standard form is 'visions'.
  86. var DEAL_TIMES_DESC This is how many cards to deal from your Tokka Deck for predicitons. Must be between 3 and 6.
  87. var TT_PLUGIN_DESC This toggles the script to utilize the Time and Moon Tracker plugin. Leave this to OFF if you do not have this plugin.
  88. var PREDICT_INTERPRET_DESC This toggles the optional Prediction Interpreter code ON or OFF. To utilize this, you must have the file downloaded and set to be included in the Includes section of the script.
  89. var WAIT_MODE_DESC This sets an option to perform other various tasks during the cooldown on observations. The current options are: juggle (practices with juggling), sigil (studies sigils in sigilbooks- Must have a book with sigils scribed!) and script (must set the 'Wait Script' variable!).
  90. var WAIT_SCRIPT_DESC This is the name (note the filename ONLY) of the script to run during the observation cooldown.
  91. var WARDING_SPELL_DESC This spell will be used to train Warding. Possible spells are: Psychic Shield [psy], Cage of Light [col]
  92. var WARDING_PREP_DESC This is the mana amount to prepare the Warding Spell during the Magic section.
  93. var AUGMENTATION_SPELL_DESC This spell will be used to train Augmentation. Possible spells are: Clear Vision [cv], Piercing Gaze [pg], Aura Sight [aus], Tenebrous Sense [ts], Shadows, Seer's Sense [seer]
  94. var AUGMENTATION_PREP_DESC This is the mana amount to prepare the Augmentation Spell during the Magic section.
  95. var UTILITY_SPELL_DESC This spell will be used to train Utility. Possible spells are: Refractive Field [rf], Steps of Vaun [sov], Shadowing, Shadow Servant [ss], Contingency, Seer's Sense [seer]
  96. var UTILITY_PREP_DESC This is the mana amount to prepare the Utility Spell during the Magic section.
  97. var HARNESS_DESC This is the mana amount to harness before casting spells during the Magic section.
  98. var USE_HARNESS_DESC This toggles whether or not to utilize harnessed mana during the Magic section.
  99. var CAMBRINTH_DESC This is the noun of the cambrinth item you wish to use during the Magic section.
  100. var CHARGE_DESC This is the amount of mana to charge your cambrith item with during the Magic section.
  101. var USE_CAMBRINTH_DESC This toggles whether or not to utilize cambrinth during the Magic section.
  102. var TRAIN_MECH_DESC This toggles whether or not to train Mechanical Lore while other experience drains.
  103. var MECH_MATERIAL_DESC This is the material utilize for braiding during Mechanical Lore training, ie.: grass, vines, etc.
  104. var TRAIN_FORAGE_DESC This toggles whether to train Outdoorsmanship through collecting while other experience drains.
  105. var COLLECT_ITEM_DESC This is the material collected during Outdoorsmanship training. ie.: rock, branch, vine, etc.
  106. var TRAIN_JUGGLE_DESC This toggles whether to train Perception through juggline while other experience drains.
  107. var JUGGLIE_DESC This is the noun of the juggle item you wish to use to train Perception.
  108. put #var selection MAIN
  109.  
  110. pause 1
  111. echo
  112. echo ################
  113. put #echo cyan All typed user input MUST be preceeded by tilde (~) character.
  114. echo ################
  115.  
  116. MenuDisplay:
  117. var last.selection $selection
  118. counter set 0
  119. pause 0.3
  120. gosub Menu.Build "%$selection" "selection" "continue.script" "" "%MENU_WINDOW"
  121. waitforre continue.script
  122. put #var selection {#eval toupper("$selection")}
  123. if $selection = BACK then
  124. {
  125. put #var selection MAIN
  126. goto MenuDisplay
  127. }
  128. if $selection = DONE then gosub CheckVars "%MAGIC|%ASTROLOGY|%EXTRA"
  129. if ($selection = MAGIC || $selection = ASTROLOGY || $selection = EXTRA) then goto MenuDisplay
  130. if $selection = DIVINATION TOOL then
  131. {
  132. send #echo ">%this.window" cyan Possible values for $selection are:
  133. send #echo ">%this.window" cyan prism, bowl, mirror, deck, bones, chart, visions
  134. }
  135. put #var selection {#eval replacere("$selection", " ", "_")}
  136. gosub GlobalSet "%$selection_DESC"
  137.  
  138. CheckVars:
  139. var SETTABLES $1
  140. eval SETTABLES toupper("%SETTABLES")
  141. eval SETTABLES replacere("%SETTABLES", " ", "_")
  142. eval SET_AMOUNT count("%SETTABLES", "|")
  143. var UNSET
  144. if %c > %SET_AMOUNT then
  145. {
  146. if (count("%UNSET", "|") > 0) then
  147. {
  148. counter set 0
  149. eval UNSET replacere("%UNSET", "^|", "")
  150. eval UNSET_AMOUNT count("%UNSET", "|")
  151. eval UNSET replacere("%UNSET", "_", " ")
  152. put #echo cyan You are missing the following Globals. Please set them before continuing!
  153. goto Missing.Globals
  154. }
  155. put #var MM_IS_SETUP 1
  156. put #window remove "Moonmage Training Menu"
  157. put #echo cyan Script setup complete. Run default values with the command '.mm_train'
  158. put #echo cyan To run the setup again, run the command '.mm_train setup'
  159. if matchre("$scriptlist", "mm_train.cmd") then put #script resume mm_train
  160. exit
  161. }
  162. goto CheckGlobal
  163.  
  164. CheckGlobal:
  165. if !(def("MM_%SETTABLES(%c)") || (%SETTABLES(%c) = BACK)) then var UNSET %UNSET|%SETTABLES(%c)
  166. counter add 1
  167. if %c > %SET_AMOUNT then goto CheckVars
  168. goto CheckGlobal
  169.  
  170. Missing.Globals:
  171. put #echo lime %UNSET(%c)
  172. counter add 1
  173. if %c < %UNSET_AMOUNT then goto Missing.Globals
  174. put #var selection MAIN
  175. goto MenuDisplay
  176.  
  177. exit
  178.  
  179. Menu.Build:
  180. ##Menu Building Routine
  181. ##Function - Builds a numbered menu of options in link format that saves option information into a variable.
  182. ##pre - First parameter must be an array of the option names/values. Second parameter is the name of the
  183. ## target global variable to store the result of the link click. Third parameyer is a string
  184. ## that will be parsed to continue the script after the menu item has been selected. Fourth parameter
  185. ## is a string or array of items that are exceptions to be excluded from the menu list. Fifth parameter is a
  186. ## window name to echo output to (leave out to echo to Game window).
  187. ##post - Value of clicked link is stored in target global variable.
  188.  
  189. action (input) var input $1;put #parse input.done when ~(.*)
  190.  
  191. if !%c then
  192. {
  193. var this.array $1
  194. var target.variable $2
  195. var script.trigger $3
  196. var exceptions $4
  197. if !($5 = "") then
  198. {
  199. var this.window $5
  200. put #window add "%this.window"
  201. put #window open "%this.window"
  202. put #clear %this.window
  203. send #echo ">%this.window" cyan $selection Menu
  204. send #echo ">%this.window"
  205. }
  206. else var this.window Game
  207. var this.option 0
  208. eval array.length count("%this.array","|")
  209. }
  210. if %c > %array.length then
  211. {
  212. var this.option 0
  213. counter set 0
  214. return
  215. }
  216. var this.choice %this.array(%c)
  217. if matchre("%exceptions","%this.choice") then
  218. {
  219. counter add 1
  220. goto menu.build
  221. }
  222. counter add 1
  223. math this.option add 1
  224. send #link ">%this.window" "%this.option. - %this.choice" "#var %target.variable %this.choice;#parse %script.trigger"
  225. goto menu.build
  226.  
  227. GlobalSet:
  228. put #clear "%this.window"
  229. var extra_message $1
  230. action (input) on
  231. if matchre("$selection", "%TOGGLES") then goto TOGGLE
  232. if !(%extra_message = "") then put #echo ">%this.window" cyan %extra_message
  233. put #echo ">%this.window" cyan Enter value for $selection:
  234. waitforre input.done
  235. put #var MM_$selection %input
  236. action (input) off
  237. put #clear "%this.window"
  238. put #echo ">%this.window" cyan $selection has been set to: %input
  239. put #echo ">%this.window"
  240. send #link ">%this.window" "Click to continue..." "#parse %script.trigger"
  241. waitforre %script.trigger
  242. put #var selection %last.selection
  243. goto MenuDisplay
  244.  
  245. Toggle:
  246. if $MM_$selection = ON then var TOGGLE_TO OFF
  247. else var TOGGLE_TO ON
  248. action (input) on
  249. pause 0.3
  250. send #clear "%this.window"
  251. pause 0.3
  252. if !(%extra_message = "") then put #echo ">%this.window" cyan %extra_message
  253. send #echo ">%this.window" cyan Variable $selection is currently set to $MM_$selection.
  254. send #echo ">%this.window" cyan Do you want to change it to %TOGGLE_TO?
  255. send #echo ">%this.window"
  256. send #link ">%this.window" "Yes" "#clear >%this.window;#echo $selection has been set to %TOGGLE_TO;#var MM_$selection %TOGGLE_TO;#var selection %last.selection;#parse %script.trigger"
  257. send #link ">%this.window" "No" "#clear >%this.window;#echo No changes made, returning to menu.;#var selection %last.selection;#parse %script.trigger"
  258. waitforre %script.trigger
  259. put #clear "%this.window"
  260. send #link ">%this.window" "Click to continue..." "#parse %script.trigger"
  261. waitforre %script.trigger
  262. goto MenuDisplay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement