Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- debug 0
- ##USAGE##
- if ("%1" = "help") then {
- put .artifice [#] [sigil] [item]
- }
- #########
- COUNTER set 1
- var count 3
- var sigil ab
- var item totem
- #rod or spell - OPTIMIZE THIS! Hard codes to 60 mana
- var imbue spell
- #place to put finished products so they don't mix
- var storageContainer bag
- var almanac 1
- ########################################################### DON'T EDIT BELOW THIS LINE #####################################################
- if_1 then {
- if ("%1" <> "") then var count %1
- }
- if_2 then {
- if ("%2" <> "") then var sigil %2
- }
- if_3 then {
- if ("%3" <> "") then var item %3
- }
- pause 10
- StartEnchant:
- gosub verifyCount
- gosub verifyResources
- gosub setupVariables
- gosub setupActions
- gosub studyBook
- gosub setupItem
- ChooseAction:
- #TODO: verify the goto choose action is needed. minor improvements if not.
- #It's there in case a secondary action can create the need for a different secondary action before the main action (scribe)
- pause .05
- if ("$lefthandnoun" <> "") then gosub nortput stow left
- if (%needTrace = 1) then {
- gosub traceSigil
- }
- if (%needFount = 1) then {
- gosub Get my fount
- gosub NoRTPut wave my fount at %item
- var needFount 0
- goto ChooseAction
- }
- if (%needImbue = 1) then {
- gosub NORTPut stow left
- if ("%imbue" = "spell") then {
- gosub imbueSpell
- } else {
- gosub Get my i rod
- gosub Put wave my rod at %item
- gosub NoRTPut stow my rod
- }
- var needImbue 0
- goto ChooseAction
- }
- if (%needLoop = 1) then {
- gosub get my loop
- gosub put push %item with my loop
- var needLoop 0
- goto ChooseAction
- }
- if (%needFocus = 1) then {
- gosub nortput stop play
- gosub put focus %item
- var needFocus 0
- goto ChooseAction
- }
- if (%needMeditate = 1) then {
- gosub nortput stop play
- gosub put meditate fount
- var needMeditate 0
- goto ChooseAction
- }
- if (%needFixFount = 1) then {
- put #echo red >ScriptLog no idea what to do here. Figure out how to fix the fount
- exit
- var needFixFount 0
- }
- #good to scribe, nothing needs tweaking
- if ("$righthandnoun" <> "burin") then {
- gosub NoRTPut stow my $righthandnoun
- gosub get my burin
- }
- gosub Put scribe %item on braz with burin
- goto ChooseAction
- ImbueSpell:
- gosub Put release mana
- #cancel researches/songs
- gosub nortput pre
- gosub nortput pre
- matchre ImbueSpell.Cast ^You feel fully prepared to cast your spell
- matchre ImbueSpell ^You should stop playing before
- put prep imbue 15
- matchwait 45
- put #echo >ScriptLog IMBUE FAILED TO CAST, swapping to rod
- var imbue rod
- goto RETURN
- ImbueSpell.Cast:
- if ($mana > 30) then {
- gosub put harn 16
- gosub put harn 16
- }
- matchre RETURN You need another
- matchre RETURN Roundtime
- matchre ImbueSpell backfire
- put cast %item on bra
- matchwait 5
- put #echo red >Scriptlog No match in ImbueSpell.cast
- goto ImbueSpell
- return
- ################################################# UTILITY FUNCTIONS ####################################
- setupVariables:
- var needLoop 0
- var needFocus 0
- var needTrace 0
- var needImbue 0
- var needFount 0
- var needFixFount 0
- var needMeditate 0
- return
- setupActions:
- # crafting actions
- action var needFocus 1 when material struggles to accept the sigil scribing
- action var needLoop 1 when You notice many of the scribed sigils are slowly merging back into the totem's surface
- action var needMeditate 1 when The traced sigil pattern blurs before your eyes, making it difficult to follow
- action var needImbue 1 when Once finished you sense an imbue spell will be required to continue enchanting
- action goto finishup when With the enchanting process completed
- 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
- action var needFount 1 when You need another mana fount to continue crafting a plain bone totem
- #error handling
- action goto resourceerror when You jot down some notes
- action goto error when You have no idea how to craft
- action send get my burin when You must be holding the burin to do that
- action goto reset when already enchanted, and further manipulation could damage it
- action goto reset when It does not seem possible to continue with the enchanting process, and you will need to start over
- action goto resource error when Perhaps finding suitable ingredients and studying some instructions would help
- #bonus skills - keep?
- action send play $playsong when You are already under
- return
- studyBook:
- gosub CleanHands
- gosub Get art book
- #double to account for potential research/playing blocking the first one
- gosub RTPut study art book
- gosub RTPut study art book
- gosub NoRTPut stow left
- if (%almanac = 1) then {
- gosub NoRTPut stow left
- gosub get my alm
- gosub put study my alm
- gosub nortput stow my alm
- gosub CleanHands
- }
- return
- setupItem:
- #start crafting
- pause .05
- gosub Get my %item
- gosub NoRTPut put my %item on braz
- gosub NoRTPut put my %item on braz
- return
- traceSigil:
- gosub cleanHands
- gosub Get my %sigil sigil
- gosub Put study my sigil
- gosub Put study my sigil
- gosub Put trace totem
- gosub put app focus art book
- var needTrace 0
- return
- verifyCount:
- put #echo >ScriptLog enchanting %c / %count
- gosub nortput stow
- return
- verifyResources:
- #verify you have the sigil
- match resourceerror I could not find what you were referring to.
- match resourceerror You jot down some notes
- match RETURN You
- send tap %sigil sigil
- matchwait 10
- goto resourceerror
- return
- ############################ Make a set of includes already - Stop being lazy ##############################
- Get:
- put get $0
- waitfor You
- return
- NoRTPut:
- put $0
- wait
- return
- Put:
- RTPut:
- var RTPut.command $0
- RTPutInternal:
- pause .025
- matchre RTPutInternal \.\.\ wait
- matchre RETURN Roundtime|What|You|That
- put %RTPut.command
- matchwait 10
- put #echo red >ScriptLog No match in PUT on %RTPut.command
- return
- RETURN:
- return
- ############################### ERROR HANDLING ################################
- reset:
- pause .05
- gosub CleanHands
- gosub get my %item
- gosub NoRTput put my %item in my bag
- return
- resourceerror:
- put #echo >ScriptLog out of resources
- goto Error
- Error:
- put #echo error message goes here
- exit
- BundleLogbook:
- gosub get my ench logbook
- gosub get my %item
- gosub nortput bundle my %item with my logbook
- gosub nortput put %item in my %storageContainer
- return
- CleanHands:
- pause .05
- if ("$lefthandnoun" <> "") then gosub NoRTPut stow left
- if ("$righthandnoun" <> "") then gosub NoRTPut stow
- return
- ########################################################
- Finishup:
- pause .05
- gosub nortput stow
- gosub nortput stow left
- gosub bundleLogbook
- COUNTER ADD 1
- if (%c <= %count) then goto StartEnchant
- #parse Artifice END
- put #echo >Scriptlog Artificing Finished
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement