PDA

View Full Version : Crafting & Forging Scripts for StormFront



Fengus
12-20-2004, 07:51 PM
This is my crafting script, its pretty solid but if you run into any problems just post an output of what was happening before and during the problem. I have embedded echos to help debugging so its easy to tell whats going on during any failure.

This script is currently designed for one purpose, that is gaining ranks in crafting, by building hammers and then discarding them. If you want a script to help you make a good quality mithril hammer or something else do not use this (unless you want to modifiy a few lines) since it throws every completed hammer away.


To use the script download the file, open up the script editor by creating a new script, name it, then copy paste this entire file from (notepad or whatever) into the script editor's screen, then save it.

After that you must run it with some parameters to set it up for your use, here is the info:

# %headMaterial stores the head material
# %handleMaterial stores the handle material
# %storage is for storing the best creations
# %trash is the trash container

You can create and assign these variables by running the script with the variables in order, for instance:

.craft "bronze bar" "maoral block" backpack bin

(Note the quotes for the multiword variables.)

Thereafter you won't need to set them unless they change, and most times it will be easier to change them in the interface supplied with SF.

Also as I alluded to earlier nothing is stored yet so the storage variable is not used in this version.


Eventually this script will coincide with my forging script so you could automate the entire process and save good contructions but I won't bother coding that until I need it, and since special metals aren't widely available I have no need to.


The forging script works in a similar manner. But is much less debugged since I restarted my character and have no yet restarted learning to forge.

Here are the variables from the forging script:

# %headMaterial stores the head material
# %handleMaterial stores the handle material
# %headGlyph stores the head material
# %handleGlyph stores the handle material
# %storage is for storing the best creations
# %trash is the trash container

[Edited on 12-21-2004 by Fengus]

There are new variables in the crafting script for version 1.04 they are:
# %headMaterial stores the head material
# %handleMaterial stores the handle material
# %headMaterialFull stores the head material
# %handleMaterialFull stores the handle material
# %storage is for storing the best creations
# %trash is the trash container

The new ones are to address an issue with some metals that have their full names used in some cases. (For instance "heavy mithril slab" is a full name, and is used to matches with glance I believe and some other cases.) This is most likely a bug or poor design and may, or may already have been fixed, but in that event the Full variables would match the others and the script will work as before.

The forging script has been updated and mostly debugged. But as with the crafting script best creations would be recognized but no special action is taken, the code is commented out but should work if you wish to enable it.

Once I've completed the scripts I will enable those sections by default but they are untested so I leave them out for now.


And with that I will leave you with this final thought:
>artisan
You feel that you are a master at the art of forging two-handed weapons.
You feel that you are a master at the art of forging one-handed edged weapons.
You feel that you are a master at the art of crafting.



[Edited on 6-18-2005 by Fengus]

Fengus
06-18-2005, 03:39 AM
Badass scripts like these should be pinned.

Ebondale
06-18-2005, 03:44 AM
Heck of a bump, there. I haven't used this script myself, but I just wanted to say that I do agree with you. I'd like to see a pinned topic full of outstanding scripts.

hectomaner
06-18-2005, 01:02 PM
you are awesome

Dwarven Empath
06-18-2005, 03:05 PM
Is there a scipt like those for the wizard?

hectomaner
06-19-2005, 12:34 AM
i plan on converting it for wizard monday at work so i can use it while i'm working, so i will post it then if nobody beats me to it

Dwarven Empath
07-02-2005, 06:54 AM
post the script for the wizard FE...

Delirium
07-26-2005, 12:48 AM
Did anyone convert these for the wizard fe yet?

hectomaner
07-31-2005, 11:34 PM
for wizard

usage is like this:

.craft bar block "bronze bar" "maoral block" backpack bin

or whatever bar/blocks you use







# v1.04
# %1 is the head material, i.e. ‘bar’
# %2 stores the handle material, i.e. ‘block’
# %3 stores the head material full, i.e. ‘bronze bar’
# %4 stores the handle material full, i.e. ‘maoral block’
# %5 is for storing the best creations, i.e. ‘backpack’
# %6 is the trash container, i.e. ‘bin’
# so, it would be .craft bar block “bronze bar” “maoral block” backpack bin

pause
put stow right
pause
put stow left

startHead:
match craftHead i could not find
match polishHead tap a rough
match startHandle tap a finished
pause
put tap my hammer-head
matchwait

startHandle:
match craftHandle What were you referring to?
match polishHandle tap a rough
match viseHammer tap a finished
pause
put tap my hammer-handle
matchwait


craftHead:
match craftHeadSwap in your right hand and nothing in your left hand
match craftHeadGet You glance down at your empty hands.
match craftHeadGlyph a ground %1 in your left hand
match craftHeadGlyph a leftover %1 in your left hand
match craftHeadGlyph a %3 in your left hand
match grindHead a scribed %1 in your left hand
match polishHead a rough
pause
put glance
matchwait

craftHeadSwap:
pause
put swap
waitfor You swap your
goto craftHead

craftHeadGet:
match craftHeadSwap You remove
match craftHeadSwap You pick up
match craftHeadGetError Get what?
pause
put get %1
matchwait
craftHeadGetError:
echo Error: Failed to get %1!
exit

craftHeadGlyph:
match grindHead Your material is marked with a pattern,
match craftHeadToss and realize it is too small.
pause
put stare head
matchwait

craftHeadToss:
pause
put put my %1 in %6
waitfor As you place
goto craftHeadGet


polishHead:
match polishHeadSwap To finish a part at the polisher you need to hold it in your left hand.
match polishHeadComplete You give the polishing wheel a shove to set it spinning
match polishHeadGet Your hands are empty!
match grindHead The piece you intend to polish has not been shaped at the grinder.
match timer doesn't budge!
pause
put lean polisher
matchwait

polishHeadSwap:
pause
put swap
waitfor You swap your
goto polishHead

polishHeadComplete:
# Uh oh, something's changed since you started grinding! You'll need to start again. Sorry about that.
pause 5
put stow left
goto startHandle

polishHeadGet:
pause
put get my hammer-head
goto polishHead


grindHead:
match grindHeadComplete You nod, satisfied with the piece you've created.
match grindHeadCompleteBest smile as you realize that this piece is the very best
match grindHeadToothpick *SCREEEECH*
match craftHeadGlyph You decide the safest thing to do now is to re-scribe
match timer doesn't budge!
pause
put turn grinder
matchwait

grindHeadComplete:
pause
put stow right
pause
put swap
waitfor You swap
goto polishHead

grindHeadCompleteBest:
pause
put stow right
pause
put open %5
put put left in %5
put close %5
waitfor You close

goto craftHead

grindHeadToothpick:
pause
put put my toothpick in %6
waitfor As you place
goto craftHead


craftHandle:
match craftHandleSwap in your right hand and nothing in your left hand
match craftHandleGet empty hands
match craftHandleGlyph a ground %2 in your left hand
match craftHandleGlyph a leftover %2 in your left hand
match craftHandleGlyph a %4 in your left hand
match grindHandle a scribed %2 in your left hand
match polishHandle a rough
pause
put glance
matchwait

craftHandleSwap:
pause
put swap
waitfor You swap your
goto craftHandle

craftHandleGet:
match craftHandleSwap You remove
match craftHandleSwap You pick up
match craftHandleGetError Get what?
pause
put get %2
matchwait
craftHandleGetError:
echo Error: Failed to get %2!
exit

craftHandleGlyph:
match grindHandle Your material is marked with a pattern,
match craftHandleToss and realize it is too small.
pause
put stare handle
matchwait

craftHandleStow:
pause
put stow right
waitfor You stow
goto polishHandle

craftHandleToss:
pause
put put my %2 in %6
waitfor As you place
goto craftHandleGet


polishHandle:
match polishHandleSwap To finish a part at the polisher you need to hold it in your left hand.
match polishHandleComplete You give the polishing wheel a shove
match polishHandleGet Your hands are empty!
match grindHandle The piece you intend to polish has not been shaped at the grinder.
match timer doesn't budge!
pause
put lean polisher
matchwait

polishHandleSwap:
pause
put swap
waitfor You swap your
goto polishHandle

polishHandleComplete:
pause 5
put stow left
goto viseHammer

polishHandleGet:
pause
put get my hammer-handle
goto polishHandle


grindHandle:
match grindHandleComplete You nod, satisfied with the piece you've created.
match grindHandleCompleteBest smile as you realize that this piece is the very best
match grindHandleToothpick *SCREEEECH*
match craftHandleGlyph You decide the safest thing to do now is to re-scribe
match timer doesn't budge!
pause
put turn grinder
matchwait

grindHandleComplete:
pause
put stow right
pause
put swap
waitfor You swap
goto polishHandle

grindHandleCompleteBest:
pause
put stow right
pause
put open %5
put put left in %5
put close %5
waitfor You close
goto craftHandle

grindHandleToothpick:
pause
put put my toothpick in %6
waitfor As you place
goto craftHandle


viseHammer:
match viseHeadGet You glance down at your empty hands.
match viseHeadGet hammer-handle in your left hand.
match viseHeadGet hammer-handle in your right hand and nothing in your left hand.
match viseHandleGet hammer-head in your left hand.
match viseHandleGet hammer-head in your right hand and nothing in your left hand.
match viseTurn hammer-handle in your right hand and a finished
match viseTurn hammer-head in your right hand and a finished
match viseComplete forging-hammer
pause
put glance
matchwait

viseHeadGet:
match viseTurn You remove
match viseTurn already
match startHead Get what?
echo [viseHeadGet: get my hammer-head]
pause
put get my hammer-head
matchwait

viseHandleGet:
match viseTurn You remove
match viseTurn already
match startHead Get what?
pause
put get my hammer-handle
matchwait

viseTurn:
match viseSwap You need to be holding the blade or head part in your left hand
match viseComplete You nod, satisfied with the piece you've created.
match viseCompleteBest You smile as you realize that this piece is
match viseComplete *SNAP*
match viseRedo You decide the safest thing to do now is to re-set
match viseHammer Your hands are empty!
match viseHammer (pssst...your left hand is empty!)
match viseHammer (pssst...your right hand is empty!)
match timer doesn't budge!
pause
put turn vise
matchwait

viseSwap:
pause
put swap
waitfor You swap a
goto viseTurn

viseComplete:
pause
put put my forging in %6
waitfor As you place
goto startHead

viseCompleteBest:
pause
put open %5
put put right in %5
put close %5
waitfor You close
goto startHead

viseRedo:
pause
goto viseTurn

timer:
echo Time is up!
exit

Makkah
08-01-2005, 11:46 PM
This hang up and not work for anyone else? It does me, and we can't figure out why the fuck it doesn't work.

Artha
08-01-2005, 11:58 PM
If you're copy/pasting from Hecto, it's probably because the boards add a space at the end of lines, which might be fucking up a match somewhere.

Heshinar
09-18-2005, 12:48 PM
I have been trying to figure out why the script hangs for me...

You glance down to see nothing in your right hand and a leftover bronze bar in your left hand.

It Hangs but it should got to "Craftheadglyph" I believe


Any ideas?


[Edited on 9-18-2005 by Heshinar]

[Edited on 9-18-2005 by Heshinar]

Kriterian
09-23-2005, 08:51 AM
Originally posted by Heshinar
I have been trying to figure out why the script hangs for me...

[Edited on 9-18-2005 by Heshinar]

[Edited on 9-18-2005 by Heshinar]

See what Arkans said above. You can't copy/paste text directly from the boards because it adds a space, which screws up the match command.

You'll need to manually go through it and eliminate all extra spaces.

Gigantuous
10-05-2005, 05:54 AM
Yeah...I haven't even tried the forging script yet, but the crafting one hangs after:


[Script craft2 is running, Esc to cancel, Shift-Esc to pause]
You are not holding anything in your right hand.
>
[startHead: put tap my hammer-head]
You can't put your bar in the black leather warcloak, it's closed!
>
I could not find what you were referring to.


I never even set my warcloak as one of the variables, so I have no idea why it's trying to put anything in there anyway.