Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.07 KB | None | 0 0
  1. debug 0
  2.  
  3. ##USAGE##
  4.  
  5. if ("%1" = "help") then {
  6. put .artifice [#] [sigil] [item]
  7.  
  8. }
  9.  
  10. #########
  11.  
  12.  
  13. COUNTER set 1
  14. var count 3
  15. var sigil ab
  16. var item totem
  17.  
  18.  
  19.  
  20.  
  21. #rod or spell - OPTIMIZE THIS! Hard codes to 60 mana
  22. var imbue spell
  23.  
  24.  
  25. #place to put finished products so they don't mix
  26. var storageContainer bag
  27. var almanac 1
  28. ########################################################### DON'T EDIT BELOW THIS LINE #####################################################
  29.  
  30. if_1 then {
  31. if ("%1" <> "") then var count %1
  32. }
  33.  
  34. if_2 then {
  35. if ("%2" <> "") then var sigil %2
  36. }
  37.  
  38. if_3 then {
  39. if ("%3" <> "") then var item %3
  40. }
  41.  
  42. pause 10
  43.  
  44. StartEnchant:
  45. gosub verifyCount
  46. gosub verifyResources
  47. gosub setupVariables
  48. gosub setupActions
  49. gosub studyBook
  50. gosub setupItem
  51.  
  52. ChooseAction:
  53. #TODO: verify the goto choose action is needed. minor improvements if not.
  54. #It's there in case a secondary action can create the need for a different secondary action before the main action (scribe)
  55.  
  56. pause .05
  57. if ("$lefthandnoun" <> "") then gosub nortput stow left
  58. if (%needTrace = 1) then {
  59. gosub traceSigil
  60. }
  61.  
  62. if (%needFount = 1) then {
  63. gosub Get my fount
  64. gosub NoRTPut wave my fount at %item
  65. var needFount 0
  66. goto ChooseAction
  67. }
  68.  
  69. if (%needImbue = 1) then {
  70. gosub NORTPut stow left
  71. if ("%imbue" = "spell") then {
  72. gosub imbueSpell
  73. } else {
  74. gosub Get my i rod
  75. gosub Put wave my rod at %item
  76. gosub NoRTPut stow my rod
  77. }
  78. var needImbue 0
  79.  
  80. goto ChooseAction
  81. }
  82.  
  83. if (%needLoop = 1) then {
  84. gosub get my loop
  85. gosub put push %item with my loop
  86. var needLoop 0
  87. goto ChooseAction
  88. }
  89. if (%needFocus = 1) then {
  90. gosub nortput stop play
  91. gosub put focus %item
  92. var needFocus 0
  93. goto ChooseAction
  94. }
  95.  
  96. if (%needMeditate = 1) then {
  97. gosub nortput stop play
  98. gosub put meditate fount
  99. var needMeditate 0
  100. goto ChooseAction
  101. }
  102. if (%needFixFount = 1) then {
  103. put #echo red >ScriptLog no idea what to do here. Figure out how to fix the fount
  104. exit
  105. var needFixFount 0
  106. }
  107.  
  108. #good to scribe, nothing needs tweaking
  109. if ("$righthandnoun" <> "burin") then {
  110. gosub NoRTPut stow my $righthandnoun
  111. gosub get my burin
  112. }
  113. gosub Put scribe %item on braz with burin
  114.  
  115. goto ChooseAction
  116.  
  117. ImbueSpell:
  118. gosub Put release mana
  119. #cancel researches/songs
  120. gosub nortput pre
  121. gosub nortput pre
  122. matchre ImbueSpell.Cast ^You feel fully prepared to cast your spell
  123. matchre ImbueSpell ^You should stop playing before
  124. put prep imbue 15
  125. matchwait 45
  126. put #echo >ScriptLog IMBUE FAILED TO CAST, swapping to rod
  127. var imbue rod
  128. goto RETURN
  129.  
  130. ImbueSpell.Cast:
  131. if ($mana > 30) then {
  132. gosub put harn 16
  133. gosub put harn 16
  134. }
  135. matchre RETURN You need another
  136. matchre RETURN Roundtime
  137. matchre ImbueSpell backfire
  138. put cast %item on bra
  139. matchwait 5
  140. put #echo red >Scriptlog No match in ImbueSpell.cast
  141. goto ImbueSpell
  142.  
  143. return
  144.  
  145. ################################################# UTILITY FUNCTIONS ####################################
  146.  
  147.  
  148. setupVariables:
  149. var needLoop 0
  150. var needFocus 0
  151. var needTrace 0
  152. var needImbue 0
  153. var needFount 0
  154. var needFixFount 0
  155. var needMeditate 0
  156. return
  157.  
  158. setupActions:
  159. # crafting actions
  160. action var needFocus 1 when material struggles to accept the sigil scribing
  161. action var needLoop 1 when You notice many of the scribed sigils are slowly merging back into the totem's surface
  162. action var needMeditate 1 when The traced sigil pattern blurs before your eyes, making it difficult to follow
  163. action var needImbue 1 when Once finished you sense an imbue spell will be required to continue enchanting
  164. action goto finishup when With the enchanting process completed
  165. action var needTrace 1 when Sigils can be added to the artifact to continue crafting|You believe you can STUDY the sigil and then TRACE it on the unfinished item to prepare it for continued scribing
  166. action var needFount 1 when You need another mana fount to continue crafting a plain bone totem
  167.  
  168.  
  169. #error handling
  170. action goto resourceerror when You jot down some notes
  171. action goto error when You have no idea how to craft
  172. action send get my burin when You must be holding the burin to do that
  173. action goto reset when already enchanted, and further manipulation could damage it
  174. action goto reset when It does not seem possible to continue with the enchanting process, and you will need to start over
  175. action goto resource error when Perhaps finding suitable ingredients and studying some instructions would help
  176. #bonus skills - keep?
  177. action send play $playsong when You are already under
  178. return
  179.  
  180. studyBook:
  181. gosub CleanHands
  182. gosub Get art book
  183.  
  184. #double to account for potential research/playing blocking the first one
  185. gosub RTPut study art book
  186. gosub RTPut study art book
  187. gosub NoRTPut stow left
  188.  
  189. if (%almanac = 1) then {
  190. gosub NoRTPut stow left
  191. gosub get my alm
  192. gosub put study my alm
  193. gosub nortput stow my alm
  194. gosub CleanHands
  195. }
  196.  
  197. return
  198.  
  199. setupItem:
  200. #start crafting
  201. pause .05
  202. gosub Get my %item
  203. gosub NoRTPut put my %item on braz
  204. gosub NoRTPut put my %item on braz
  205. return
  206.  
  207. traceSigil:
  208. gosub cleanHands
  209. gosub Get my %sigil sigil
  210. gosub Put study my sigil
  211. gosub Put study my sigil
  212. gosub Put trace totem
  213. gosub put app focus art book
  214. var needTrace 0
  215. return
  216.  
  217. verifyCount:
  218. put #echo >ScriptLog enchanting %c / %count
  219. gosub nortput stow
  220.  
  221. return
  222.  
  223. verifyResources:
  224. #verify you have the sigil
  225. match resourceerror I could not find what you were referring to.
  226. match resourceerror You jot down some notes
  227. match RETURN You
  228. send tap %sigil sigil
  229. matchwait 10
  230. goto resourceerror
  231. return
  232.  
  233. ############################ Make a set of includes already - Stop being lazy ##############################
  234. Get:
  235. put get $0
  236. waitfor You
  237. return
  238.  
  239. NoRTPut:
  240. put $0
  241. wait
  242. return
  243.  
  244. Put:
  245. RTPut:
  246. var RTPut.command $0
  247. RTPutInternal:
  248. pause .025
  249. matchre RTPutInternal \.\.\ wait
  250. matchre RETURN Roundtime|What|You|That
  251. put %RTPut.command
  252. matchwait 10
  253. put #echo red >ScriptLog No match in PUT on %RTPut.command
  254. return
  255.  
  256. RETURN:
  257. return
  258.  
  259. ############################### ERROR HANDLING ################################
  260. reset:
  261. pause .05
  262. gosub CleanHands
  263. gosub get my %item
  264. gosub NoRTput put my %item in my bag
  265.  
  266. return
  267.  
  268. resourceerror:
  269. put #echo >ScriptLog out of resources
  270. goto Error
  271.  
  272. Error:
  273. put #echo error message goes here
  274. exit
  275.  
  276. BundleLogbook:
  277. gosub get my ench logbook
  278. gosub get my %item
  279. gosub nortput bundle my %item with my logbook
  280. gosub nortput put %item in my %storageContainer
  281. return
  282.  
  283. CleanHands:
  284. pause .05
  285. if ("$lefthandnoun" <> "") then gosub NoRTPut stow left
  286. if ("$righthandnoun" <> "") then gosub NoRTPut stow
  287. return
  288.  
  289. ########################################################
  290.  
  291. Finishup:
  292. pause .05
  293. gosub nortput stow
  294. gosub nortput stow left
  295. gosub bundleLogbook
  296. COUNTER ADD 1
  297. if (%c <= %count) then goto StartEnchant
  298.  
  299. #parse Artifice END
  300. put #echo >Scriptlog Artificing Finished
  301.  
  302. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement