Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.16 KB | None | 0 0
  1. #Moon Mage training script. - Genie3 v6.01 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. ## v6.01 Fixed an issue with the obs.count variable not getting the correct value.
  19. ##
  20.  
  21. include js_arrays.js
  22.  
  23. #####Credits####
  24. ##Hervean
  25. ## :Power Perception routine - http://www.genieclient.com/bulletin/topic/3978-mm-power-looper/
  26. ## :Divination Bowl data
  27. ##
  28. ##DrtyPrior
  29. ## :Debugging help.
  30. ################
  31.  
  32. debug 10
  33.  
  34. ##Guild Verification
  35. GuildCheck:
  36. action (guild) var guild $1 when Guild: (\w+|\w+\s+\w+)$
  37. action var circle $1 when Circle: (\d+)
  38. action (guild) on
  39. send info
  40. waitfor Debt
  41. action (guild) off
  42. if !(%guild = Moon Mage) then
  43. {
  44. echo You're not a Moon Mage. You can't use this script.
  45. exit
  46. }
  47.  
  48. ##First-run check
  49. if !def("MM_IS_SETUP") then goto Setup
  50.  
  51. if_1 then
  52. {
  53. var mode %1
  54. eval mode toupper("%mode")
  55. if matchre("%mode", "SET") then goto Setup
  56. echo Valid command line is '.mm_train setup'
  57. echo Script terminating.
  58. exit
  59. }
  60. goto ScriptStart
  61.  
  62. #######################
  63. ## Includes ##
  64. #######################
  65. # This section is for future add-ons that expand optional functions of the code
  66. # which do not affect the operation of the code itself.
  67.  
  68.  
  69. #############################
  70. ## Variables and Actions ##
  71. #############################
  72.  
  73. ScriptStart:
  74. ##Script variables
  75. ##Do NOT change these!!!
  76. var script.room $roomid
  77. var interp.action.once 0
  78. var is.recepticle 0
  79. var tool.broken 0
  80. var pouch.num first|second|third|fourth|fifth|sixth
  81. var magic.skip 1
  82. var juggle.skip 1
  83. var need.tele 0
  84. var no.tele 0
  85. var gem.pouch 0
  86. var gemempty 0
  87. var pouchplace 0
  88. var cambstow 0
  89. var mech.foragect 0
  90. var forage.ct 0
  91. var pg.known 0
  92. var cv.known 0
  93. var cv.active 0
  94. var pg.active 0
  95. var clear.sky 0
  96. var mechforagect 0
  97. var foragect 0
  98. var fullprep 0
  99. var toPower xibar|planets|trans|yavash|perc|katamba|moonl man|enlightened|psychic
  100. var totalPower 8
  101. var pp.counter 0
  102. var pouch.count 0
  103. var skip.forage 0
  104. var skip.mech 0
  105. var prep.override 0
  106. var need.moon 0
  107. var tool.check 0
  108. var offense Archer|Boar|Cat|Centaur|Er\'qutra|Estrilda|Mongoose|Panther|Scorpion|Shark|Spider|Szeldia|Triquetra|Viper|Wolverine
  109. var defense Albatross|Dawgolesh|Dove|Giant|Jackal|Katamba|Lion|Magpie|Merewalda|Penhetia|Raccoon|Vulture|Welkin
  110. var lore Amlothi|Brigantine|Cobra|Donkey|Hare|King Snake|Phoenix|Raven|Scales|Shardstar|Verena|Weasel|Xibar
  111. var magic Adder|Amlothi|Coyote|Durgaulda|Ismenia|Nightingale|Owl|Phoenix|Shrew|Toad|Wolf|Wren|Yavash
  112. var survival Cow|Dolphin|Goshawk|Heart|Heron|Morleena|Ox|Ram|Shark|Shrike|Sun|Unicorn|Yoakena
  113. 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
  114. 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
  115. 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
  116. 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
  117. 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
  118. 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
  119. 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
  120. 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
  121. var levels.day 0|0|0|0|42|45|48|51|54|59|64|69|74|79|84|89
  122. var obs.day Sun|Xibar|Yavash|Katamba|Verena|Estrilda|Durgaulda|Yoakena|Penhetia|Szeldia|Merewalda|Ismenia|Morleena|Amlothi|Dawgolesh||Er\'qutra
  123. 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
  124. var disposal.extra trash |large stone |waste |firewood |tree |oak |ivory | of viscous gloop
  125. var dump.recepticle 0
  126.  
  127. put #var MM_DIVINATION_TOOL {#eval tolower("$MM_DIVINATION_TOOL")}
  128.  
  129. ##Script Actions
  130. action send get prism when As the sapphire prism swings to a halt you lose your grip
  131. action send get my $MM_CAMBRINTH when Remove what?
  132. action var cambstow $2 when from inside your (\S+|\S+\s+\w+)\.$
  133. action send put my $MM_CAMBRINTH in my %cambstow when You can't wear that\!$
  134. action var clear.sky 1 when clear sky|sky is clear
  135. action var clear.sky 1 when open sky
  136. action send 2 $lastcommand when ^\.\.\.wait|^Sorry, you may only type
  137. action var season $1 when It is currently (\w+)
  138. action var season $1 when It's currently (\w+)
  139. action (time) var time day when dawn|morning|noon|afternoon|midday
  140. action (time) var time night when sunrise|dusk|night|midnight|late night|sunset|evening
  141. action (spells) var pg.known 1 when Piercing Gaze
  142. action (spells) var cv.known 1 when Clear Vision
  143. action remove You strain
  144. action remove You have to strain
  145. action remove You strain, but
  146. action var cv.active 0 when You feel less aware of your environment\.$
  147. action var pg.active 0 when The world around you returns to its mundane appearance\.$
  148. action var hand.armor $1 when Your efforts are hindered by your \w+ (\w+)
  149. action var hand.armor $1 when Your efforts are hindered by your \w+ \w+ (\w+)
  150. action (pouchcheck) js doPush("pouchname","$1") when (\S+) pouch\.$
  151. action (gemcheck) var gemempty 1 when There is nothing in there.
  152. action (tool.check) tool.broken = 1;echo Divination tool broken! when referring
  153. action (new.tool) var tool.broken 0 when ^You tap
  154. action (new.tool) var $MM_DIVINATION_TOOL 0 when referring.
  155. action (warding) var prep.override 0;var need.moon 1 when ^@Update Moons
  156. action var need.moon 1 when You must specify one of the three|on the wrong side of Elanthia and is not visible
  157. action var PREDICT_WAIT OFF when sufficiently pondered
  158. action var fullprep 1 when You feel fully prepared
  159. action (tele.get) var telestow $1 when from inside your (\S+|\S+\s+\w+)\.$
  160. action (jugglecheck) var jugglestow $1 when $MM_JUGGLIE.* from inside your (\S+|\S+\s+\w+)\.$
  161. action (divin.get) var divinstow $1 when $MM_DIVINATION_TOOL.* from inside your (\S+|\S+\s+\w+)\.$
  162. action (checktied) var is_tied 1 when You tap a .* atop your
  163. action (checktied) var tied_to $1 when You remove a .* from your (.+)\.
  164.  
  165. action (pouchcheck) off
  166. action (gemcheck) off
  167. action (jugglecheck) off
  168. action (divin.get) off
  169. action (tool.check) off
  170. action (new.tool) off
  171. action (time) off
  172. action (spells) off
  173. action (warding) off
  174. action (tele.get) off
  175. action (checktied) off
  176.  
  177. #############################
  178. ## Main Script Body ##
  179. #############################
  180.  
  181. ##Initial Script Checks
  182. HandsEmptyChk:
  183. if $righthand = Empty then
  184. {
  185. if $lefthand = Empty then goto checks
  186. }
  187. echo ********************************************
  188. echo * Please empty hands and run script again. *
  189. echo ********************************************
  190. exit
  191.  
  192. Checks:
  193. if matchre("$roomobjs",("%disposals")) then
  194. {
  195. var is.recepticle 1
  196. var dump.recepticle $0
  197. eval dump.recepticle replacere("%dump.recepticle", "%disposal.extra", "")
  198. }
  199. action (spells) on
  200. pause 1
  201. send spells
  202. pause 0.5
  203. action (spells) off
  204. send observe weather
  205. pause 0.5
  206. goto pouchfind
  207.  
  208. PouchFind:
  209. action (pouchcheck) on
  210. pause 0.5
  211. put inv search pouch
  212. waitfor INVENTORY HELP
  213. action (pouchcheck) off
  214. if contains("%pouchname", "gem") = 0 then
  215. {
  216. Echo No gem pouch. Skipping appraisal.
  217. if_6 then goto jugglechk
  218. goto mainloop
  219. }
  220. var gem.pouch 1
  221. jscall pouchplace doXCompare("pouchname","pouch.num","gem")
  222.  
  223. OpenChk:
  224. match openpou is closed.
  225. match jugglechk nothing in
  226. match JuggleChk gem pouch
  227. action (gemcheck) on
  228. pause 1
  229. put look in my %pouchplace pou
  230. put close my %pouchplace pou
  231. action (gemcheck) off
  232. matchwait
  233.  
  234. OpenPou:
  235. match jugglechk when has been tied
  236. match openchk ^You open
  237. put open my %pouchplace pou
  238. goto openchk
  239.  
  240. JuggleChk:
  241. if %gemempty = 1 then echo Your gem pouch is empty. Skipping appraisal. Get some gems!
  242. if $MM_TRAIN_JUGGLE = OFF then goto mainloop
  243. action (jugglecheck) on
  244. pause 0.5
  245. send take my $MM_JUGGLIE
  246. pause 0.5
  247. action (jugglecheck) off
  248. pause 3
  249. send put $MM_JUGGLIE in my %jugglestow
  250.  
  251. MainLoop:
  252. pause 2
  253. #Magic Training Checks
  254. if $MM_TRAIN_MAGIC = ON then
  255. {
  256. if ($Warding.LearningRate < 10 && "$MM_TRAIN_WARDING" = "ON") then gosub Magic.Start Warding
  257. if ($Augmentation.LearningRate < 10 && "$MM_TRAIN_AUGMENTATION" = "ON") then gosub Magic.Start Augmentation
  258. if ($Utility.LearningRate < 10 && "$MM_TRAIN_UTILITY" = "ON") 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. send stow my $righthand
  750. send 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|crinkled and black
  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 get my sigilbook
  780. put open my sigilbook
  781. goto Predict_Wait
  782.  
  783. Turn_Sigil:
  784. put turn my sigilbook
  785. pause 1
  786. goto Predict_Wait
  787.  
  788. ##PG/CV casting
  789. PG:
  790. put prep PG $MM_PG_PREP
  791. waitfor fully prepared
  792. put cast
  793. var pg.active 1
  794. pause 0.5
  795. return
  796.  
  797. CV:
  798. put prep CV $MM_CV_PREP
  799. waitfor fully prepared
  800. put cast
  801. var cv.active 1
  802. pause 0.5
  803. return
  804.  
  805. ##Supplementary Skills section
  806. ##Appraisal secion
  807. Appraisal:
  808. wait
  809. pause 1
  810. send open my %pouchplace pouch
  811. wait
  812. pause 1
  813. send app my %pouchplace pouch
  814. wait
  815. pause 1
  816. send app my %pouchplace pouch
  817. wait
  818. pause 1
  819. send close my %pouchplace pouch
  820. wait
  821. pause 1
  822. return
  823.  
  824. ##Juggle section
  825. Juggle:
  826. if $righthand = Empty then
  827. {
  828. send get my $MM_JUGGLIE
  829. }
  830. pause 1
  831. send juggle my $MM_JUGGLIE
  832. waitforre ^Roundtime
  833. pause
  834. pause 1
  835. send juggle my $MM_JUGGLIE
  836. waitforre ^Roundtime
  837. pause
  838. pause 1
  839. send juggle my $MM_JUGGLIE
  840. waitforre ^Roundtime
  841. pause
  842. pause 1
  843. send put $MM_JUGGLIE in my %jugglestow
  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. }
  892. pause
  893. pause 1
  894. if %mech.foragect > 2 then
  895. {
  896. echo No $MM_MECH_MAT to forage here. Skipping.
  897. var skip.mech 1
  898. return
  899. }
  900. match mech.braid You manage to find some grass.
  901. match mech.forageadd Roundtime:
  902. put forage $MM_MECH_MATERIAL
  903. matchwait
  904.  
  905. Mech.ForageAdd:
  906. math mech.foragect add 1
  907. goto mech.forage
  908.  
  909. Mech.Braid:
  910. pause 1
  911. match rem.armor Your efforts are hindered by your
  912. match mech.forage You need to have more material
  913. match mech.pull mistake
  914. match mech.dump wasted effort.
  915. match mech.braid Roundtime:
  916. send braid my $MM_MECH_MATERIAL
  917. matchwait
  918.  
  919. Rem.Armor:
  920. pause 1
  921. send remove my %hand.armor
  922. send stow my %hand.armor
  923. goto mech.braid
  924.  
  925. Mech.Pull:
  926. pause 1
  927. match mech.forage You need to have more material
  928. match mech.braid for your work so far
  929. matchre mech.dispose rope|You tug|breaks apart
  930. send pull my $MM_MECH_MATERIAL
  931. matchwait
  932.  
  933. Mech.Dispose:
  934. pause
  935. pause 1
  936. if %dump.recepticle = 0 then send drop rope
  937. else send put rope in %dump.recepticle
  938. waitforre ^You
  939. return
  940.  
  941. Mech.Dump:
  942. pause
  943. pause 1
  944. if %dump.recepticle = 0 then send drop $MM_MECH_MATERIAL
  945. else send put $MM_MECH_MATERIAL in %dump.recepticle
  946. waitforre ^You
  947. return
  948.  
  949. Return:
  950. return
  951.  
  952. exit
  953.  
  954. #############################
  955. ## Setup Section ##
  956. #############################
  957.  
  958. Setup:
  959. if !def("MM_IS_SETUP") then
  960. {
  961. echo This is your first time running the Moon Mage Training script.
  962. echo All training sections are set to ON by default.
  963. echo Toggle for the Time Tracker Plugin and Prediction Interpretor are OFF by Default.
  964. echo These may be toggled ON under the Astrology menu.
  965. echo To toggle a section OFF, click the menu for the section then click the 'Train' link.
  966. echo Please set values for variables in all sections.
  967. put #var MM_TRAIN_MAGIC ON
  968. put #var MM_TRAIN_ASTROLOGY ON
  969. put #var MM_TRAIN_MECH ON
  970. put #var MM_TRAIN_FORAGE ON
  971. put #var MM_TRAIN_JUGGLE ON
  972. put #var MM_USE_HARNESS ON
  973. put #var MM_USE_CAMBRINTH ON
  974. put #var MM_TT_PLUGIN OFF
  975.  
  976. ##Moonmage Triggers for Moon states.
  977. put #trigger {^Katamba is a.+moon and is not visible\.} {#var moonKatamba Down;#parse @Update Moons}
  978. put #trigger {^Katamba is nowhere to be seen\.} {#var moonKatamba Down;#parse @Update Moons}
  979. put #trigger {^Katamba sets, slowly dropping below the horizon\.} {#var moonKatamba Down;#parse @Update Moons}
  980. put #trigger {^Katamba slowly rises above the horizon\.} {#var moonKatamba Up;#parse @Update Moons}
  981. put #trigger {^Set within the black disc of the.+is the image} {#var moonKatamba Up;#parse @Update Moons}
  982. put #trigger {^Set within the black disc of the.+is the outline} {#var moonKatamba Down;#parse @Update Moons}
  983. put #trigger {^Set within the blue disc of the.+is the image} {#var moonXibar Up;#parse @Update Moons}
  984. put #trigger {^Set within the blue disc of the.+is the outline} {#var moonXibar Down;#parse @Update Moons}
  985. put #trigger {^Set within the red disc of the.+is the image} {#var moonYavash Up;#parse @Update Moons}
  986. put #trigger {^Set within the red disc of the.+is the outline} {#var moonYavash Down;#parse @Update Moons}
  987. put #trigger {^Xibar is a.+moon and is not visible\.} {#var moonXibar Down;#parse @Update Moons}
  988. put #trigger {^Xibar is nowhere to be seen\.} {#var moonXibar Down;#parse @Update Moons}
  989. put #trigger {^Xibar sets, slowly dropping below the horizon\.} {#var moonXibar Down;#parse @Update Moons}
  990. put #trigger {^Xibar slowly rises above the horizon\.} {#var moonXibar Up;#parse @Update Moons}
  991. put #trigger {^Yavash is a.+moon and is not visible\.} {#var moonYavash Down;#parse @Update Moons}
  992. put #trigger {^Yavash is nowhere to be seen\.} {#var moonYavash Down;#parse @Update Moons}
  993. put #trigger {^Yavash sets, slowly dropping below the horizon\.} {#var moonYavash Down;#parse @Update Moons}
  994. put #trigger {^Yavash slowly rises above the horizon\.} {#var moonYavash Up;#parse @Update Moons}
  995. put #trigger {^You're certain that Katamba is} {#var moonKatamba Up;#parse @Update Moons}
  996. put #trigger {^You're certain that Xibar is} {#var moonXibar Up;#parse @Update Moons}
  997. put #trigger {^You're certain that Yavash is} {#var moonYavash Up;#parse @Update Moons}
  998. put #trigger {by a miniature luminescent version of the moon Katamba\.} {#var moonKatamba Up;#var moonYavash Down;#var moonXibar Down;#parse @Update Moons}
  999. put #trigger {by a miniature luminescent version of the moon Xibar\.} {#var moonXibar Up;#var moonKatamba Down;#var moonYavash Down;#parse @Update Moons}
  1000. put #trigger {by a miniature luminescent version of the moon Yavash\.} {#var moonYavash Up;#var moonKatamba Down;#var moonXibar Down;#parse @Update Moons}
  1001. 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}
  1002. 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}
  1003. 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}
  1004. 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}
  1005. 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}
  1006. 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}
  1007. 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}
  1008. 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}
  1009. 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}
  1010. 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}
  1011. 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}
  1012. 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}
  1013. 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}
  1014. }
  1015. var MAIN Magic|Astrology|Extra|Done
  1016. var ASTROLOGY Train Astrology|CV Prep|PG Prep|Divination Tool|Deal Times|TT Plugin|Wait Mode|Wait Script|Back
  1017. var MAGIC Train Magic|Warding Spell|Warding Prep|Augmentation Spell|Augmentation Prep|Utility Spell|Utility Prep|Harness|Use Harness|Cambrinth|Charge|Use Cambrinth|Back
  1018. var EXTRA Train Mech|Mech Material|Train Forage|Collect Item|Train Juggle|Jugglie|Back
  1019. var TOGGLES TRAIN|USE|PLUGIN
  1020. var MENU_WINDOW Moonmage Training Menu
  1021. var CV_PREP_DESC This is the mana amount to prepare the Clear Vision Spell during the Astrology section.
  1022. var PG_PREP_DESC This is the mana amount to prepare the Piercing Gaze Spell during the Astrology section.
  1023. 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.)
  1024. var DEAL_TIMES_DESC This is how many cards to deal from your Tokka Deck for predicitons. Must be between 3 and 6.
  1025. 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.
  1026. 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!).
  1027. var WAIT_SCRIPT_DESC This is the name (note the filename ONLY) of the script to run during the observation cooldown.
  1028. var WARDING_SPELL_DESC This spell will be used to train Warding. Possible spells are: Psychic Shield [psy], Cage of Light [col]
  1029. var WARDING_PREP_DESC This is the mana amount to prepare the Warding Spell during the Magic section.
  1030. 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]
  1031. var AUGMENTATION_PREP_DESC This is the mana amount to prepare the Augmentation Spell during the Magic section.
  1032. 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]
  1033. var UTILITY_PREP_DESC This is the mana amount to prepare the Utility Spell during the Magic section.
  1034. var HARNESS_DESC This is the mana amount to harness before casting spells during the Magic section.
  1035. var USE_HARNESS_DESC This toggles whether or not to utilize harnessed mana during the Magic section.
  1036. var CAMBRINTH_DESC This is the noun of the cambrinth item you wish to use during the Magic section.
  1037. var CHARGE_DESC This is the amount of mana to charge your cambrith item with during the Magic section.
  1038. var USE_CAMBRINTH_DESC This toggles whether or not to utilize cambrinth during the Magic section.
  1039. var TRAIN_MECH_DESC This toggles whether or not to train Mechanical Lore while other experience drains.
  1040. var MECH_MATERIAL_DESC This is the material utilize for braiding during Mechanical Lore training, ie.: grass, vines, etc.
  1041. var TRAIN_FORAGE_DESC This toggles whether to train Outdoorsmanship through collecting while other experience drains.
  1042. var COLLECT_ITEM_DESC This is the material collected during Outdoorsmanship training. ie.: rock, branch, vine, etc.
  1043. var TRAIN_JUGGLE_DESC This toggles whether to train Perception through juggline while other experience drains.
  1044. var JUGGLIE_DESC This is the noun of the juggle item you wish to use to train Perception.
  1045. put #var selection MAIN
  1046.  
  1047. pause 1
  1048. echo
  1049. echo ################
  1050. put #echo cyan All typed user input MUST be preceeded by tilde (~) character.
  1051. echo ################
  1052.  
  1053. MenuDisplay:
  1054. var last.selection $selection
  1055. counter set 0
  1056. pause 0.3
  1057. gosub Menu.Build "%$selection" "selection" "continue.script" "" "%MENU_WINDOW"
  1058. waitforre continue.script
  1059. put #var selection {#eval toupper("$selection")}
  1060. if $selection = BACK then
  1061. {
  1062. put #var selection MAIN
  1063. goto MenuDisplay
  1064. }
  1065. if $selection = DONE then gosub CheckVars "%MAGIC|%ASTROLOGY|%EXTRA"
  1066. if ($selection = MAGIC || $selection = ASTROLOGY || $selection = EXTRA) then goto MenuDisplay
  1067. if $selection = DIVINATION TOOL then
  1068. {
  1069. send #echo ">%this.window" cyan Possible values for $selection are:
  1070. send #echo ">%this.window" cyan prism, bowl, mirror, deck, bones, chart, visions
  1071. }
  1072. put #var selection {#eval replacere("$selection", " ", "_")}
  1073. gosub GlobalSet "%$selection_DESC"
  1074.  
  1075. CheckVars:
  1076. var SETTABLES $1
  1077. eval SETTABLES toupper("%SETTABLES")
  1078. eval SETTABLES replacere("%SETTABLES", " ", "_")
  1079. eval SET_AMOUNT count("%SETTABLES", "|")
  1080. var UNSET
  1081. if %c > %SET_AMOUNT then
  1082. {
  1083. if (count("%UNSET", "|") > 0) then
  1084. {
  1085. counter set 0
  1086. eval UNSET replacere("%UNSET", "^|", "")
  1087. eval UNSET_AMOUNT count("%UNSET", "|")
  1088. eval UNSET replacere("%UNSET", "_", " ")
  1089. put #echo cyan You are missing the following Globals. Please set them before continuing!
  1090. goto Missing.Globals
  1091. }
  1092. put #var MM_IS_SETUP 1
  1093. put #window remove "Moonmage Training Menu"
  1094. put #echo cyan Script setup complete. Run default values with the command '.mm_train'
  1095. put #echo cyan To run the setup again, run the command '.mm_train setup'
  1096. exit
  1097. }
  1098. goto CheckGlobal
  1099.  
  1100. CheckGlobal:
  1101. if !(def("MM_%SETTABLES(%c)") || (%SETTABLES(%c) = BACK)) then var UNSET %UNSET|%SETTABLES(%c)
  1102. counter add 1
  1103. if %c > %SET_AMOUNT then goto CheckVars
  1104. goto CheckGlobal
  1105.  
  1106. Missing.Globals:
  1107. put #echo lime %UNSET(%c)
  1108. counter add 1
  1109. if %c < %UNSET_AMOUNT then goto Missing.Globals
  1110. put #var selection MAIN
  1111. goto MenuDisplay
  1112.  
  1113. #############################
  1114. ## Script Utilities ##
  1115. #############################
  1116.  
  1117. exit
  1118.  
  1119. Menu.Build:
  1120. ##Menu Building Routine
  1121. ##Function - Builds a numbered menu of options in link format that saves option information into a variable.
  1122. ##pre - First parameter must be an array of the option names/values. Second parameter is the name of the
  1123. ## target global variable to store the result of the link click. Third parameyer is a string
  1124. ## that will be parsed to continue the script after the menu item has been selected. Fourth parameter
  1125. ## is a string or array of items that are exceptions to be excluded from the menu list. Fifth parameter is a
  1126. ## window name to echo output to (leave out to echo to Game window).
  1127. ##post - Value of clicked link is stored in target global variable.
  1128.  
  1129. action (input) var input $1;put #parse input.done when ~(.*)
  1130.  
  1131. if !%c then
  1132. {
  1133. var this.array $1
  1134. var target.variable $2
  1135. var script.trigger $3
  1136. var exceptions $4
  1137. if !($5 = "") then
  1138. {
  1139. var this.window $5
  1140. put #window add "%this.window"
  1141. put #window open "%this.window"
  1142. put #clear %this.window
  1143. send #echo ">%this.window" cyan $selection Menu
  1144. send #echo ">%this.window"
  1145. }
  1146. else var this.window Game
  1147. var this.option 0
  1148. eval array.length count("%this.array","|")
  1149. }
  1150. if %c > %array.length then
  1151. {
  1152. var this.option 0
  1153. counter set 0
  1154. return
  1155. }
  1156. var this.choice %this.array(%c)
  1157. if matchre("%exceptions","%this.choice") then
  1158. {
  1159. counter add 1
  1160. goto menu.build
  1161. }
  1162. counter add 1
  1163. math this.option add 1
  1164. send #link ">%this.window" "%this.option. - %this.choice" "#var %target.variable %this.choice;#parse %script.trigger"
  1165. goto menu.build
  1166.  
  1167. GlobalSet:
  1168. put #clear "%this.window"
  1169. var extra_message $1
  1170. action (input) on
  1171. if matchre("$selection", "%TOGGLES") then goto TOGGLE
  1172. if !(%extra_message = "") then put #echo ">%this.window" cyan %extra_message
  1173. put #echo ">%this.window" cyan Enter value for $selection:
  1174. waitforre input.done
  1175. put #var MM_$selection %input
  1176. action (input) off
  1177. put #clear "%this.window"
  1178. put #echo ">%this.window" cyan $selection has been set to: %input
  1179. put #echo ">%this.window"
  1180. send #link ">%this.window" "Click to continue..." "#parse %script.trigger"
  1181. waitforre %script.trigger
  1182. put #var selection %last.selection
  1183. goto MenuDisplay
  1184.  
  1185. Toggle:
  1186. if $MM_$selection = ON then var TOGGLE_TO OFF
  1187. else var TOGGLE_TO ON
  1188. action (input) on
  1189. pause 0.3
  1190. send #clear "%this.window"
  1191. pause 0.3
  1192. if !(%extra_message = "") then put #echo ">%this.window" cyan %extra_message
  1193. send #echo ">%this.window" cyan Variable $selection is currently set to $MM_$selection.
  1194. send #echo ">%this.window" cyan Do you want to change it to %TOGGLE_TO?
  1195. send #echo ">%this.window"
  1196. 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"
  1197. send #link ">%this.window" "No" "#echo No changes made, returning to menu.;#var selection %last.selection;#parse %script.trigger"
  1198. waitforre %script.trigger
  1199. send #clear "%this.window"
  1200. send #link ">%this.window" "Click to continue..." "#parse %script.trigger"
  1201. waitforre %script.trigger
  1202. goto MenuDisplay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement