Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.08 KB | None | 0 0
  1. #Moon Mage training script. - Genie3 v6.0 BETA
  2. ##Change log:
  3. ## v1.0 : Initial release
  4. ## v1.x : Archived v1.1 - v1.6
  5. ## v2.x : Archived v2.0 - v2.8
  6. ## v3.x : Archived v3.0 - v3.16
  7. ## v4.x : Archived v4.0 - v4.10
  8. ## v5.x : Archived v5.0 - v5.31
  9. ## v6.0 : New version due to major script updates.
  10. ## Observable object lists updated and optimized.
  11. ## Script conversion to utilize Javascript array handling
  12. ## for better performance and exception handling.
  13. ## Added more documentation to better denote script sections.
  14. ## Fixed Pouchsort action for new messaging.
  15. ## Removed Prediction interpreter - may rebuild and add in later.
  16. ## Relocated all action definitions to the top of the script for
  17. ## consistency.
  18. ##
  19.  
  20. include js_arrays.js
  21.  
  22. #####Credits####
  23. ##Hervean
  24. ## :Power Perception routine - http://www.genieclient.com/bulletin/topic/3978-mm-power-looper/
  25. ## :Divination Bowl data
  26. ##
  27. ##DrtyPrior
  28. ## :Debugging help.
  29. ################
  30.  
  31. #debug 10
  32.  
  33. ##Guild Verification
  34. GuildCheck:
  35. action (guild) var guild $1 when Guild: (\w+|\w+\s+\w+)$
  36. action var circle $1 when Circle: (\d+)
  37. action (guild) on
  38. send info
  39. waitfor Debt
  40. action (guild) off
  41. if !(%guild = Moon Mage) then
  42. {
  43. echo You're not a Moon Mage. You can't use this script.
  44. exit
  45. }
  46.  
  47. ##First-run check
  48. if !def("MM_IS_SETUP") then goto Setup
  49.  
  50. if_1 then
  51. {
  52. var mode %1
  53. eval mode toupper("%mode")
  54. if matchre("%mode", "SET") then goto Setup
  55. echo Valid command line is '.mm_train setup'
  56. echo Script terminating.
  57. exit
  58. }
  59. goto ScriptStart
  60.  
  61. #######################
  62. ## Includes ##
  63. #######################
  64. # This section is for future add-ons that expand optional functions of the code
  65. # which do not affect the operation of the code itself.
  66.  
  67.  
  68. #############################
  69. ## Variables and Actions ##
  70. #############################
  71.  
  72. ScriptStart:
  73. ##Script variables
  74. ##Do NOT change these!!!
  75. var script.room $roomid
  76. var interp.action.once 0
  77. var is.recepticle 0
  78. var tool.broken 0
  79. var pouch.num first|second|third|fourth|fifth|sixth
  80. var magic.skip 1
  81. var juggle.skip 1
  82. var need.tele 0
  83. var no.tele 0
  84. var gem.pouch 0
  85. var gemempty 0
  86. var pouchplace 0
  87. var cambstow 0
  88. var mech.foragect 0
  89. var forage.ct 0
  90. var pg.known 0
  91. var cv.known 0
  92. var cv.active 0
  93. var pg.active 0
  94. var clear.sky 0
  95. var mechforagect 0
  96. var foragect 0
  97. var fullprep 0
  98. var toPower xibar|planets|trans|yavash|perc|katamba|moonl man|enlightened|psychic
  99. var totalPower 8
  100. var pp.counter 0
  101. var pouch.count 0
  102. var skip.forage 0
  103. var skip.mech 0
  104. var prep.override 0
  105. var need.moon 0
  106. var tool.check 0
  107. var offense Archer|Boar|Cat|Centaur|Er\'qutra|Estrilda|Mongoose|Panther|Scorpion|Shark|Spider|Szeldia|Triquetra|Viper|Wolverine
  108. var defense Albatross|Dawgolesh|Dove|Giant|Jackal|Katamba|Lion|Magpie|Merewalda|Penhetia|Raccoon|Vulture|Welkin
  109. var lore Amlothi|Brigantine|Cobra|Donkey|Hare|King Snake|Phoenix|Raven|Scales|Shardstar|Verena|Weasel|Xibar
  110. var magic Adder|Amlothi|Coyote|Durgaulda|Ismenia|Nightingale|Owl|Phoenix|Shrew|Toad|Wolf|Wren|Yavash
  111. var survival Cow|Dolphin|Goshawk|Heart|Heron|Morleena|Ox|Ram|Shark|Shrike|Sun|Unicorn|Yoakena
  112. var levels.spring 0|0|0|0|1|3|4|7|10|11|12|15|17|20|25|26|28|32|34|39|40|42|43|44|45|48|51|54|59|64|69|74|79|84|89
  113. var obs.spring Xibar|Yavash|Katamba|Heart|Wolf|Raven|Unicorn|Cobra|Wren|Cat|Ram|Wolverine|Magpie|Viper|Dove|Phoenix|Mongoose|Raccoon|Adder|Spider|Giant|Verena|Toad|Archer|Estrilda|Durgaulda|Yoakena|Penhetia|Szeldia|Merewalda|Ismenia|Morleena|Amlothi|Dawgolesh|Er\'qutra
  114. var levels.summer 0|0|0|0|1|3|5|8|11|12|14|15|17|19|20|26|27|30|32|33|34|36|38|39|40|41|42|43|45|47|48|49|51|54|59|64|69|74|79|84|89
  115. var obs.summer Xibar|Yavash|Katamba|Heart|Wolf|Raven|Boar|Ox|Cat|Ram|Shardstar|Centaur|Magpie|King Snake|Viper|Phoenix|Heron|Owl|Raccoon|Cow|Adder|Shrew|Jackal|Spider|Giant|Hare|Verena|Toad|Estrilda|Scales|Durgaulda|Triquetra|Yoakena|Penhetia|Szeldia|Merewalda|Ismenia|Morleena|Amlothi|Dawgolesh||Er\'qutra
  116. var levels.fall 0|0|0|0|1|2|3|6|8|11|14|15|17|18|19|20|23|26|30|31|35|36|37|39|40|42|43|45|47|48|51|54|59|64|69|74|79|84|89
  117. var obs.fall Xibar|Yavash|Katamba|Heart|Wolf|Lion|Raven|Panther|Ox|Cat|Nightingale|Centaur|Magpie|Weasel|King Snake|Viper|Donkey|Phoenix|Owl|Welkin|Vulture|Shrew|Shrike|Spider|Giant|Verena|Toad|Estrilda|Scales|Durgaulda|Yoakena|Penhetia|Szeldia|Merewalda|Ismenia|Morleena|Amlothi|Dawgolesh||Er\'qutra
  118. var levels.winter 0|0|0|0|1|3|4|11|13|14|14|17|18|20|21|22|24|26|29|31|37|39|40|42|43|45|46|48|51|54|59|64|69|74|79|84|89
  119. var obs.winter Xibar|Yavash|Katamba|Heart|Wolf|Raven|Unicorn|Cat|Dolphin|Nightingale|Wolverine|Magpie|Weasel|Viper|Albatross|Shark|Coyote|Phoenix|Goshawk|Welkin|Shrike|Spider|Giant|Verena|Toad|Estrilda|Brigantine||Durgaulda|Yoakena|Penhetia|Szeldia|Merewalda|Ismenia|Morleena|Amlothi|Dawgolesh|Er\'qutra
  120. var levels.day 0|0|0|0|42|45|48|51|54|59|64|69|74|79|84|89
  121. var obs.day Sun|Xibar|Yavash|Katamba|Verena|Estrilda|Durgaulda|Yoakena|Penhetia|Szeldia|Merewalda|Ismenia|Morleena|Amlothi|Dawgolesh||Er\'qutra
  122. var disposals bucket|bucket of viscous gloop|large stone turtle|disposal bin|waste bin|firewood bin|tree hollow|oak crate|ivory urn|pit|trash receptacle
  123. var disposal.extra trash |large stone |waste |firewood |tree |oak |ivory | of viscous gloop
  124. var dump.recepticle 0
  125.  
  126. put #var MM_DIVINATION_TOOL {#eval tolower("$MM_DIVINATION_TOOL")}
  127.  
  128. ##Script Actions
  129. action send get prism when As the sapphire prism swings to a halt you lose your grip
  130. action send get my $MM_CAMBRINTH when Remove what?
  131. action var cambstow $2 when from inside your (\S+|\S+\s+\w+)\.$
  132. action send put my $MM_CAMBRINTH in my %cambstow when You can't wear that\!$
  133. action var clear.sky 1 when clear sky|sky is clear
  134. action var clear.sky 1 when open sky
  135. action send 2 $lastcommand when ^\.\.\.wait|^Sorry, you may only type
  136. action var season $1 when It is currently (\w+)
  137. action var season $1 when It's currently (\w+)
  138. action (time) var time day when dawn|morning|noon|afternoon|midday
  139. action (time) var time night when sunrise|dusk|night|midnight|late night|sunset|evening
  140. action (spells) var pg.known 1 when Piercing Gaze
  141. action (spells) var cv.known 1 when Clear Vision
  142. action remove You strain
  143. action remove You have to strain
  144. action remove You strain, but
  145. action var cv.active 0 when You feel less aware of your environment\.$
  146. action var pg.active 0 when The world around you returns to its mundane appearance\.$
  147. action var hand.armor $1 when Your efforts are hindered by your \w+ (\w+)
  148. action var hand.armor $1 when Your efforts are hindered by your \w+ \w+ (\w+)
  149. action (pouchcheck) js doPush("pouchname","$1") when (\S+) pouch\.$
  150. action (gemcheck) var gemempty 1 when There is nothing in there.
  151. action (tool.check) tool.broken = 1 ; echo Divination tool broken! when referring
  152. action (new.tool) var tool.broken 0 when ^You tap
  153. action (new.tool) var $MM_DIVINATION_TOOL 0 when referring.
  154. action (warding) var prep.override 0;var need.moon 1 when ^@Update Moons
  155. action var need.moon 1 when You must specify one of the three|on the wrong side of Elanthia and is not visible
  156. action var PREDICT_WAIT OFF when sufficiently pondered
  157. action var fullprep 1 when You feel fully prepared
  158. action (tele.get) var telestow $1 when from inside your (\S+|\S+\s+\w+)\.$
  159. action (jugglecheck) var jugglestow $1 when $MM_JUGGLIE.* from inside your (\S+|\S+\s+\w+)\.$
  160. action (divin.get) var divinstow $1 when $MM_DIVINATION_TOOL.* from inside your (\S+|\S+\s+\w+)\.$
  161. action (checktied) var is_tied 1 when You tap a .* atop your
  162. action (checktied) var tied_to $1 when You remove a .* from your (.+)\.
  163.  
  164. action (pouchcheck) off
  165. action (gemcheck) off
  166. action (jugglecheck) off
  167. action (divin.get) off
  168. action (tool.check) off
  169. action (new.tool) off
  170. action (time) off
  171. action (spells) off
  172. action (warding) off
  173. action (tele.get) off
  174. action (checktied) off
  175.  
  176. #############################
  177. ## Main Script Body ##
  178. #############################
  179.  
  180. ##Initial Script Checks
  181. HandsEmptyChk:
  182. if $righthand = Empty then
  183. {
  184. if $lefthand = Empty then goto checks
  185. }
  186. echo ********************************************
  187. echo * Please empty hands and run script again. *
  188. echo ********************************************
  189. exit
  190.  
  191. Checks:
  192. if matchre("$roomobjs",("%disposals")) then
  193. {
  194. var is.recepticle 1
  195. var dump.recepticle $0
  196. eval dump.recepticle replacere("%dump.recepticle", "%disposal.extra", "")
  197. }
  198. action (spells) on
  199. pause 1
  200. send spells
  201. pause 0.5
  202. action (spells) off
  203. send observe weather
  204. pause 0.5
  205. goto pouchfind
  206.  
  207. PouchFind:
  208. action (pouchcheck) on
  209. pause 0.5
  210. put inv search pouch
  211. waitfor INVENTORY HELP
  212. action (pouchcheck) off
  213. if contains("%pouchname", "gem") = 0 then
  214. {
  215. Echo No gem pouch. Skipping appraisal.
  216. if_6 then goto jugglechk
  217. goto mainloop
  218. }
  219. var gem.pouch 1
  220. jscall pouchplace doXCompare("pouchname","pouch.num","gem")
  221.  
  222. OpenChk:
  223. match openpou is closed.
  224. match jugglechk nothing in
  225. match JuggleChk gem pouch
  226. action (gemcheck) on
  227. pause 1
  228. put look in my %pouchplace pou
  229. action (gemcheck) off
  230. matchwait
  231.  
  232. OpenPou:
  233. match jugglechk when has been tied
  234. match openchk ^You open
  235. put open my %pouchplace pou
  236. goto openchk
  237.  
  238. JuggleChk:
  239. if %gemempty = 1 then echo Your gem pouch is empty. Skipping appraisal. Get some gems!
  240. if $MM_TRAIN_JUGGLE = OFF then goto mainloop
  241. action (jugglecheck) on
  242. pause 0.5
  243. send take my $MM_JUGGLIE
  244. waitfor You get
  245. pause 0.5
  246. action (jugglecheck) off
  247. pause 3
  248. send put $MM_JUGGLIE in my %jugglestow
  249. put stow $MM_JUGGLIE
  250. pause
  251. MainLoop:
  252. pause 2
  253. #Magic Training Checks
  254. if $MM_TRAIN_MAGIC = ON then
  255. {
  256. if $Warding.LearningRate < 10 then gosub Magic.Start Warding
  257. if $Augmentation.LearningRate < 10 then gosub Magic.Start Augmentation
  258. if $Utility.LearningRate < 10 then gosub Magic.Start Utility
  259. if $Attunement.LearningRate < 10 then gosub pp.loop
  260. }
  261.  
  262. #Astrology Training Checks
  263. if $MM_TRAIN_ASTROLOGY = ON then
  264. {
  265. if %clear.sky = 1 then
  266. {
  267. if $Astrology.LearningRate < 10 then gosub astro.begin
  268. }
  269. if %clear.sky = 0 then
  270. {
  271. if %pg.active = 1 then
  272. {
  273. if $Astrology.LearningRate < 10 then gosub astro.begin
  274. }
  275. if %pg.active = 0 then
  276. {
  277. if $Astrology.LearningRate < 10 then
  278. {
  279. if %pg.known = 1 then
  280. {
  281. gosub PG
  282. }
  283. gosub astro.begin
  284. }
  285. }
  286. }
  287. }
  288.  
  289. #Supplementary Training Checks
  290. if %gem.pouch then
  291. {
  292. if %gemempty = 0 then
  293. {
  294. if $Appraisal.LearningRate < 34 then gosub appraisal
  295. }
  296. }
  297. if $MM_TRAIN_JUGGLE = ON then
  298. {
  299. if $Perception.LearningRate < 34 then gosub juggle
  300. }
  301. if $MM_TRAIN_MECH = ON then
  302. {
  303. if $Mechanical_Lore.LearningRate < 34 then gosub mech.forage
  304. }
  305. if $MM_TRAIN_FORAGE = ON then
  306. {
  307. if $Outdoorsmanship.LearningRate < 34 then gosub forage.learn
  308. }
  309.  
  310. pause 2
  311. goto mainloop
  312. exit
  313.  
  314. ##Magic section
  315. Magic.Start:
  316. var EXP_TYPE $1
  317. var moon
  318. var prep.override 0
  319. var need.moon 0
  320. eval spell.type toupper("%EXP_TYPE")
  321.  
  322. Prepare:
  323. gosub manacheck
  324. if %prep.override = 0 then send prepare $MM_%spell.type_SPELL $MM_%spell.type_PREP
  325. else send prepare psy $MM_%spell.type_PREP
  326. if $MM_USE_CAMBRINTH = ON then gosub getcamb
  327. matchre cast You are already preparing|You feel fully prepared
  328. match wait You have to strain
  329. if %fullprep = 1 then
  330. {
  331. send #parse You feel fully prepared
  332. }
  333. matchwait
  334.  
  335. GetCamb:
  336. if $righthand = Empty then send remove my $MM_CAMBRINTH
  337. pause 0.5
  338. gosub charge
  339. return
  340.  
  341. Charge:
  342. pause 1
  343. send charge my $MM_CAMBRINTH $MM_CHARGE
  344. pause
  345. pause 1
  346. send invoke my $MM_CAMBRINTH
  347. pause .5
  348. return
  349.  
  350. Harness:
  351. if $MM_HARNESS < 1 then return
  352. pause .5
  353. match manawait You strain,
  354. send harness $MM_HARNESS
  355. matchwait 2
  356. pause .5
  357. return
  358.  
  359. Cast:
  360. pause .5
  361. if $MM_USE_HARNESS = ON then gosub harness
  362. pause .5
  363. match wait You are unable to harness
  364. match prepare You don't have a spell
  365. match magic.exp You gesture
  366. send cast %moon
  367. var fullprep 0
  368. matchwait
  369.  
  370. Set.Moon:
  371. if $moonKatamba = Up then
  372. {
  373. action (warding) off
  374. var moon Katamba
  375. var need.moon 0
  376. goto cast
  377. }
  378. if $moonYavash = Up then
  379. {
  380. action (warding) off
  381. var moon Yavash
  382. var need.moon 0
  383. goto cast
  384. }
  385. if $moonXibar = Up then
  386. {
  387. action (warding) off
  388. var moon Xibar
  389. var need.moon 0
  390. goto cast
  391. }
  392. var prep.override 1
  393. action (warding) on
  394. goto prepare
  395.  
  396. ManaCheck:
  397. if $mana < 20 then gosub manawait
  398. return
  399.  
  400. ManaWait:
  401. pause .5
  402. send release
  403. echo
  404. echo Waiting for mana.
  405. echo
  406. pause 120
  407. return
  408.  
  409. Magic.Exp:
  410. gosub clear
  411. if $%EXP_TYPE.LearningRate = 34 then
  412. {
  413. send wear my $MM_CAMBRINTH
  414. wait
  415. gosub clear
  416. goto mainloop
  417. }
  418. if %need.moon = 1 then goto set.moon
  419. goto prepare
  420.  
  421. ##Power Perception section
  422. PP.Loop:
  423. if (%pp.counter > %totalPower) then math pp.counter set 0
  424. gosub do.Power
  425. math pp.counter add 1
  426. if $Attunement.LearningRate = 34 then return
  427. goto pp.loop
  428.  
  429. Do.Power:
  430. send power %toPower(%pp.counter)
  431. waitforre ^Roundtime
  432. return
  433.  
  434. ##Astrology section
  435. Astro.Begin:
  436. if %cv.active = 0 then
  437. {
  438. if %cv.known = 1 then gosub cv
  439. }
  440. action (time) on
  441. send time
  442. pause 1
  443. action (time) off
  444. var obs.night %obs.%season
  445. var obs.levels %levels.%season
  446. eval obs.count count("%obs.night","|'")
  447. var astro.count 0
  448. if ((%tool.check = 0) && !($MM_DIVINATION_TOOL = "visions")) then gosub check.tool
  449. if $MM_TT_PLUGIN = ON then
  450. {
  451. if $Time.isDay = 0 then goto pred.night
  452. goto pred.day
  453. }
  454. goto pred.%time
  455.  
  456. Pred.Day:
  457. eval obs.count count("%obs.day","|")
  458. if %astro.count > %obs.count then var astro.count 0
  459. eval this.level element("%obs.levels", "%astro.count")
  460. if %circle < %this.level then
  461. {
  462. var astro.count 0
  463. goto pred.day
  464. }
  465. eval this.obs element("%obs.day", "%astro.count")
  466. if $MM_TT_PLUGIN = ON then
  467. {
  468. if matchre("Xibar|Katamba|Yavash", "%this.obs") then
  469. {
  470. if $Time.is%this.obsUp = 0 then
  471. {
  472. math astro.count add 1
  473. goto pred.day
  474. }
  475. }
  476. }
  477. gosub obs %this.obs
  478. goto pred.day
  479.  
  480. Pred.Night:
  481. if %astro.count > %obs.count then var astro.count 0
  482. eval this.level element("%obs.levels", "%astro.count")
  483. if %circle < %this.level then
  484. {
  485. var astro.count 0
  486. goto pred.night
  487. }
  488. eval this.obs element("%obs.%season", "%astro.count")
  489. if $MM_TT_PLUGIN = ON then
  490. {
  491. if matchre("Xibar|Katamba|Yavash", "%this.obs") then
  492. {
  493. if $Time.is%this.obsUp = 0 then
  494. {
  495. math astro.count add 1
  496. goto pred.night
  497. }
  498. }
  499. }
  500. if %circle > %this.level then
  501. {
  502. if $righthandnoun = telescope then
  503. {
  504. var need.tele 0
  505. send close my tele
  506. send put my tele in my %telestow
  507. }
  508. gosub obs
  509. goto pred.night
  510. }
  511. var astro.count 0
  512. goto pred.night
  513.  
  514. Obs:
  515. match need.pg Clouds obscure the sky
  516. match get.tele is too faint for you to pick out with your naked eye.
  517. matchre predict You learned something useful|predict from your observation|Although you don't gain a complete view of the future|Too many futures cloud your mind - you learn nothing|you still learned from your observation|you still learned
  518. matchre obs You see nothing regarding the future
  519. matchre next.obs You learn nothing of the future
  520. match astro.begin is foiled by
  521. matchre return You are unable to make use of this latest observation|fruitless|I could not find what you are referring to|no telescope
  522. if %need.tele = 1 then
  523. {
  524. if %no.tele = 1 then
  525. {
  526. math astro.count add 1
  527. echo You have no telescope. Skipping.
  528. return
  529. }
  530. else
  531. {
  532. action (tele.get) off
  533. if !%tele.open then send open my tele
  534. var tele.open 1
  535. pause 1
  536. send center my tele on %this.obs
  537. pause 1
  538. send peer my tele
  539. math astro.count add 1
  540. }
  541. }
  542. if %need.tele = 0 then
  543. {
  544. math astro.count add 1
  545. send obs %this.obs in the sky
  546. }
  547. matchwait
  548.  
  549. Next.Obs:
  550. math astro.count add 1
  551. goto pred.%time
  552.  
  553. Need.PG:
  554. var clear.sky = 0
  555. if %pg.known = 1 then
  556. {
  557. gosub PG
  558. goto obs
  559. }
  560. else
  561. {
  562. echo Too cloudy, learn PG!
  563. goto mainloop
  564. }
  565.  
  566. Get.Tele:
  567. var need.tele 1
  568. if %no.tele = 0 then
  569. {
  570. pause 0.5
  571. var tele.open 0
  572. action (tele.get) on
  573. pause 0.5
  574. match obs telescope
  575. match missingtele What were you referring
  576. send get my tele
  577. matchwait
  578. }
  579. if %no.tele = 1 then
  580. return
  581.  
  582. MissingTele:
  583. var no.tele 1
  584. return
  585.  
  586. Predict:
  587. if %need.tele = 1 then
  588. {
  589. send close my tele
  590. pause 1
  591. send put tele in my %telestow
  592. pause 1
  593. var need.tele 0
  594. var tele.open 0
  595. }
  596. if contains("%offense", "%this.obs") then
  597. {
  598. var predict.type offense
  599. goto predict.do
  600. }
  601. if contains("%defense", "%this.obs") then
  602. {
  603. var predict.type defense
  604. goto predict.do
  605. }
  606. if contains("%lore", "%this.obs") then
  607. {
  608. var predict.type lore
  609. goto predict.do
  610. }
  611. if contains("%magic", "%this.obs") then
  612. {
  613. var predict.type magic
  614. goto predict.do
  615. }
  616. if contains("%survival", "%this.obs") then
  617. {
  618. var predict.type survival
  619. goto predict.do
  620. }
  621.  
  622. Predict.do:
  623. if $MM_DIVINATION_TOOL = visions then
  624. {
  625. send align %predict.type
  626. pause 1
  627. matchre checkstun (After a few moments, the mists of time begin to part|The future, however, remains a dark mystery to you|Suddenly your mind receives a numbing jolt)
  628. send predict future $charactername %predict.type
  629. matchwait
  630. }
  631. action (tool.check) on
  632. action (divin.get) on
  633. pause 1
  634. if %is_tied then put untie my $MM_DIVINATION_TOOL
  635. else put get my $MM_DIVINATION_TOOL
  636. if !%tool.broken then waitforre ^You get
  637. else gosub new.tool
  638. pause 1
  639. action (divin.get) off
  640. eval predict.type tolower("%predict.type")
  641. send align %predict.type
  642. waitforre ^You focus internally
  643. send kneel
  644. waitforre ^You kneel
  645. if matchre("$MM_DIVINATION_TOOL", "bone") then
  646. {
  647. send roll bone at $charactername
  648. }
  649. if matchre("$MM_DIVINATION_TOOL", "prism") then
  650. {
  651. send raise prism
  652. }
  653. if matchre("$MM_DIVINATION_TOOL", "bowl|mirror") then
  654. {
  655. send gaze my $MM_DIVINATION_TOOL
  656. }
  657. if matchre("$MM_DIVINATION_TOOL", "chart") then
  658. {
  659. send review my $MM_DIVINATION_TOOL
  660. }
  661. if matchre("$MM_DIVINATION_TOOL", "deck") then
  662. {
  663. send shuffle my $MM_DIVINATION_TOOL
  664. waitforre ^Roundtime
  665. send cut my $MM_DIVINATION_TOOL
  666. pause 1
  667. send deal my $MM_DIVINATION_TOOL $MM_DEAL_TIMES
  668. }
  669. pause 1
  670. action (tool.check) off
  671. send stand
  672. waitforre ^You stand
  673. if %is_tied then put tie my $MM_DIVINATION_TOOL to my %tied_to
  674. else put stow my $MM_DIVINATION_TOOL
  675. pause 1
  676. goto checkstun
  677.  
  678. New.Tool:
  679. if %tool.broken = 1 then
  680. {
  681. action (new.tool) on
  682. pause 1
  683. send tap my $MM_DIVINATION_TOOL
  684. pause 1
  685. action (new.tool) off
  686. }
  687. goto Check.Tool
  688.  
  689. Check.Tool:
  690. action (checktied) on
  691. pause 0.5
  692. send tap my $MM_DIVINATION_TOOL
  693. if %is_tied then put untie my $MM_DIVINATION_TOOL
  694. else put get my $MM_DIVINATION_TOOL
  695. action (checktied) off
  696. match bond.tool inert
  697. match tool.checked investiture
  698. put analyze my $MM_DIVINATION_TOOL
  699. matchwait
  700.  
  701. Bond.Tool:
  702. send invoke my $MM_DIVINATION_TOOL
  703. pause
  704. pause 1
  705. var tool.check 1
  706. if %is_tied then put tie my $MM_DIVINATION_TOOL to my %tied_to
  707. else put stow my $MM_DIVINATION_TOOL
  708. return
  709.  
  710. Tool.Checked:
  711. var tool.check 1
  712. if %is_tied then put tie my $MM_DIVINATION_TOOL to my %tied_to
  713. else put stow my $MM_DIVINATION_TOOL
  714. return
  715.  
  716. checkstun:
  717. if $stunned = yes then gosub stunned
  718. gosub clear
  719. if $Astrology.LearningRate > 33 then
  720. {
  721. gosub clear
  722. goto mainloop
  723. }
  724. if (%aus.known = 1 && %aus.active = 0) then gosub AUS
  725. if %tt.plugin = 1 then
  726. {
  727. send predict analyze
  728. pause
  729. pause 1
  730. var PREDICT_WAIT ON
  731. gosub predict_wait
  732. if $Time.isDay = 0 then goto pred.night
  733. goto pred.day
  734. }
  735. send predict analyze
  736. pause
  737. pause 1
  738. var PREDICT_WAIT ON
  739. pause 1
  740. gosub predict_wait
  741. goto pred.%time
  742.  
  743. Predict_Wait:
  744. if %PREDICT_WAIT = OFF then
  745. {
  746. if matchre("$MM_WAIT_MODE", "script") then put #script abort $MM_WAIT_SCRIPT
  747. if matchre("$righthand", "sigilbook") then put close my sigilbook
  748. pause 0.5
  749. put stow my $righthand
  750. put stow my $lefthand
  751. return
  752. }
  753. if matchre("$MM_WAIT_MODE", "juggle") then
  754. {
  755. if $righthand = Empty then send get my %jugglie
  756. send juggle my %jugglie
  757. pause
  758. pause 0.5
  759. goto Predict_Wait
  760. }
  761. if matchre("$MM_WAIT_MODE", "sigil") then
  762. {
  763. if $righthand = Empty then send get my sigilbook
  764. pause 0.5
  765. match Predict_Wait sigil of some
  766. matchre Turn_Sigil sigil of the|completely blank
  767. match Open_Sigil closed
  768. put read my sigilbook
  769. matchwait
  770. }
  771. if matchre("$MM_WAIT_MODE", "script") then
  772. {
  773. send .$MM_WAIT_SCRIPT
  774. waitforre sufficiently pondered
  775. goto Predict_Wait
  776. }
  777.  
  778. Open_Sigil:
  779. put open my sigilbook
  780. goto Predict_Wait
  781.  
  782. Turn_Sigil:
  783. put turn my sigilbook
  784. pause 1
  785. goto Predict_Wait
  786.  
  787. ##PG/CV casting
  788. PG:
  789. put prep PG $MM_PG_PREP
  790. waitfor fully prepared
  791. put cast
  792. var pg.active 1
  793. pause 0.5
  794. return
  795.  
  796. CV:
  797. put prep CV $MM_CV_PREP
  798. waitfor fully prepared
  799. put cast
  800. var cv.active 1
  801. pause 0.5
  802. return
  803.  
  804. ##Supplementary Skills section
  805. ##Appraisal secion
  806. Appraisal:
  807. wait
  808. pause 1
  809. send open my %pouchplace pouch
  810. wait
  811. pause 1
  812. send app my %pouchplace pouch
  813. wait
  814. pause 1
  815. send app my %pouchplace pouch
  816. wait
  817. pause 1
  818. send close my %pouchplace pouch
  819. wait
  820. pause 1
  821. return
  822.  
  823. ##Juggle section
  824. Juggle:
  825. if $righthand = Empty then
  826. {
  827. send get my $MM_JUGGLIE
  828. }
  829. pause 1
  830. send juggle my $MM_JUGGLIE
  831. waitforre ^Roundtime
  832. pause
  833. pause 1
  834. send juggle my $MM_JUGGLIE
  835. waitforre ^Roundtime
  836. pause
  837. pause 1
  838. send juggle my $MM_JUGGLIE
  839. waitforre ^Roundtime
  840. pause
  841. pause 1
  842. send put $MM_JUGGLIE in my %jugglestow
  843. put stow $MM_JUGGLIE
  844. return
  845.  
  846. ##Foraging Section
  847. Forage.Learn:
  848. if (%skip.forage = 1 && $roomid = %script.room) then return
  849. else
  850. {
  851. var skip.forage 0
  852. var script.room $roomid
  853. }
  854. pause
  855. pause 1
  856. if %forage.ct > 3 then
  857. {
  858. echo No $MM_COLLECT_ITEM to forage here. Skipping.
  859. var skip.forage 1
  860. return
  861. }
  862. match kick manage to collect
  863. match forage.fail Roundtime:
  864. send collect $MM_COLLECT_ITEM
  865. matchwait
  866. return
  867.  
  868. Forage.Fail:
  869. math foragect add 1
  870. Echo Foraging failed attempt #%foragect
  871. goto forage.learn
  872.  
  873. Kick:
  874. pause
  875. pause 1
  876. send kick $MM_COLLECT_ITEM
  877. return
  878.  
  879. ##Mech Section
  880. Mech.Forage:
  881. if (%skip.mech = 1 && $roomid = %script.room) then return
  882. else
  883. {
  884. var skip.mech 0
  885. var script.room $roomid
  886. }
  887. pause 1
  888. if contains("$righthand", "$MM_JUGGLIE") then
  889. {
  890. send put $MM_JUGGLIE in my %jugglestow
  891. put stow $MM_JUGGLIE
  892. }
  893. pause
  894. pause 1
  895. if %mech.foragect > 2 then
  896. {
  897. echo No $MM_MECH_MAT to forage here. Skipping.
  898. var skip.mech 1
  899. return
  900. }
  901. match mech.braid You manage to find some grass.
  902. match mech.forageadd Roundtime:
  903. put forage $MM_MECH_MATERIAL
  904. matchwait
  905.  
  906. Mech.ForageAdd:
  907. math mech.foragect add 1
  908. goto mech.forage
  909.  
  910. Mech.Braid:
  911. pause 1
  912. match rem.armor Your efforts are hindered by your
  913. match mech.forage You need to have more material
  914. match mech.pull mistake
  915. match mech.dump wasted effort.
  916. match mech.braid Roundtime:
  917. send braid my $MM_MECH_MATERIAL
  918. matchwait
  919.  
  920. Rem.Armor:
  921. pause 1
  922. send remove my %hand.armor
  923. pause 2
  924. send stow my %hand.armor
  925. pause 2
  926. goto mech.braid
  927.  
  928. Mech.Pull:
  929. pause 1
  930. match mech.forage You need to have more material
  931. match mech.braid for your work so far
  932. matchre mech.dispose rope|You tug|breaks apart
  933. send pull my $MM_MECH_MATERIAL
  934. matchwait
  935.  
  936. Mech.Dispose:
  937. pause
  938. pause 1
  939. if %dump.recepticle = 0 then send drop rope
  940. else send put rope in %dump.recepticle
  941. waitforre ^You
  942. return
  943.  
  944. Mech.Dump:
  945. pause
  946. pause 1
  947. if %dump.recepticle = 0 then send drop $MM_MECH_MATERIAL
  948. else send put $MM_MECH_MATERIAL in %dump.recepticle
  949. waitforre ^You
  950. return
  951.  
  952. Return:
  953. return
  954.  
  955. exit
  956.  
  957. #############################
  958. ## Setup Section ##
  959. #############################
  960.  
  961. Setup:
  962. if !def("MM_IS_SETUP") then
  963. {
  964. echo This is your first time running the Moon Mage Training script.
  965. echo All training sections are set to ON by default.
  966. echo Toggle for the Time Tracker Plugin and Prediction Interpretor are OFF by Default.
  967. echo These may be toggled ON under the Astrology menu.
  968. echo To toggle a section OFF, click the menu for the section then click the 'Train' link.
  969. echo Please set values for variables in all sections.
  970. put #var MM_TRAIN_MAGIC ON
  971. put #var MM_TRAIN_ASTROLOGY ON
  972. put #var MM_TRAIN_MECH ON
  973. put #var MM_TRAIN_FORAGE ON
  974. put #var MM_TRAIN_JUGGLE ON
  975. put #var MM_PREDICT_INTERPRET OFF
  976. put #var MM_USE_HARNESS ON
  977. put #var MM_USE_CAMBRINTH ON
  978. put #var MM_TT_PLUGIN OFF
  979.  
  980. ##Moonmage Triggers for Moon states.
  981. put #trigger {^Katamba is a.+moon and is not visible\.} {#var moonKatamba Down;#parse @Update Moons}
  982. put #trigger {^Katamba is nowhere to be seen\.} {#var moonKatamba Down;#parse @Update Moons}
  983. put #trigger {^Katamba sets, slowly dropping below the horizon\.} {#var moonKatamba Down;#parse @Update Moons}
  984. put #trigger {^Katamba slowly rises above the horizon\.} {#var moonKatamba Up;#parse @Update Moons}
  985. put #trigger {^Set within the black disc of the.+is the image} {#var moonKatamba Up;#parse @Update Moons}
  986. put #trigger {^Set within the black disc of the.+is the outline} {#var moonKatamba Down;#parse @Update Moons}
  987. put #trigger {^Set within the blue disc of the.+is the image} {#var moonXibar Up;#parse @Update Moons}
  988. put #trigger {^Set within the blue disc of the.+is the outline} {#var moonXibar Down;#parse @Update Moons}
  989. put #trigger {^Set within the red disc of the.+is the image} {#var moonYavash Up;#parse @Update Moons}
  990. put #trigger {^Set within the red disc of the.+is the outline} {#var moonYavash Down;#parse @Update Moons}
  991. put #trigger {^Xibar is a.+moon and is not visible\.} {#var moonXibar Down;#parse @Update Moons}
  992. put #trigger {^Xibar is nowhere to be seen\.} {#var moonXibar Down;#parse @Update Moons}
  993. put #trigger {^Xibar sets, slowly dropping below the horizon\.} {#var moonXibar Down;#parse @Update Moons}
  994. put #trigger {^Xibar slowly rises above the horizon\.} {#var moonXibar Up;#parse @Update Moons}
  995. put #trigger {^Yavash is a.+moon and is not visible\.} {#var moonYavash Down;#parse @Update Moons}
  996. put #trigger {^Yavash is nowhere to be seen\.} {#var moonYavash Down;#parse @Update Moons}
  997. put #trigger {^Yavash sets, slowly dropping below the horizon\.} {#var moonYavash Down;#parse @Update Moons}
  998. put #trigger {^Yavash slowly rises above the horizon\.} {#var moonYavash Up;#parse @Update Moons}
  999. put #trigger {^You're certain that Katamba is} {#var moonKatamba Up;#parse @Update Moons}
  1000. put #trigger {^You're certain that Xibar is} {#var moonXibar Up;#parse @Update Moons}
  1001. put #trigger {^You're certain that Yavash is} {#var moonYavash Up;#parse @Update Moons}
  1002. put #trigger {by a miniature luminescent version of the moon Katamba\.} {#var moonKatamba Up;#var moonYavash Down;#var moonXibar Down;#parse @Update Moons}
  1003. put #trigger {by a miniature luminescent version of the moon Xibar\.} {#var moonXibar Up;#var moonKatamba Down;#var moonYavash Down;#parse @Update Moons}
  1004. put #trigger {by a miniature luminescent version of the moon Yavash\.} {#var moonYavash Up;#var moonKatamba Down;#var moonXibar Down;#parse @Update Moons}
  1005. 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}
  1006. 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}
  1007. 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}
  1008. 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}
  1009. 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}
  1010. 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}
  1011. 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}
  1012. 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}
  1013. 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}
  1014. 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}
  1015. 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}
  1016. 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}
  1017. 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}
  1018. }
  1019. var MAIN Magic|Astrology|Extra|Done
  1020. var ASTROLOGY Train Astrology|CV Prep|PG Prep|Divination Tool|Deal Times|TT Plugin|Wait Mode|Wait Script|Back
  1021. var MAGIC Train Magic|Warding Spell|Warding Prep|Augmentation Spell|Augmentation Prep|Utility Spell|Utility Prep|Harness|Use Harness|Cambrinth|Charge|Use Cambrinth|Back
  1022. var EXTRA Train Mech|Mech Material|Train Forage|Collect Item|Train Juggle|Jugglie|Back
  1023. var TOGGLES TRAIN|USE|PLUGIN
  1024. var MENU_WINDOW Moonmage Training Menu
  1025. var CV_PREP_DESC This is the mana amount to prepare the Clear Vision Spell during the Astrology section.
  1026. var PG_PREP_DESC This is the mana amount to prepare the Piercing Gaze Spell during the Astrology section.
  1027. var DIVINATION_TOOL_DESC This is the method used to make predicitons. The standard form is 'visions'. (Please note that Bowls and Tokka Decks are still currently disabled for the 3.0 update.)
  1028. var DEAL_TIMES_DESC This is how many cards to deal from your Tokka Deck for predicitons. Must be between 3 and 6.
  1029. 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.
  1030. 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!).
  1031. var WAIT_SCRIPT_DESC This is the name (note the filename ONLY) of the script to run during the observation cooldown.
  1032. var WARDING_SPELL_DESC This spell will be used to train Warding. Possible spells are: Psychic Shield [psy], Cage of Light [col]
  1033. var WARDING_PREP_DESC This is the mana amount to prepare the Warding Spell during the Magic section.
  1034. 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]
  1035. var AUGMENTATION_PREP_DESC This is the mana amount to prepare the Augmentation Spell during the Magic section.
  1036. 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]
  1037. var UTILITY_PREP_DESC This is the mana amount to prepare the Utility Spell during the Magic section.
  1038. var HARNESS_DESC This is the mana amount to harness before casting spells during the Magic section.
  1039. var USE_HARNESS_DESC This toggles whether or not to utilize harnessed mana during the Magic section.
  1040. var CAMBRINTH_DESC This is the noun of the cambrinth item you wish to use during the Magic section.
  1041. var CHARGE_DESC This is the amount of mana to charge your cambrith item with during the Magic section.
  1042. var USE_CAMBRINTH_DESC This toggles whether or not to utilize cambrinth during the Magic section.
  1043. var TRAIN_MECH_DESC This toggles whether or not to train Mechanical Lore while other experience drains.
  1044. var MECH_MATERIAL_DESC This is the material utilize for braiding during Mechanical Lore training, ie.: grass, vines, etc.
  1045. var TRAIN_FORAGE_DESC This toggles whether to train Outdoorsmanship through collecting while other experience drains.
  1046. var COLLECT_ITEM_DESC This is the material collected during Outdoorsmanship training. ie.: rock, branch, vine, etc.
  1047. var TRAIN_JUGGLE_DESC This toggles whether to train Perception through juggline while other experience drains.
  1048. var JUGGLIE_DESC This is the noun of the juggle item you wish to use to train Perception.
  1049. put #var selection MAIN
  1050.  
  1051. pause 1
  1052. echo
  1053. echo ################
  1054. put #echo cyan All typed user input MUST be preceeded by tilde (~) character.
  1055. echo ################
  1056.  
  1057. MenuDisplay:
  1058. var last.selection $selection
  1059. counter set 0
  1060. pause 0.3
  1061. gosub Menu.Build "%$selection" "selection" "continue.script" "" "%MENU_WINDOW"
  1062. waitforre continue.script
  1063. put #var selection {#eval toupper("$selection")}
  1064. if $selection = BACK then
  1065. {
  1066. put #var selection MAIN
  1067. goto MenuDisplay
  1068. }
  1069. if $selection = DONE then gosub CheckVars "%MAGIC|%ASTROLOGY|%EXTRA"
  1070. if ($selection = MAGIC || $selection = ASTROLOGY || $selection = EXTRA) then goto MenuDisplay
  1071. if $selection = DIVINATION TOOL then
  1072. {
  1073. send #echo ">%this.window" cyan Possible values for $selection are:
  1074. send #echo ">%this.window" cyan prism, bowl, mirror, deck, bones, chart, visions
  1075. }
  1076. put #var selection {#eval replacere("$selection", " ", "_")}
  1077. gosub GlobalSet "%$selection_DESC"
  1078.  
  1079. CheckVars:
  1080. var SETTABLES $1
  1081. eval SETTABLES toupper("%SETTABLES")
  1082. eval SETTABLES replacere("%SETTABLES", " ", "_")
  1083. eval SET_AMOUNT count("%SETTABLES", "|")
  1084. var UNSET
  1085. if %c > %SET_AMOUNT then
  1086. {
  1087. if (count("%UNSET", "|") > 0) then
  1088. {
  1089. counter set 0
  1090. eval UNSET replacere("%UNSET", "^|", "")
  1091. eval UNSET_AMOUNT count("%UNSET", "|")
  1092. eval UNSET replacere("%UNSET", "_", " ")
  1093. put #echo cyan You are missing the following Globals. Please set them before continuing!
  1094. goto Missing.Globals
  1095. }
  1096. put #var MM_IS_SETUP 1
  1097. put #window remove "Moonmage Training Menu"
  1098. put #echo cyan Script setup complete. Run default values with the command '.mm_train'
  1099. put #echo cyan To run the setup again, run the command '.mm_train setup'
  1100. exit
  1101. }
  1102. goto CheckGlobal
  1103.  
  1104. CheckGlobal:
  1105. if !(def("MM_%SETTABLES(%c)") || (%SETTABLES(%c) = BACK)) then var UNSET %UNSET|%SETTABLES(%c)
  1106. counter add 1
  1107. if %c > %SET_AMOUNT then goto CheckVars
  1108. goto CheckGlobal
  1109.  
  1110. Missing.Globals:
  1111. put #echo lime %UNSET(%c)
  1112. counter add 1
  1113. if %c < %UNSET_AMOUNT then goto Missing.Globals
  1114. put #var selection MAIN
  1115. goto MenuDisplay
  1116.  
  1117. #############################
  1118. ## Script Utilities ##
  1119. #############################
  1120.  
  1121. exit
  1122.  
  1123. Menu.Build:
  1124. ##Menu Building Routine
  1125. ##Function - Builds a numbered menu of options in link format that saves option information into a variable.
  1126. ##pre - First parameter must be an array of the option names/values. Second parameter is the name of the
  1127. ## target global variable to store the result of the link click. Third parameyer is a string
  1128. ## that will be parsed to continue the script after the menu item has been selected. Fourth parameter
  1129. ## is a string or array of items that are exceptions to be excluded from the menu list. Fifth parameter is a
  1130. ## window name to echo output to (leave out to echo to Game window).
  1131. ##post - Value of clicked link is stored in target global variable.
  1132.  
  1133. action (input) var input $1;put #parse input.done when ~(.*)
  1134.  
  1135. if !%c then
  1136. {
  1137. var this.array $1
  1138. var target.variable $2
  1139. var script.trigger $3
  1140. var exceptions $4
  1141. if !($5 = "") then
  1142. {
  1143. var this.window $5
  1144. put #window add "%this.window"
  1145. put #window open "%this.window"
  1146. put #clear %this.window
  1147. send #echo ">%this.window" cyan $selection Menu
  1148. send #echo ">%this.window"
  1149. }
  1150. else var this.window Game
  1151. var this.option 0
  1152. eval array.length count("%this.array","|")
  1153. }
  1154. if %c > %array.length then
  1155. {
  1156. var this.option 0
  1157. counter set 0
  1158. return
  1159. }
  1160. var this.choice %this.array(%c)
  1161. if matchre("%exceptions","%this.choice") then
  1162. {
  1163. counter add 1
  1164. goto menu.build
  1165. }
  1166. counter add 1
  1167. math this.option add 1
  1168. send #link ">%this.window" "%this.option. - %this.choice" "#var %target.variable %this.choice;#parse %script.trigger"
  1169. goto menu.build
  1170.  
  1171. GlobalSet:
  1172. put #clear "%this.window"
  1173. var extra_message $1
  1174. action (input) on
  1175. if matchre("$selection", "%TOGGLES") then goto TOGGLE
  1176. if !(%extra_message = "") then put #echo ">%this.window" cyan %extra_message
  1177. put #echo ">%this.window" cyan Enter value for $selection:
  1178. waitforre input.done
  1179. put #var MM_$selection %input
  1180. action (input) off
  1181. put #clear "%this.window"
  1182. put #echo ">%this.window" cyan $selection has been set to: %input
  1183. put #echo ">%this.window"
  1184. send #link ">%this.window" "Click to continue..." "#parse %script.trigger"
  1185. waitforre %script.trigger
  1186. put #var selection %last.selection
  1187. goto MenuDisplay
  1188.  
  1189. Toggle:
  1190. if $MM_$selection = ON then var TOGGLE_TO OFF
  1191. else var TOGGLE_TO ON
  1192. action (input) on
  1193. pause 0.3
  1194. send #clear "%this.window"
  1195. pause 0.3
  1196. if !(%extra_message = "") then put #echo ">%this.window" cyan %extra_message
  1197. send #echo ">%this.window" cyan Variable $selection is currently set to $MM_$selection.
  1198. send #echo ">%this.window" cyan Do you want to change it to %TOGGLE_TO?
  1199. send #echo ">%this.window"
  1200. send #link ">%this.window" "Yes" "#echo $selection has been set to %TOGGLE_TO;#var MM_$selection %TOGGLE_TO;#var selection %last.selection;#parse %script.trigger"
  1201. send #link ">%this.window" "No" "#echo No changes made, returning to menu.;#var selection %last.selection;#parse %script.trigger"
  1202. waitforre %script.trigger
  1203. send #clear "%this.window"
  1204. send #link ">%this.window" "Click to continue..." "#parse %script.trigger"
  1205. waitforre %script.trigger
  1206. goto MenuDisplay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement