Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.92 KB | None | 0 0
  1. debug 10
  2. eval DATE replacere("@date@","\/","")
  3. put #log >training_%DATE.log @time@ ~ **********************************************************
  4. put #log >training_%DATE.log @time@ ~ Training script launched
  5. put #statusbar 3
  6.  
  7. action (emergency) put #log >training_%DATE.log @time@ ~ detected low health -- health at $health;goto dying when eval $health < 20
  8. action (emergency) put #log >training_%DATE.log @time@ ~ detected small health drop -- health at $health;goto health_drop when eval $health < 94
  9. action (emergency) put #log >training_%DATE.log @time@ ~ detected stunned;goto stunned when eval $stunned = 1
  10. action (universal) var SPELL.PREPPED 1 when ^You feel fully prepared
  11. action (universal) send 3 $lastcommand when ^\.\.\.wait \d+ seconds.$
  12. action (research) var RESEARCH.COMPLETE 1;var RESEARCH.INVESTED.SECONDS null;var RESEARCH.START.TIME null;put #statusbar 3 Research Complete. when Breakthrough\!
  13. action (research) var RESEARCH.MORE 1;evalmath RESEARCH.INVESTED.SECONDS %RESEARCH.INVESTED.SECONDS + %RESEARCH.SECONDS;put #statusbar 3 Research Pending. when However\, there is still more to learn before you arrive at a breakthrough\.
  14. action (magic) send 1 cast when ^Sorry\, you may only type ahead \d+ command\.
  15. action (climb) goto climb_pre_end when eval $Athletics.LearningRate = 34
  16. action (FA) var BODY.PART $1 $2|%BODY.PART when ^\s+(right|left) (arm|leg|hand|eye)\s+\w+$
  17. action (FA) var BODY.PART $1|%BODY.PART when ^\s+(head|neck|chest|back|abdomen)\s+\w+$
  18. action (wealth) var KRONARS 0 when ^\s+No Kronars\.$
  19. action (wealth) var KRONARS $1 when \((\d+) copper Kronars\)\.$
  20. action (mech) var PAPER.COUNT $1 when As you thumb through the envelope\, you guess that there are (\d+) sheets of .+ origami paper remaining\.$
  21. action (mech) var PAPER.COUNT 1 when you see that there is but a single sheet of origami paper remaining\.$
  22. action (mech) var PAPER.COUNT 0 when As you thumb through the envelope\, you see it is empty\.
  23. action (mech) var TEMP $1 when ^You are wearing (.+)\.$
  24. action (mech) var TEMP $1 when ^You rummage through .+ and see (.+)\.$
  25.  
  26. action (emergency) on
  27. action (universal) on
  28. action (research) off
  29. action (magic) off
  30. action (climb) off
  31. action (FA) off
  32. action (wealth) off
  33. action (mech) off
  34.  
  35. # VV global variables VV
  36. if $EMPATHY.TRAINING.TIME > 0 then
  37. else
  38. {
  39. put #var EMPATHY.TRAINING.TIME 90|90|90|90|90
  40. var TEMP 1
  41. }
  42. if $ORIGAMI.FOLDS.HISTORY > 0 then
  43. else
  44. {
  45. put #var ORIGAMI.FOLDS.HISTORY 11|11|11|11|11|11|11|11|11|11
  46. var TEMP 1
  47. }
  48. if %TEMP = 1 then
  49. {
  50. put #vars save
  51. unvar TEMP
  52. }
  53. # ^^ global variables ^^
  54. # vv Character specific variables vv
  55. var STORAGE.CONTAINER haversask
  56. var GEMCONTAINER green pouch
  57. var GEMCONTAINERSTORAGE ashcloak
  58. var CAMB.LOWCAP.ITEM armband
  59. var CAMB.LOWCAP.WORN 1
  60. var CAMB.HIGHCAP.ITEM orb
  61. var CAMB.HIGHCAP.WORN 0
  62. var SPELL.MESSAGING Your eyes darken to black as a starless night
  63. var GAF.PREP 20
  64. var VIGOR.PREP 22
  65. var ORIGAMI.AVG.OFFSET 3
  66. # ^^ Character specific variables ^^
  67.  
  68. counter set 0
  69. var ALPHA.NUMBER first|second|third|fourth|fifth|sixth|seventh|eighth|ninth
  70. var APP.TIMER 0
  71. var EMPATHY.PATH w|w|s|s|e|s|w|w|n|w|w|s|s|s|s|s|s|se|e|e|e|n|n|n|ne|n|n|n|n
  72. var EMPATHY.TIMER 0
  73. var LEARNINGRATE.MIN 28
  74. var LEARNINGRATE.SECONDARY 20
  75. var MECH.TIMER 0
  76. var NEED.PAPER 0
  77. var PAPER.COUNT
  78. var RESEARCH.CHECK.TIME 0
  79. var RESEARCH.COMPLETE 0
  80. var RESEARCH.COUNTER 0
  81. var RESEARCH.DISABLE null
  82. var RESEARCH.INVESTED.SECONDS null
  83. var RESEARCH.LEARNINGRATE.MIN 12
  84. var RESEARCH.MORE 0
  85. var RESEARCH.PLAN
  86. var RESEARCH.PROJECT.COMPLETE null
  87. var RESEARCH.RETRY 0
  88. var RESEARCH.RETRY 0
  89. var RESEARCH.SECONDS 300
  90. var RESEARCH.SKILLMIN
  91. var RESEARCH.SKIP null
  92. var RESEARCH.START.TIME null
  93. var RESEARCH.STEPS null
  94. var SPELL.PREPPED 0
  95. var TRACK.EMPATHY 0
  96. var TRACK.MECH 0
  97. # var CLIMB.TIME 0
  98. # var REPLACE.ARMOR 0
  99. eval TOTAL.ROOMS count("%EMPATHY.PATH","|")
  100. evalmath EMPATHY.TRAINING.AVG round(($EMPATHY.TRAINING.TIME(0) +$EMPATHY.TRAINING.TIME(1) + $EMPATHY.TRAINING.TIME(2) + $EMPATHY.TRAINING.TIME(3) + $EMPATHY.TRAINING.TIME(4)) / 5)
  101. evalmath ORIGAMI.FOLDS.AVG ($ORIGAMI.FOLDS.HISTORY(0) + $ORIGAMI.FOLDS.HISTORY(1) + $ORIGAMI.FOLDS.HISTORY(2) + $ORIGAMI.FOLDS.HISTORY(3) + $ORIGAMI.FOLDS.HISTORY(4) + $ORIGAMI.FOLDS.HISTORY(5) + $ORIGAMI.FOLDS.HISTORY(6) + $ORIGAMI.FOLDS.HISTORY(7) + $ORIGAMI.FOLDS.HISTORY(8) + $ORIGAMI.FOLDS.HISTORY(9)) / 10
  102.  
  103. put research cancel
  104. pause .25
  105. pause .25
  106. put research cancel
  107. pause .25
  108. pause .25
  109. put research cancel
  110. pause .25
  111. pause .25
  112.  
  113.  
  114. timer start
  115.  
  116.  
  117. start:
  118. put #statusbar 2
  119. if $bleeding = 1 then gosub sub_tend
  120. check_athletics:
  121. put #log >training_%DATE.log @time@ ~ evaluating athletics
  122. if $Athletics.LearningRate < %LEARNINGRATE.SECONDARY then
  123. {
  124. var LEARNINGRATE.SECONDARY 20
  125. action (climb) on
  126. put #statusbar 2 Athletics
  127. gosub sub_move NEGATE2OLDIMPERIALROAD
  128. goto climb
  129. }
  130. if $Athletics.LearningRate !< %LEARNINGRATE.SECONDARY then
  131. {
  132. put #log >training_%DATE.log @time@ ~ skipping athletics -- learning rate ($Athletics.LearningRate) is not < %LEARNINGRATE.SECONDARY
  133. }
  134.  
  135. put #log >training_%DATE.log @time@ ~ evaluating empathy
  136. if $Empathy.LearningRate < %LEARNINGRATE.MIN then
  137. {
  138. put #statusbar 2 Empathy
  139. action (research) on
  140. action (universal) on
  141. var RESEARCH.SKILLMIN Empathy|26
  142. gosub define_research_plan
  143. if $Empathy.LearningRate = 0 then
  144. {
  145. var EMPATHY.TIMER %t
  146. var TRACK.EMPATHY 1
  147. }
  148. goto empathy
  149. }
  150. if $Empathy.LearningRate !< %LEARNINGRATE.MIN then
  151. {
  152. put #log >training_%DATE.log @time@ ~ skipping empathy -- learning rate ($Empathy.LearningRate) is not < %LEARNINGRATE.MIN
  153. }
  154.  
  155. check_mech:
  156. put #log >training_%DATE.log @time@ ~ evaluating Mechanical Lore
  157. if $Mechanical_Lore.LearningRate < %LEARNINGRATE.SECONDARY then
  158. {
  159. var LEARNINGRATE.SECONDARY 20
  160. put #statusbar 2 Mech
  161. action (mech) on
  162. put inv
  163. waitfor INVENTORY HELP
  164. if !matchre("%TEMP","an origami\-paper envelope") then
  165. {
  166. put get my ori envelope
  167. waitfor You get an
  168. }
  169. else
  170. {
  171. put remove my ori envelope
  172. waitfor You remove an
  173. }
  174. unvar TEMP
  175. put look in my origami envelope
  176. waitfor As you thumb through the envelope,
  177. if %PAPER.COUNT > 0 then
  178. {
  179. put wear my origami envelope
  180. waitfor You attach an
  181. gosub sub_move NEGATE2WILLOWPONDPIER
  182. action (research) on
  183. action (universal) on
  184. var RESEARCH.SKILLMIN Mechanical_Lore|26
  185. gosub define_research_plan
  186. evalmath RESEARCH.SECONDS (%ORIGAMI.FOLDS.AVG * 10) - %ORIGAMI.AVG.OFFSET
  187. if $Mechanical_Lore.LearningRate = 0 then
  188. {
  189. var TRACK.MECH 1
  190. var MECH.TIMER %t
  191. }
  192. goto mech
  193. }
  194. if %PAPER.COUNT = 0 then
  195. {
  196. put poke my origami envelope
  197. waitfor You tear up the empty envelope and toss it away.
  198. goto origami_get_paper
  199. }
  200. }
  201. if $Mechanical_Lore.LearningRate !< %LEARNINGRATE.SECONDARY then
  202. {
  203. put #log >training_%DATE.log @time@ ~ skipping mech -- learning rate ($Mechanical_Lore.LearningRate) is not < %LEARNINGRATE.SECONDARY
  204. }
  205.  
  206.  
  207.  
  208.  
  209. # Check magic
  210. put #log >training_%DATE.log @time@ ~ evaluating Magic skills
  211. if $Primary_Magic.LearningRate < %RESEARCH.LEARNINGRATE.MIN or $Arcana.LearningRate < %RESEARCH.LEARNINGRATE.MIN or $Augmentation.LearningRate < %RESEARCH.LEARNINGRATE.MIN or $Utility.LearningRate < %RESEARCH.LEARNINGRATE.MIN or $Warding.LearningRate < %RESEARCH.LEARNINGRATE.MIN then
  212. {
  213. put #statusbar 2 Magic
  214. gosub sub_move NEGATE2WILLOWPONDPIER
  215. action (research) on
  216. action (universal) on
  217. gosub define_research_plan
  218. var RESEARCH.SECONDS 65
  219. goto magic
  220. }
  221. else put #log >training_%DATE.log @time@ ~ skipping magic -- no magical learning rates are below the minimum training level
  222.  
  223.  
  224.  
  225. put #log >training_%DATE.log @time@ ~ evaluating Perception and Outdoorsmanship
  226. if $Perception.LearningRate < %LEARNINGRATE.MIN or $Outdoorsmanship.LearningRate < %LEARNINGRATE.MIN then
  227. {
  228. put #statusbar 2 Perception
  229. gosub sub_move NEGATE2WILLOWPONDPIER
  230. action (research) on
  231. action (universal) on
  232. var RESEARCH.SKILLMIN Perception|26
  233. gosub define_research_plan
  234. goto perception
  235. }
  236. else put #log >training_%DATE.log @time@ ~ skipping perception -- learning rates ($Perception.LearningRate or $Outdoorsmanship.LearningRate) are not < %LEARNINGRATE.MIN
  237.  
  238. put #log >training_%DATE.log @time@ ~ primary training completed
  239. # Evaluate secondary skills
  240. put #log >training_%DATE.log @time@ ~ evaluating secondary skills
  241. var LEARNINGRATE.SECONDARY %LEARNINGRATE.MIN
  242. put #log >training_%DATE.log @time@ ~ evaluating Athletics as a secondary skill
  243. if $Athletics.LearningRate < %LEARNINGRATE.MIN then goto check_athletics
  244. put #log >training_%DATE.log @time@ ~ evaluating Mechanical Lore as a secondary skill
  245. if $Mechanical_Lore.LearningRate < %LEARNINGRATE.MIN then goto check_mech
  246. put #log >training_%DATE.log @time@ ~ Primary and secondary training completed
  247.  
  248.  
  249. soaking:
  250. put #log >training_%DATE.log @time@ ~ Soaking experience for 61 seconds
  251. put #log >training_%DATE.log @time@ ~ Appraisal maintenance is enabled
  252. var RESEARCH.LEARNINGRATE.MIN 25
  253. put #statusbar 2 Soaking
  254. pause 61
  255. gosub app
  256. put #log >training_%DATE.log @time@ ~ Soaking exp completed
  257. goto start
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264. ########################################################################################################
  265.  
  266.  
  267. empathy:
  268. put #log >training_%DATE.log @time@ ~ *** beginning health walking at %t seconds
  269. var START.TIME %t
  270. put #log >training_%DATE.log @time@ ~ starting empathy = $Empathy.Ranks ($Empathy.LearningRate/34)
  271. put #log >training_%DATE.log @time@ ~ starting appraisal = $Appraisal.Ranks ($Appraisal.LearningRate/34)
  272. put #log >training_%DATE.log @time@ ~ starting attunement = $Attunement.Ranks ($Attunement.LearningRate/34)
  273. put #log >training_%DATE.log @time@ ~ starting perception = $Perception.Ranks ($Perception.LearningRate/34)
  274. put #log >training_%DATE.log @time@ ~ starting outdoorsmanship = $Outdoorsmanship.Ranks ($Outdoorsmanship.LearningRate/34)
  275.  
  276. counter set 0
  277. move go gate
  278. move w
  279.  
  280. walking_loop:
  281. if $Empathy.LearningRate = 34 then
  282. {
  283. evalmath SECTION.RUNTIME %t - %START.TIME
  284. put #log >training_%DATE.log @time@ ~ *** completed health walking in %SECTION.RUNTIME seconds
  285. unvar SECTION.RUNTIME
  286. put #log >training_%DATE.log @time@ ~ ending empathy = $Empathy.Ranks ($Empathy.LearningRate/34)
  287. put #log >training_%DATE.log @time@ ~ ending appraisal = $Appraisal.Ranks ($Appraisal.LearningRate/34)
  288. put #log >training_%DATE.log @time@ ~ ending attunement = $Attunement.Ranks ($Attunement.LearningRate/34)
  289. put #log >training_%DATE.log @time@ ~ ending perception = $Perception.Ranks ($Perception.LearningRate/34)
  290. put #log >training_%DATE.log @time@ ~ ending outdoorsmanship = $Outdoorsmanship.Ranks ($Outdoorsmanship.LearningRate/34)
  291. action (research) off
  292. action (universal) off
  293. var RESEARCH.DISABLE null
  294. if %TRACK.EMPATHY = 1 then
  295. {
  296. var TRACK.EMPATHY 0
  297. evalmath TEMP round((%t - %EMPATHY.TIMER) / 34)
  298. put #var EMPATHY.TRAINING.TIME $EMPATHY.TRAINING.TIME|%TEMP
  299. put #var EMPATHY.TRAINING.TIME {#eval replacere("$EMPATHY.TRAINING.TIME","^\d+\|","")}
  300. evalmath EMPATHY.TRAINING.AVG round(($EMPATHY.TRAINING.TIME(0) + $EMPATHY.TRAINING.TIME(1) + $EMPATHY.TRAINING.TIME(2) + $EMPATHY.TRAINING.TIME(3) + $EMPATHY.TRAINING.TIME(4)) / 5)
  301. unvar TEMP
  302. }
  303. put #goto ntr
  304. waitfor You are before the Northeast Gate of the Crossing, surrounded
  305. var RESEARCH.SKILLMIN
  306. gosub finish_research
  307. goto start
  308. }
  309. if %c <= %TOTAL.ROOMS then
  310. {
  311. move %EMPATHY.PATH(%c)
  312. counter add 1
  313. }
  314. else
  315. {
  316. counter set 0
  317. goto walking_loop
  318. }
  319.  
  320. var RETURN.POINT empathy_return
  321. goto eval_research
  322. empathy_return:
  323. unvar RETURN.POINT
  324. gosub app
  325.  
  326. perc_health_retry:
  327. pause .5
  328. match perc_health_complete You close your eyes, drawing all your thoughts inward
  329. match perc_health_retry You're not ready to do that again, yet.
  330. put perc health
  331. matchwait
  332. perc_health_complete:
  333. pause
  334. pause .1
  335. put collect rock
  336. pause
  337. pause .1
  338. put kick pile
  339. match eval_standing Bringing your foot smashing down onto the pile,
  340. match eval_standing I could not find what you were referring to.
  341. matchwait
  342. eval_standing:
  343. if $standing != 1 then
  344. {
  345. put stand
  346. pause .25
  347. pause .25
  348. goto eval_standing
  349. }
  350. goto walking_loop
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357. ########################################################################################################
  358.  
  359.  
  360. magic:
  361. pause .25
  362. pause .25
  363. if %RESEARCH.STEPS != null then
  364. {
  365. if %RESEARCH.COMPLETE = 1 then
  366. {
  367. gosub research_loop_complete
  368. goto magic
  369. }
  370. if %RESEARCH.MORE = 1 then
  371. {
  372. gosub app
  373. gosub research_more
  374. }
  375. }
  376. else
  377. {
  378. var RESEARCH.SECONDS 300
  379. action (universal) off
  380. put rel gaf
  381. pause .25
  382. pause .25
  383. gosub sub_move WILLOWPONDPIER2NEGATE
  384. goto start
  385. }
  386. match magic Breakthrough!
  387. match magic However, there is still more to learn before you arrive at a breakthrough.
  388. matchwait
  389.  
  390.  
  391.  
  392.  
  393.  
  394. ########################################################################################################
  395.  
  396.  
  397. climb:
  398. put #log >training_%DATE.log @time@ ~ *** beginning athletics at %t seconds
  399. var START.TIME %t
  400. put #log >training_%DATE.log @time@ ~ starting athletics = $Athletics.Ranks ($Athletics.LearningRate/34)
  401. climb_loop:
  402. put climb practice rock
  403. waitfor You finish practicing your climbing skill and take a well-earned break.
  404. if $bleeding = 1 then gosub sub_tend
  405. if $Athletics.LearningRate = 34 then
  406. {
  407. goto climb_end
  408. }
  409. goto climb_loop
  410.  
  411. climb_pre_end:
  412. put stop climb
  413.  
  414. climb_end:
  415. action (universal) off
  416. action (climb) off
  417. evalmath SECTION.RUNTIME %t - %START.TIME
  418. put #log >training_%DATE.log @time@ ~ *** completed athletics in %SECTION.RUNTIME seconds
  419. unvar SECTION.RUNTIME
  420. put #log >training_%DATE.log @time@ ~ ending athletics = $Athletics.Ranks ($Athletics.LearningRate/34)
  421. gosub sub_move GROVE2NEGATE
  422. goto start
  423.  
  424.  
  425.  
  426.  
  427. ########################################################################################################
  428.  
  429.  
  430.  
  431. mech:
  432. put prep vigor %VIGOR.PREP
  433. waitfor %SPELL.MESSAGING
  434. put charge my %CAMB.LOWCAP.ITEM 16
  435. pause
  436. pause .1
  437. put charge my %CAMB.LOWCAP.ITEM 16
  438. pause
  439. pause .1
  440. put charge my %CAMB.LOWCAP.ITEM 16
  441. pause
  442. pause .1
  443. put invoke my %CAMB.LOWCAP.ITEM
  444. pause 5
  445. put cast
  446. waitfor You gesture
  447.  
  448. put #log >training_%DATE.log @time@ ~ *** beginning mech at %t seconds
  449. var START.TIME %t
  450. put #log >training_%DATE.log @time@ ~ starting mechanical lore = $Mechanical_Lore.Ranks ($Mechanical_Lore.LearningRate/34)
  451. put #log >training_%DATE.log @time@ ~ starting training with %PAPER.COUNT sheets of origami paper
  452.  
  453.  
  454. mech_start:
  455. if $Empathy.LearningRate < 15 or $Athletics.LearningRate < 10 then
  456. {
  457. put #log >training_%DATE.log @time@ ~ stopping mech early
  458. var TRACK.MECH 0
  459. goto mech_end
  460. }
  461.  
  462. if $Mechanical_Lore.LearningRate = 34 then goto mech_end
  463. evalmath ORIGAMI.FOLDS.AVG ($ORIGAMI.FOLDS.HISTORY(0) + $ORIGAMI.FOLDS.HISTORY(1) + $ORIGAMI.FOLDS.HISTORY(2) + $ORIGAMI.FOLDS.HISTORY(3) + $ORIGAMI.FOLDS.HISTORY(4) + $ORIGAMI.FOLDS.HISTORY(5) + $ORIGAMI.FOLDS.HISTORY(6) + $ORIGAMI.FOLDS.HISTORY(7) + $ORIGAMI.FOLDS.HISTORY(8) + $ORIGAMI.FOLDS.HISTORY(9)) / 10
  464. evalmath RESEARCH.SECONDS (%ORIGAMI.FOLDS.AVG * 10) - %ORIGAMI.AVG.OFFSET
  465. put pull my origami envelope
  466. waitfor You get a sheet of
  467.  
  468. evalmath PAPER.COUNT %PAPER.COUNT - 1
  469. if %PAPER.COUNT = 0 then
  470. {
  471. put #log >training_%DATE.log @time@ ~ using last sheet of origami paper
  472. var NEED.PAPER 1
  473. }
  474.  
  475. mech_research_wait:
  476. if %RESEARCH.COMPLETE = 1 or %RESEARCH.MORE = 1 or %RESEARCH.PROJECT.COMPLETE = 1 or %RESEARCH.SKIP = 1 then
  477. {
  478. var ORIGAMI.FOLDS.TMP 1
  479. put study my instructions
  480. pause
  481. pause .1
  482. }
  483. else
  484. {
  485. waitforre (B|b)reakthrough(\.|\!)$
  486. pause 1
  487. goto mech_research_wait
  488. }
  489.  
  490.  
  491. var RETURN.POINT mech_return
  492. goto eval_research
  493. mech_return:
  494. unvar RETURN.POINT
  495.  
  496. folding_loop:
  497. pause
  498. pause .1
  499. gosub app
  500.  
  501.  
  502. evalmath ORIGAMI.FOLDS.TMP %ORIGAMI.FOLDS.TMP + 1
  503. match paper_complete You make the final fold and gaze proudly at your new
  504. match folding_loop Roundtime:
  505. put fold my paper
  506. matchwait
  507.  
  508.  
  509. paper_complete:
  510. pause
  511. pause .1
  512. put exhale my $righthandnoun
  513. waitforre ^You exhale into your|^You find a hole in your
  514.  
  515. var ORIGAMI.FOLDS.TMP $ORIGAMI.FOLDS.HISTORY|%ORIGAMI.FOLDS.TMP
  516. eval ORIGAMI.FOLDS.TMP replacere("%ORIGAMI.FOLDS.TMP","^\d+\|","")
  517. put #var ORIGAMI.FOLDS.HISTORY %ORIGAMI.FOLDS.TMP
  518.  
  519.  
  520.  
  521. if %NEED.PAPER = 1 then
  522. {
  523. put #log >training_%DATE.log @time@ ~ origami paper needed
  524. put #log >training_%DATE.log @time@ ~ discarding old origami envelope
  525. put rem my origami envelope
  526. waitfor You remove an
  527. put poke my origami envelope
  528. waitfor You tear up the empty envelope and toss it away.
  529. put rummage my haversack
  530. waitfor You rummage through
  531. if matchre("%TEMP","an origami\-paper envelope") then
  532. {
  533. put #log >training_%DATE.log @time@ ~ found more paper in inventory
  534. put get my origami envelope
  535. waitfor You get
  536. put look in my origami envelope
  537. waitfor As you thumb through the envelope,
  538. put wear my origami envelope
  539. waitfor You attach an
  540. var NEED.PAPER 0
  541. }
  542. unvar TEMP
  543. }
  544. if %NEED.PAPER = 1 then
  545. {
  546. put #log >training_%DATE.log @time@ ~ out of origami paper
  547. var NEED.PAPER 0
  548. gosub finish_research
  549. var RESEARCH.SECONDS 300
  550. var RESEARCH.SKIP null
  551. gosub sub_move WILLOWPONDPIER2NEGATE
  552. goto origami_get_paper
  553. }
  554. goto mech_start
  555.  
  556.  
  557.  
  558. mech_end:
  559.  
  560. evalmath SECTION.RUNTIME %t - %START.TIME
  561. put #log >training_%DATE.log @time@ ~ *** completed mech in %SECTION.RUNTIME seconds
  562. unvar SECTION.RUNTIME
  563. put #log >training_%DATE.log @time@ ~ ending mechanical lore = $Mechanical_Lore.Ranks ($Mechanical_Lore.LearningRate/34)
  564. put #log >training_%DATE.log @time@ ~ ending training with %PAPER.COUNT sheets of origami paper
  565.  
  566. action (mech) off
  567. action (universal) off
  568. action (research) off
  569.  
  570. if %TRACK.MECH = 1 then
  571. {
  572. var TRACK.MECH 0
  573. evalmath TEMP round((%t - %MECH.TIMER) / 34)
  574. put #var MECH.TRAINING.TIME $MECH.TRAINING.TIME|%TEMP
  575. put #var MECH.TRAINING.TIME {#eval replacere("$MECH.TRAINING.TIME","^\d+\|","")}
  576. unvar TEMP
  577. }
  578.  
  579.  
  580.  
  581. var RESEARCH.SKILLMIN
  582. gosub finish_research
  583. put #statusbar 3
  584. var RESEARCH.SECONDS 300
  585. var RESEARCH.SKIP null
  586. gosub sub_move WILLOWPONDPIER2NEGATE
  587. goto start
  588. }
  589.  
  590.  
  591. ########################################################################################################
  592.  
  593.  
  594. perception:
  595. put #log >training_%DATE.log @time@ ~ *** beginning colleting at %t seconds
  596. var START.TIME %t
  597. put #log >training_%DATE.log @time@ ~ starting perception = $Perception.Ranks ($Perception.LearningRate/34)
  598. put #log >training_%DATE.log @time@ ~ starting outdoorsmanship = $Outdoorsmanship.Ranks ($Outdoorsmanship.LearningRate/34)
  599. put #log >training_%DATE.log @time@ ~ starting appraisal = $Appraisal.Ranks ($Appraisal.LearningRate/34)
  600.  
  601. perception_start:
  602. var RETURN.POINT perception_return
  603. goto eval_research
  604. perception_return:
  605. unvar RETURN.POINT
  606. gosub app
  607. put collect rock
  608. pause
  609. pause .1
  610. perception_standing:
  611. if $standing != 1 then
  612. {
  613. put stand
  614. pause .25
  615. pause .25
  616. goto perception_standing
  617. }
  618. put kick pile
  619. pause .25
  620. pause .25
  621.  
  622. if $Empathy.LearningRate < 20 or $Athletics.LearningRate < 15 then
  623. {
  624. goto perception_end
  625. }
  626. if $Perception.LearningRate > 32 and $Outdoorsmanship.LearningRate > 32 then
  627. {
  628. goto perception_end
  629. }
  630. goto perception_start
  631.  
  632. perception_end:
  633. evalmath SECTION.RUNTIME %t - %START.TIME
  634. put #log >training_%DATE.log @time@ ~ *** completed collecting in %SECTION.RUNTIME seconds
  635. unvar SECTION.RUNTIME
  636. put #log >training_%DATE.log @time@ ~ ending perception = $Perception.Ranks ($Perception.LearningRate/34)
  637. put #log >training_%DATE.log @time@ ~ ending outdoorsmanship = $Outdoorsmanship.Ranks ($Outdoorsmanship.LearningRate/34)
  638. put #log >training_%DATE.log @time@ ~ ending appraisal = $Appraisal.Ranks ($Appraisal.LearningRate/34)
  639. action (research) off
  640. action (universal) off
  641. var RESEARCH.SKILLMIN
  642. gosub finish_research
  643. gosub sub_move WILLOWPONDPIER2NEGATE
  644. goto start
  645.  
  646. ########################################################################################################
  647. app:
  648. if %t >= %APP.TIMER and $Appraisal.LearningRate < 34 then
  649. {
  650. put get my %GEMCONTAINER from my %GEMCONTAINERSTORAGE
  651. waitfor You get
  652. put open my %GEMCONTAINER
  653. waitforre ^(You open your|That is already open\.)
  654. put app my %GEMCONTAINER quick
  655. pause
  656. pause .1
  657. evalmath APP.TIMER %t + 61
  658. put close my %GEMCONTAINER
  659. waitfor You close your
  660. put put my %GEMCONTAINER in my %GEMCONTAINERSTORAGE
  661. waitfor You put
  662. }
  663. return
  664. ########################################################################################################
  665. ###
  666. origami_get_paper:
  667. put #log >training_%DATE.log @time@ ~ buying more origami paper
  668. action (wealth) on
  669. put wealth
  670. waitfor Wealth:
  671. action (wealth) off
  672. if %KRONARS >= 20000 then
  673. {
  674. gosub sub_move NEGATE2FERRY
  675. }
  676.  
  677. if %KRONARS < 20000 then
  678. {
  679. gosub sub_move NEGATE2TELLER
  680. put dep all
  681. put with 20 gold
  682. waitfor The clerk counts out 20 gold Kronars
  683. gosub sub_move TELLER2FERRY
  684. }
  685. unvar KRONARS
  686. gosub crossing_ferry
  687. gosub sub_move FERRY2ORIGAMI
  688. counter set 0
  689. origami_buy_loop:
  690. match origami_buy Cost: 12500 Kronars
  691. match origami_next You can buy this item if you like.
  692. put shop %ALPHA.NUMBER(%c) envelope on table
  693. matchwait
  694. origami_next:
  695. counter add 1
  696. goto origami_buy_loop
  697. origami_buy:
  698. put buy %ALPHA.NUMBER(%c) envelope on table
  699. waitfor The sales clerk hands you your origami-paper envelope.
  700. put put my origami envelope in my haversack
  701. waitfor You put your
  702. gosub sub_move ORIGAMI2FERRY
  703. gosub crossing_ferry
  704. gosub sub_move FERRY2NEGATE
  705. put #log >training_%DATE.log @time@ ~ buying more origami paper complete
  706. goto start
  707. ###
  708. ########################################################################################################
  709. # subs and functions related to movement around the city.
  710. ###
  711. sub_move:
  712. var NEGATE2OLDIMPERIALROAD n|n|n|ne|ne|n|nw|nw|n|n|ne|nw|n|n|nw|nw|n|n|n|ne|ne|ne|e|e|e|n|n|n|n|n|n|ne|go gate|n|ne|go gate|nw|nw|n|e|e|n|n|ne|n|e|e|ne|ne|nw|n|n|n|n|n|n|go bridge|n|n|ne|n|nw|nw|n|n|ne|ne|ne|n|n|ne|nw|n|n|n|ne|ne|ne|ne|n|nw|nw|nw|nw|go track|e|ne|e|ne|climb crater|go tube|ne|e|go tube|ne|go column|se
  713. var FERRY2NEGATE go square|ne|e|e|e|e|ne|go bridge|ne|e|n|n|n|e|e|ne|n|n|n|n|e|go gate
  714. var FERRY2ORIGAMI s|s|s|s|sw|sw|sw|sw|s|se|se|s|s|sw|sw|sw|s|se|sw|s|sw|s|s|se|se|sw|sw|sw|sw|s|sw|se|se|s|s|se|se|s|s|se|go gate|se|se|se|se|sw|sw|se|go tent
  715. var GROVE2NEGATE w|sw|s|go gate|e|e|e|e|e|e|e|e|e|e|e|n|e|n|n|e|e|e|go gate
  716. var NEGATE2FERRY go gate|w|s|s|s|s|sw|s|s|s|w|w|w|sw|go bridge|sw|w|w|w|w|sw|go pier
  717. var NEGATE2GROVE go gate|w|s|w|s|w|w|s|w|w|w|w|w|w|go bridge|w|w|w|w|go gate|go trail|ne|e
  718. var NEGATE2TELLER go gate|w|s|s|s|s|sw|s|s|s|w|w|w|go bank|go window
  719. var NEGATE2WILLOWPONDPIER n|n|n|ne|ne|n|nw|nw|n|n|ne|nw|n|n|e|down|down|go gate|n|n|n|n|e|e|e|ne|ne|e|n|e|e|ne|go pier
  720. var ORIGAMI2FERRY out|nw|ne|ne|nw|nw|nw|nw|go gate|nw|n|n|nw|nw|n|n|nw|nw|ne|n|ne|ne|ne|ne|nw|nw|n|n|ne|n|ne|nw|n|ne|ne|ne|n|n|nw|nw|n|ne|ne|ne|ne|n|n|n|n
  721. var TELLER2FERRY out|out|sw|go bridge|sw|w|w|w|w|sw|go pier
  722. var WILLOWPONDPIER2NEGATE sw|sw|w|w|s|w|sw|sw|w|w|w|s|s|s|s|go gate|up|up|w|s|s|se|sw|s|s|se|se|s|sw|sw|s|s|s
  723. var ROUTECOUNTER 0
  724. var ROUTE %$1|%$2|%$3|%$4|%$5|%$6|%$7|%$8|%$9
  725. eval ROUTE replacere("%ROUTE","\|\%","")
  726. eval ROUTEROOMS count("%ROUTE","|")
  727. pause .25
  728. move_loop:
  729. if %ROUTECOUNTER <= %ROUTEROOMS then
  730. {
  731. move %ROUTE(%ROUTECOUNTER)
  732. evalmath ROUTECOUNTER %ROUTECOUNTER + 1
  733. goto move_loop
  734. }
  735. sub_move_cleanup:
  736. unvar NEGATE2OLDIMPERIALROAD
  737. unvar FERRY2NEGATE
  738. unvar FERRY2ORIGAMI
  739. unvar GROVE2NEGATE
  740. unvar NEGATE2FERRY
  741. unvar NEGATE2GROVE
  742. unvar NEGATE2TELLER
  743. unvar NEGATE2WILLOWPONDPIER
  744. unvar ORIGAMI2FERRY
  745. unvar TELLER2FERRY
  746. unvar WILLOWPONDPIER2NEGATE
  747. unvar ROUTECOUNTER
  748. unvar ROUTE
  749. unvar ROUTEROOMS
  750. return
  751. ###
  752. ###
  753. crossing_ferry:
  754. match ferry_wait You will have to wait for the next one.
  755. match ferry_wait There is no ferry here to go aboard.
  756. match ferry_boarded You hand him your kronars and climb aboard.
  757. put go ferry
  758. matchwait
  759. ferry_wait:
  760. matchre crossing_ferry ^The ferry (Kertigen\'s Honor|Hodierna\'s Grace) pulls into the dock\.$
  761. match crossing_ferry You hear a bell ring out and a voice calling, "Next departure in 1 minute!"
  762. match crossing_ferry You hear a bell ring out three times and a voice calling, "All aboard who's going aboard!"
  763. matchwait
  764. ferry_boarded:
  765. waitforre ^The ferry (Kertigen\'s Honor|Hodierna\'s Grace) reaches the dock and its crew ties the ferry off\.$
  766. move go dock
  767. return
  768. ###
  769. ########################################################################################################
  770.  
  771. ###
  772. sub_tend:
  773. var BODY.PART
  774. var BODY.COUNTER 0
  775. action (FA) on
  776. put health
  777. waitfor Your body
  778. eval BODY.PART replacere("%BODY.PART","\|$","")
  779. eval BODY.MAX count("%BODY.PART","|")
  780. tend_loop:
  781. if %BODY.COUNTER <= %BODY.MAX then
  782. {
  783. put tend my %BODY.PART(%BODY.COUNTER)
  784. waitfor You work carefully at tending your wound.
  785. evalmath BODY.COUNTER %BODY.COUNTER + 1
  786. goto tend_loop
  787. }
  788. action (FA) off
  789. unvar BODY.PART
  790. unvar BODY.COUNTER
  791. unvar BODY.MAX
  792. return
  793. ###
  794. ########################################################################################################
  795. # subs and functions related to emergency situations.
  796. # All outcomes for emergency current result in existing character from the game.
  797. ###
  798. stunned:
  799. ###
  800. ###
  801. health_drop:
  802. action (emergency) off
  803. pause .1
  804. pause .1
  805. pause .1
  806. retreat:
  807. matchre retreat ^You retreat back to pole range\.$|are unable to get away|You try to back away
  808. matchre outofcombat ^You retreat from combat\.$|^You are already as far away as you can get\!$
  809. matchre health_drop \.\.\.wait|Roundtime|^You are still stunned\.$
  810. match abort_climbing You should stop practicing your Athletics skill before you do that.
  811. put retreat
  812. matchwait
  813. abort_climbing:
  814. put stop climb
  815. goto retreat
  816. outofcombat:
  817. ###
  818. ###
  819. dying:
  820. action (emergency) off
  821. put #queue clear
  822. put #send 1 exit
  823. put #script abort all
  824. pause 2
  825. exit
  826. ###
  827. ########################################################################################################
  828. ########################################################################################################
  829. # subs and functions related to researching.
  830. ###
  831. research_more:
  832. put research %RESEARCH.PLAN(%RESEARCH.COUNTER) %RESEARCH.SECONDS
  833. var RESEARCH.START.TIME %t
  834. put #statusbar 3 Researching - "%RESEARCH.PLAN(%RESEARCH.COUNTER)" for %RESEARCH.SECONDS seconds: @time@
  835. pause .25
  836. pause .25
  837. var RESEARCH.MORE 0
  838. return
  839. ###
  840. ###
  841. research_loop_complete:
  842. evalmath RESEARCH.COUNTER %RESEARCH.COUNTER + 1
  843. if %RESEARCH.COUNTER <= %RESEARCH.STEPS then
  844. {
  845. var RESEARCH.MORE 1
  846. var RESEARCH.COMPLETE 0
  847. return
  848. }
  849. else
  850. {
  851. put #log >training_%DATE.log @time@ ~ research project completed
  852. put #log >training_%DATE.log @time@ ~ primary magic = $Primary_Magic.Ranks ($Primary_Magic.LearningRate/34)
  853. put #log >training_%DATE.log @time@ ~ arcana = $Arcana.Ranks ($Arcana.LearningRate/34)
  854. put #log >training_%DATE.log @time@ ~ augmentation = $Augmentation.Ranks ($Augmentation.LearningRate/34)
  855. put #log >training_%DATE.log @time@ ~ utility = $Utility.Ranks ($Utility.LearningRate/34)
  856. put #log >training_%DATE.log @time@ ~ warding = $Warding.Ranks ($Warding.LearningRate/34)
  857. var RESEARCH.PROJECT.COMPLETE 1
  858. var RESEARCH.COUNTER 0
  859. var RESEARCH.STEPS null
  860. var RESEARCH.MORE null
  861. var RESEARCH.COMPLETE null
  862. var RESEARCH.SKIP null
  863. put #statusbar 3
  864. return
  865. }
  866. ###
  867. ###
  868. define_research_plan:
  869. put #log >training_%DATE.log @time@ ~ evaluating magic skills for research
  870. put #log >training_%DATE.log @time@ ~ primary magic = $Primary_Magic.Ranks ($Primary_Magic.LearningRate/34)
  871. put #log >training_%DATE.log @time@ ~ arcana = $Arcana.Ranks ($Arcana.LearningRate/34)
  872. put #log >training_%DATE.log @time@ ~ augmentation = $Augmentation.Ranks ($Augmentation.LearningRate/34)
  873. put #log >training_%DATE.log @time@ ~ utility = $Utility.Ranks ($Utility.LearningRate/34)
  874. put #log >training_%DATE.log @time@ ~ warding = $Warding.Ranks ($Warding.LearningRate/34)
  875. var RESEARCH.PLAN
  876. var RESEARCH.RETRY 0
  877. redefine_research_plan:
  878. if $Primary_Magic.LearningRate < %RESEARCH.LEARNINGRATE.MIN or $Arcana.LearningRate < %RESEARCH.LEARNINGRATE.MIN then
  879. {
  880. var RESEARCH.PLAN %RESEARCH.PLAN|fundamental
  881. put #log >training_%DATE.log @time@ ~ flagging fundamental(1)
  882. }
  883. if $Augmentation.LearningRate < %RESEARCH.LEARNINGRATE.MIN then
  884. {
  885. var RESEARCH.PLAN %RESEARCH.PLAN|augmentation
  886. put #log >training_%DATE.log @time@ ~ flagging augmentation
  887. }
  888. if $Utility.LearningRate < %RESEARCH.LEARNINGRATE.MIN then
  889. {
  890. var RESEARCH.PLAN %RESEARCH.PLAN|utility
  891. put #log >training_%DATE.log @time@ ~ flagging utility
  892. }
  893. if $Primary_Magic.LearningRate < 18 or $Arcana.LearningRate < 18 then
  894. {
  895. var RESEARCH.PLAN %RESEARCH.PLAN|fundamental
  896. put #log >training_%DATE.log @time@ ~ flagging fundamental(2)
  897. }
  898. if $Warding.LearningRate < %RESEARCH.LEARNINGRATE.MIN then
  899. {
  900. var RESEARCH.PLAN %RESEARCH.PLAN|warding
  901. put #log >training_%DATE.log @time@ ~ flagging warding
  902. }
  903. var RESEARCH.CHECK.TIME %t
  904. if matchre("%RESEARCH.PLAN","\|") then
  905. {
  906. var RESEARCH.LEARNINGRATE.MIN 12
  907. var RESEARCH.PROJECT.COMPLETE 0
  908. var RESEARCH.MORE 1
  909. var RESEARCH.COMPLETE 0
  910. var RESEARCH.COUNTER 0
  911. var RESEARCH.SKIP 0
  912. var RESEARCH.INVESTED.SECONDS 0
  913. if %RESEARCH.RETRY = 1 then
  914. {
  915. var RESEARCH.LEARNINGRATE.MIN 12
  916. put #log >training_%DATE.log @time@ ~ resetting default RESEARCH.LEARNINGRATE.MIN value
  917. }
  918. }
  919. else
  920. {
  921. put #log >training_%DATE.log @time@ ~ nothing to research
  922. var RESEARCH.STEPS null
  923. var RESEARCH.MORE null
  924. var RESEARCH.COMPLETE null
  925. var RESEARCH.PROJECT.COMPLETE null
  926. var RESEARCH.SKIP 1
  927. var RESEARCH.INVESTED.SECONDS null
  928. if %RESEARCH.RETRY != 1 then
  929. {
  930. var RESEARCH.LEARNINGRATE.MIN 24
  931. var RESEARCH.RETRY 1
  932. put #log >training_%DATE.log @time@ ~ trying again with higher RESEARCH.LEARNINGRATE.MIN value
  933. goto redefine_research_plan
  934. }
  935. put #log >training_%DATE.log @time@ ~ skipping research due to existing high training state
  936. var RESEARCH.LEARNINGRATE.MIN 12
  937. put #log >training_%DATE.log @time@ ~ resetting default RESEARCH.LEARNINGRATE.MIN value
  938. return
  939. }
  940. eval RESEARCH.PLAN replacere("%RESEARCH.PLAN","^\|","")
  941. put #log >training_%DATE.log @time@ ~ new research plan created: %RESEARCH.PLAN
  942. eval RESEARCH.STEPS count("%RESEARCH.PLAN","|")
  943. gaf:
  944. if %CAMB.HIGHCAP.WORN = 0 then
  945. {
  946. put get my %CAMB.HIGHCAP.ITEM
  947. waitfor You get a
  948. }
  949. gaf_cast_fail:
  950. put charge my %CAMB.HIGHCAP.ITEM 20
  951. pause
  952. pause .1
  953. put charge my %CAMB.HIGHCAP.ITEM 20
  954. pause
  955. pause .1
  956. put charge my %CAMB.HIGHCAP.ITEM 20
  957. pause
  958. pause .1
  959. put prep gaf %GAF.PREP
  960. waitfor %SPELL.MESSAGING
  961. var SPELL.PREPPED 0
  962. put charge my %CAMB.HIGHCAP.ITEM 20
  963. pause
  964. pause .1
  965. put invoke my %CAMB.HIGHCAP.ITEM 80
  966. pause
  967. pause .1
  968. if %SPELL.PREPPED = 1 then goto gaf_cast
  969. else
  970. {
  971. waitfor You feel fully prepared
  972. }
  973. gaf_cast:
  974. match gaf_cast_success A distracting flurry of blue and white mana momentarily blinds you.
  975. match gaf_cast_fail backfires
  976. put cast
  977. matchwait
  978. gaf_cast_success:
  979. if %CAMB.HIGHCAP.WORN = 0 then
  980. {
  981. put stow my %CAMB.HIGHCAP.ITEM
  982. waitfor You put
  983. }
  984. return
  985. ###
  986. ###
  987. finish_research:
  988. put #log >training_%DATE.log @time@ ~ evaluating research project progress
  989. if %RESEARCH.PROJECT.COMPLETE = 1 or %RESEARCH.SKIP = 1 then goto finish_research_done
  990. if %RESEARCH.COMPLETE != 1 then
  991. {
  992. evalmath TEMP %RESEARCH.INVESTED.SECONDS + (%t - %RESEARCH.START.TIME)
  993. if %TEMP >= 320 then
  994. {
  995. put #log >training_%DATE.log @time@ ~ invested too much time (%TEMP seconds) to abort -- completing research project
  996. put #statusbar 3 Finishing research project - %RESEARCH.PLAN(%RESEARCH.COUNTER)
  997. unvar TEMP
  998. goto complete_research
  999. }
  1000. if %TEMP < 320 then
  1001. {
  1002. put #log >training_%DATE.log @time@ ~ insufficient time invested in to project -- aborting
  1003. unvar TEMP
  1004. goto abort_research
  1005. }
  1006. }
  1007. else goto finish_research_done
  1008. complete_research:
  1009. if %RESEARCH.MORE = 1 then
  1010. {
  1011. var RESEARCH.MORE 0
  1012. goto complete_research_more
  1013. }
  1014. match finish_research_done Breakthrough!
  1015. match complete_research_more However, there is still more to learn before you arrive at a breakthrough.
  1016. matchwait
  1017. complete_research_more:
  1018. var RESEARCH.SECONDS 300
  1019. put research %RESEARCH.PLAN(%RESEARCH.COUNTER) %RESEARCH.SECONDS
  1020. pause .1
  1021. goto complete_research
  1022. abort_research:
  1023. put research cancel
  1024. pause .25
  1025. pause .25
  1026. put research cancel
  1027. pause .25
  1028. pause .25
  1029. put research cancel
  1030. pause .25
  1031. pause .25
  1032. finish_research_done:
  1033. put #log >training_%DATE.log @time@ ~ research completed
  1034. return
  1035. ###
  1036. ###
  1037. eval_research:
  1038. if %RESEARCH.STEPS != null then
  1039. {
  1040. if %RESEARCH.COMPLETE = 1 then gosub research_loop_complete
  1041. if %RESEARCH.MORE = 1 then gosub research_more
  1042. }
  1043. if %RESEARCH.PROJECT.COMPLETE = 1 or %RESEARCH.SKIP = 1 then
  1044. {
  1045. evalmath TEMP %RESEARCH.CHECK.TIME + 200
  1046. if $%RESEARCH.SKILLMIN(0).LearningRate < %RESEARCH.SKILLMIN(1) and %t >= %TEMP then
  1047. {
  1048. gosub define_research_plan
  1049. if %RESEARCH.MORE = 1 then gosub research_more
  1050. }
  1051. unvar TEMP
  1052. }
  1053. goto %RETURN.POINT
  1054. ###
  1055. ########################################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement