YASSE Remedies (script)

From Elanthipedia
Jump to navigation Jump to search
YASSE Remedies (script)
Category Crafting,Alchemy
Front-end YASSE
Author Yamcer


Description

A suit of scripts for making remedies. You will need to make seperate files for the following scripts: Mortar, water, catalyst, ingredient, sieve, turn, and smell.
This version you will need to start with the book page studied and the starting herb in the mortar. The catalyst is set to use Seolarn. All tools and materials should be kept in a top level container and they will be stowed to be placed away.

Syntax

Run as .mortar

Updates

Version 1.0 - 8/11/2013

Script

Mortar

define global currentTool
define global currentProject
define variable startHERB
define variable secondHERB
define variable solvent
define variable catalyst

action "You need another splash of water to continue crafting" gosub WATER
action "You need another prepared herb to continue crafting" gosub INGREDIENT
action "You need another catalyst material to continue crafting" gosub CATALYST
action "Upon completion you see some particulate clouding up the mixture." goto SIEVE
action "As you finish, the mixture begins to transition colors." goto SMELL
action "Once finished you notice clumps of material forming on the edge of the mortar." goto TURN
action "Applying the final touches, you complete working on" goto COMPLETE

MORTAR:
match MORTARLOOK You are already holding that.
match MORTARLOOK You get a
match FULL You need a free hand to pick that up.
put get my mortar
matchwait 2

MORTARLOOK:
match END There is nothing in there.
match HERB mortar you see
put look in my mortar
matchwait

HERB:
getword -1
setglobalvariable currentProject %w
goto PEST

PEST:
setglobalvariable currentTool pestle
match CRUSHFIRST You are already holding that.
match CRUSHFIRST You get a
match FULL You need a free hand to pick that up.
put get my pest
matchwait 2

CRUSHFIRST:
match STUDY You cannot figure out how to do that.  Perhaps finding suitable ingredients and studying some instructions would help.
match DRY You believe that herb is best prepared by drying, and decide against crushing it.
match END Crush what?
match END You complete crushing the contents of the mortar into
match LOOK With short strokes you crush some
put crush my $currentProject$ with my pest
matchwait

LOOK:
match END There is nothing in there.
match PROJECT you see some unfinished
put look in my mortar
matchwait

PROJECT:
getword -1
setglobalvariable currentProject %w
goto ANALYZE

CRUSH:
match DRY You believe that herb is best prepared by drying, and decide against crushing it.
match END Crush what?
match END You complete crushing the contents of the mortar into
match CRUSH With short strokes you crush some
put crush my $currentProject$ with my pest
matchwait

ANALYZE:
match SMELL smell
match SIEVE sieve
match TURN turning
match CRUSH composition looks accurate and ready for continued preparation.
match CRUSH You do not see anything that would prevent
match CRUSH appears free of defects that would impede further preparation.
put analyze $currentProject$
matchwait 7
goto CRUSH

WATER:
call water
goto LOOK

INGREDIENT:
call ingredient
goto ANALYZE

CATALYST:
call catalyst
goto ANALYZE 

SIEVE:
call sieve
goto CRUSH

SMELL:
call smell
goto CRUSH

TURN:
call turn
goto CRUSH

COMPLETE:
echo :Script Echo: Project complete
EXIT

STUDY:
echo :Script Echo: Study the book first
EXIT

FULL:
put stow left
put stow right
goto mort

errorhandler:
echo :Script Echo: Error #$errornumber$ occurred on the line #$errorline$ : $line$
EXIT

Water

STOW:
match GETWATER You put your
put stow my $currentTool$
matchwait

GETWATER:
match POUR You are already holding that.
match POUR You get some water
match ERROR What were you referring to?
put get my water
matchwait 2
goto GETWATER

POUR:
match AWAY You toss the water into the
put put my water in my mort
matchwait

AWAY:
match ERROR Stow what?
match TOOL You put your water in your
put stow my water
matchwait

TOOL:
match End You are already holding that.
match END You get a
put get my $currentTool$
matchwait

ERROR:
echo :Script Echo: Something happened
waitfor "Script Continue"
return

END:
EXIT

errorhandler:
echo :Script Echo: Error #$errornumber$ occurred on the line #$errorline$ : $line$
EXIT

Catalyst

STOW:
match GETCATALYST You put your
put stow my $currentTool$
matchwait

GETCATALYST:
match PUT You are already holding that.
match PUT You get some
match ERROR What were you referring to?
put get my seol
matchwait 2
goto GETCATALYST

PUT:
match AWAY to scrape some shavings into the mixture.
put put my seol in my mort
matchwait 2
gosub ERROR

AWAY:
match ERROR Stow what?
match TOOL You put your
put stow my seol
matchwait

TOOL:
match END You get
Match END You are already holding that.
put get my $currentTool$
matchwait 4
gosub ERROR

ERROR:
echo :Script Echo: Something happened
waitfor "Script Continue"
return

END:
EXIT

errorhandler:
echo :Script Echo: Error #$errornumber$ occurred on the line #$errorline$ : $line$
EXIT

Ingredient

STOW:
match GETHERB You put your
put stow my $currentTool$
matchwait

GETHERB:
match PUT You are already holding that.
match PUT You get some water
put get my $secondHERB$
matchwait 2
goto GETWATER

PUT:
match AWAY xxxxxxx
put put my $secondHERB$ in my mort
matchwait

AWAY:
match ERROR Stow what?
match TOOL You put your
put stow my $secondHERB$
match 

TOOL:
match End You are already holding that.
match END You get a
put get my $currentTool$
matchwait

ERROR:
echo :Script Echo: Something happened
waitfor "Script Continue"
return

END:
EXIT

errorhandler:
echo :Script Echo: Error #$errornumber$ occurred on the line #$errorline$ : $line$
EXIT

Sieve

action "You need another splash of water to continue crafting" gosub WATER
action "You need another prepared herb to continue crafting" gosub INGREDIENT
action "You need another catalyst material to continue crafting" gosub CATALYST

STOW:
match GETSIEVE You put your
put stow my $currentTool$
matchwait

GETSIEVE:
match PUSH You are already holding that.
match PUSH You get a
put get my sieve
matchwait 2
goto GETSIEVE

PUSH:
match ERROR I could not find what you were referring to.
match AWAY through your sieve and toss away the accumulated debris
put push my $currentProject$ with my sieve
matchwait

WATER:
save $currentTool$
setglobalvariable currentTool sieve
call water
setglobalvariable currentTool %s
goto PUSH

CATALYST:
save $currentTool$
setglobalvariable currentTool sieve
call catalyst
setglobalvariable currentTool %s
goto PUSH

INGREDIENT:
save $currentTool$
setglobalvariable currentTool sieve
call ingredient
setglobalvariable currentTool %s
goto PUSH

AWAY:
match ERROR Stow what?
match TOOL You put your water in your
put stow my Sieve
matchwait:

TOOL:
match END You are already holding that.
match END You get a
put get my $currentTool$
matchwait

ERROR:
echo :Script Echo: Something happened
waitfor "Script Continue"
return

END:
Exit

errorhandler:
echo :Script Echo: Error #$errornumber$ occurred on the line #$errorline$ : $line$
EXIT

Turn

action "You need another splash of water to continue crafting" gosub WATER
action "You need another prepared herb to continue crafting" gosub INGREDIENT
action "You need another catalyst material to continue crafting" gosub CATALYST

TURN:
match ERROR I could not find what you were referring to.
match END about while scraping the
put turn my mort
matchwait

WATER:
call water
goto TURN

CATALYST:
call catalyst
goto TURN

INGREDIENT:
call ingredient
goto TURN

ERROR:
echo :Script Echo: Something happened
waitfor "Script Continue"
return

END:
Exit

errorhandler:
echo :Script Echo: Error #$errornumber$ occurred on the line #$errorline$ : $line$
EXIT

Smell

action "You need another splash of water to continue crafting" gosub WATER
action "You need another prepared herb to continue crafting" gosub INGREDIENT
action "You need another catalyst material to continue crafting" gosub CATALYST


SMELL:
match ERROR I could not find what you were referring to.
match END You sniff the mortar and determine it needs some time to set itself up.
put smell my $currentProject$
matchwait

WATER:
call water
goto SMELL

CATALYST:
call catalyst
goto SMELL

INGREDIENT:
call ingredient
goto SMELL

ERROR:
echo :Script Echo: Something happened
waitfor "Script Continue"
return

END:
Exit

errorhandler:
echo :Script Echo: Error #$errornumber$ occurred on the line #$errorline$ : $line$
EXIT