 |
Jesman Beginner
Joined: 10 May 2002 Posts: 23 Location: USA
|
Posted: Tue May 27, 2003 3:03 am
DragonRealms Newbie Script Help |
I'm very new at script writing and have a VERY newbie question....
What do I do (or how do I start) to start the Script Editor?
I've read the help files and they are very informative on using a lot of the functions of ZMud but I don't see where or how to turn on the script editor.
Jesman |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue May 27, 2003 4:07 am |
To start the Settings Editor, open a character then click any of these buttons:
Settings
Classes
Aliases
Variables
Paths
Triggers
Macros
Buttons
LightBulb
Advanced Member |
|
|
 |
Jesman Beginner
Joined: 10 May 2002 Posts: 23 Location: USA
|
Posted: Tue May 27, 2003 4:20 am |
This doesn't really answer my question. I know how to make an Alias or a Trigger but how do I put them all together into a single script so I can just run the script from the command line?
Jesman |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue May 27, 2003 5:43 am |
It answered the question you asked.
That would probably depend very much on what you want the script to do. In general, you write out a set of triggers, aliases, or other settings that will do what you want the script to do. If you want to limit when the script is active, you put all these settings in a subclass and toggle it on/off as desired.
Vague questions get vague answers.
LightBulb
Advanced Member |
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue May 27, 2003 12:08 pm |
I think that the idea we have here of a script differs from your idea of a script in zMUD. When we talk about a script, we are talking about any collection of aliases, triggers, macros, etc., that work together to accomplish some specific goal. The different settings may or may not be in the same class folder and just a single trigger or alias may constitute a script.
In summary, you do what LightBulb said. You write the various triggers, aliases, etc., in such a way that they do what you want to do. Normally, if you want to start a whole process by just typing something in the command line, this involves an alias, so your script would have at least one of those.
Kjata |
|
|
 |
Jesman Beginner
Joined: 10 May 2002 Posts: 23 Location: USA
|
Posted: Wed May 28, 2003 10:46 pm |
hmmm ok Kjata so my understanding of what you are say is there isn't a script editor like there is under Simutronics FE's for DR. I still have this mental block about how to create complex scripts then outta simple scripts.
Lets say I want to create the following:
speedwalk1 from A to B.
speedwalk2 from B to C.
speedwalk3 from C to A.
Trigger1 current location.
Trigger2 destination location.
I have made 5 scripts. One to find my current location, one to find where I'm suppose to go then three different ones to get me to walk there.
Now how do I put them all into one single script so that my toon will continuously walk around the different points without me actually activating each different script.
What I'm trying to do is to make simple scripts to accomplish one objective but then be able to combine those scripts to form bigger complex scripts to run by themselves.
Jesman |
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu May 29, 2003 12:26 pm |
Yes, that's how you do it. What you are missing now is something to tie them all together. Are the three speedwalks aliases or normal zMUD paths?
Basically, what you need right now to put it in a continous loop is to have the first trigger execute the first speedwalk, then when that finishes, the next speedwalk is called, until the second trigger fires which will then start the process of calling the speedwalks again but this time in reverse. However, this is just a general outline of what you need, the specific process of how to do it depends a lot on how you have the speedwalks stored.
Kjata |
|
|
 |
Jesman Beginner
Joined: 10 May 2002 Posts: 23 Location: USA
|
Posted: Thu May 29, 2003 8:37 pm |
I believe I'm seeing the light. So I use Triggers to get it to execute the next smaller script that I need to run.
Ok thanks Kjata you have given me a lot to think about and try.
Jesman |
|
|
 |
Jesman Beginner
Joined: 10 May 2002 Posts: 23 Location: USA
|
Posted: Mon Jun 02, 2003 7:01 am |
ok Kjata I thought I understood how Zmud handles scripting but now I understand that my understanding of what I understood I really didn't understand....understand?
Here is an Alias that I wrote:
#Alias walkthere
n
#TRIGGER {Your mule arrives}
n
#TRIGGER {Your mule arrives}
e
#TRIGGER {Your mule arrives}
e
etc... til I get to my destination.
What happens in DR is that I have a mule that carrys my cargo and follows me to the destination of the cargo. The problem is that the mule is kinda slow (mules being stubbon and all) so I move to a room and wait on the mule to enter the room then move again.
This is what I was expecting my Alias script to do:
move n, wait on my TRIGGER to fire when the mud returns "Your mule arrives" then I would move n, trigger fires when mule enters room, move e, trigger fires, move e, trigger fires...etc.
What my Alias actually does is just execute all the direction moves rapidly without ever waiting on the trigger to fire until DR yells at me for entering too many commands and my poor mule is still in the room where I started my script.
I didn't use speedwalk because I have to wait in each room until my mule arrives and I'm trying to make the script be automatic instead of me having to entered each #step command.
hmmmmm...(grimaces as a thought enters his head) ouch that hurt. I wonder if I could use slow speedwalk and have the trigger fire off the step command.
Anyways my question isn't really how to make this alias work as much as it is this:
Could you explain the very basics of how Zmud works using scripts. Obviously I'm still stuck in the mindset of how I'm use to FE's running scripts. Also explain basically what was wrong in my figuring of how triggers work when I put them in the above Alias. My very basic understanding of triggers was it would wait until it saw the mud return the command and THEN execute a command. So in my Alias it should have wanted for the Trigger to fire before it executed the next move command. (By the way, I've read, reread and read again the support files. I've also search and read any threads in this forum about triggers that I could find.)
Jesman
P.S. For this essay wordcount should be no less then 1000 and no more then 2000 with a bibliography and footnotes where appropriate for any copyrighted references you include in your paper.  |
|
|
 |
Jesman Beginner
Joined: 10 May 2002 Posts: 23 Location: USA
|
Posted: Mon Jun 02, 2003 11:06 am |
Just another little side note. I've figured out how to use speedwalk and triggers to get to my destination but would appreciate if you or someone else could still answer my question so knowledge about ZMud can continue to grow.
Jesman |
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Jun 02, 2003 12:02 pm |
You are right about using slow walk and having a trigger to send the next command. That's the way to do it.
Now, what you still don't see completely with respect to scripts in zMUD is that most of the time they are not just a single collection of commands, but rather a collection of various settings (triggers, aliases, etc.), working together in the correct order to achieve a result.
What happens with zScript is that it is a language that is very event-driven (you enter some command, push a button, the MUD sends a particular line, etc.), where each of the settings is designed to handle one particular type of event. Each setting then executes the commands it has associated when that event happens, but the problem is that you have many events all happening at the same time or in close succession, or even the same event happening more than once one after the other. What this means, is that you can't just pause the commands of one of these settings and have it wait for something else to happen.
In summary, the problem with the alias you wanted was that it executed all of its commands one after the other, creating various triggers along the way. You had the correct idea of using triggers, but you were using them incorrectly. What you needed was to send the first step and then create a trigger that would send the second step when the mule arrived. This trigger would also create another trigger to send the third step when the mule arrived in the second room, on so on. The alias would then be:
#ALIAS walkthere {n;#TRIGGER {Your mule arrives} {n;#TRIGGER {Your mule arrives} {e;#TRIGGER {Your mule arrives} {e;etc.}}}}
However you don't really want these triggers hanging around forever, you just need them one time. So, a better way of doing it is to use temporary triggers which delete themselves after firing:
#ALIAS walkthere {n;#TEMP {Your mule arrives} {n;#TEMP {Your mule arrives} {e;#TEMP {Your mule arrives} {e;etc.}}}}
But this still is not the best solution. The alias would work, but it would get big and complicated fast. The best way would be to keep all of the directions in one place. Luckily, like you found, zMUD provides for this by creating a speedwalk with your directions and having it do a slow walk. This way, you only need one trigger to send the #OK command when the mule arrives, which tells zMUD to send the next step in the path.
Kjata |
|
|
 |
|
|