The Evolution of a Script:




All scripts evolve over time, It's a fact. Any script you ever make will go through several stages as you decide you want it to do this or that, etc etc. Below is a script that starts with simply foraging and dropping Jadice Flowers, and evolves into a more complex script as the maker decides they want it to do different things for them.

FORAGE:
.....match DROP You manage
.....match FORAGE roundtime
put FORAGE Jad Flo
.....matchwait

DROP:
put drop my flow
waitfor you drop
goto FORAGE

This Script simply forages continuously, and of course with dropping the flowers the room may get cluttered, and it doesn't check experience so you have to take care of these things manually. Well being lazy the way we humans are, let's make it handle these things for us. Below, the script has evolved to check our experience and stop foraging when we're mind locked, as well as making sure to put the flowers in a bucket to keep the room from being cluttered. It's also set up to pause if the room ends up cluttered anyway from other foragers.

FORAGE:
.....match WAIT clutter
.....match DROP You manage
.....match FORAGE roundtime
put forage Jad Flo
.....matchwait

DROP:
put put my flow in bucket
waitfor you
goto EXP

EXP:
.....match WAIT mind lock
.....match FORAGE more information
put exp foraging
.....matchwait

WAIT:
pause 30
goto EXP

Since the above script only pauses when you are mind locked, and starts up immediately when you drop below mind lock, it's not really optimized for max experience gain. Below, the script has evolved in the interest of better experience and will wait until you're experience drops below bewildering before foraging again after you mind lock. Also it seems other people are cluttering the room more often than we'd like, so the script will now cast Compost (assuming you are a ranger) whenever the room is cluttered. If you aren't a ranger, you can always alter the composting section to pull out a leaf charm (if you have one) and use it to cast compost.

FORAGE:
.....match COMPOST clutter
.....match DROP You manage
.....match FORAGE roundtime
put forage Jad Flo
.....matchwait

COMPOST:
put prep compost 10
waitfor you feel fully
put cast
goto FORAGE

DROP:
put put my flow in bucket
waitfor you
goto EXP

EXP:
.....match WAIT mind lock
.....match FORAGE more information
put exp foraging
.....matchwait
WAIT:
pause 30
goto EXP_CHECK

EXP_CHECK:
.....match WAIT dazed
.....match WAIT bewilder
.....match WAIT mind lock
.....match FORAGE more information
put exp foraging
matchwait

Well, we've now decided that just sitting there waiting for our mind state to go down isn't very productive of us, so we're going to start hiding while we wait, that way we can gain in a second skill instead of sitting like a bump on a log.

FORAGE:
.....match COMPOST clutter
.....match DROP You manage
.....match FORAGE roundtime
put forage Jad Flo
.....matchwait

COMPOST:
put prep compost 10
waitfor you feel fully
put cast
goto FORAGE

DROP:
put put my flow in bucket
waitfor you
goto EXP

EXP:
.....match WAIT mind lock
.....match FORAGE more information
put exp foraging
.....matchwait

WAIT:
put hide
pause
put unhide
put hide
pause
put unhide
put hide
pause
put unhide
goto EXP_CHECK

EXP_CHECK:
.....match WAIT dazed
.....match WAIT bewilder
.....match WAIT mind lock
.....match FORAGE more information
put exp foraging
.....matchwait

Once again we've decided the script just isn't optimized for maximum experience gain. So now instead of simply hiding a few times while we wait for our foraging experience to go down, we're going to start actively training hiding. Checking experience, waiting for mind lock, then switch back to foraging and repeat.

FORAGE:
.....match COMPOST clutter
.....match DROP You manage
.....match FORAGE roundtime
put forage Jad Flo
.....matchwait

COMPOST:
put prep compost 10
waitfor you feel fully
put cast
goto FORAGE

DROP:
put put my flow in bucket
waitfor you
goto EXP

EXP:
.....match HIDE mind lock
.....match FORAGE more information
put exp foraging
.....matchwait

HIDE:
put unhide
.....match HIDE_EXP you melt
.....match HIDE_EXP eh?
.....match HIDE roundtime
put hide
.....matchwait

HIDE_EXP:
.....match FORAGE mind lock
.....match HIDE more information
put exp hiding
.....matchwait

From here we can go in many different directions. It's quite obvious that this script can do much more, and that training only two skills can be a bit boring. You can set up a section for practicing magical devices, or maybe instead of practicing hiding where you are you want it to run to the bank and practice? The possibilities are quite endless. This Evolution process is how many of our massive "train every skill" scripts were created. We just link on different sections, alter a method of how this skill is trained, etc etc, until we have a script that does everything we want it to.

Now, what have we learned today? You just witnessed 1 line "put forage" become a short but very effective script for training foraging and hiding. These steps you just saw are all you need to make a script. Here's the interesting thing though, that script up there is actually TWO scripts, a hiding script and foraging script, they simply link up instead of pausing. And the point? EVERY SINGLE MAJOR SCRIPT is simply a bunch of smaller scripts that are linked together.


The main problem I've seen with people who just start making scripts, is they feel the need to start big. They want to create these monsters that can train any skill and do anything for them, because those are the kinds of scripts they see most often, the kind of scripts people share. We don't share our small little pissant scripts, the ones we use every day that are only 10 lines long. The perfect example is the one script every master has.

Get.cmd

*grins*
Sure it may have a different name, but I bet most of us use the name 'get' for it. And it goes something like this.

GET:
.....match STOW you pick up
.....match STOW2 you get
.....match DONE I could not
put get %1
.....matchwait

STOW:
put stow %1
goto GET

STOW2:
put stow %1
goto DONE

DONE:
exit

It's my simplest and most used script, and who's going to post a script like this? Anyone can make it in like 30 seconds, so why bother? That's what we think. SO the newbie scripters go and see what's out there and see these huge massive things that we've poured weeks or months into, the all nighters we pull trying to get text strings so that it won't hang on us, the mind bending twists and turns we have to take in order to make a match table that covers ALL 80 possibilities when we can only use exact text for 32. Beginners see these huge scripts and think to themselves "My god how am I going to do that?" I remember thinking the same thing myself the first time I looked at a training script (altskills.cmd) then I came across a hunting script (mastercombat.cmd).. I nearly gave up scripting that day, it looked impossible.

What I'm trying to show here though is every script begins with a single line. Even the hunting scripts (put parry). A script is simply putting down what you want to do in the game, you take it one command at a time. This leads to that, that leads to this, and so forth and so on. If any of you have looked at EZhunter, the script is huge, confusing, twisted, and moves through itself like the Labyrinth and the guiding hand of the Goblin King, and it all started with "put parry." But I knew where I wanted to go from there, straight from "put parry" to "put jab" then right to "put draw".

PARRY:
.....match JAB roundtime
.....match parry ...wait
.....match parry type ahead
put parry
.....matchwait

JAB:
.....match DRAW Roundtime
.....match JAB ...wait
.....match JAB type ahead
put jab
.....matchwait

DRAW:
.....match PARRY roundtime
.....match DRAW ...wait
.....match DRAW type ahead
put draw
.....matchwait

And EZhunter was born.

75% of scripting is simply knowing what you want to do, and finding the text strings that will bring you there, the other 25% is typing it out.

What script will YOU make?