|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Tue Jan 21, 2003 8:43 pm
SWR Armor Script |
Ok. I have these wonderful aliases for making sets of armor (it labels the layers arms1 arms2 arms3, etc... and the top layer is custom). But I was wondering if there was a way to make a trigger / alias / script that could make an entire set of armor (instead of me having to type in everything. Yes. I'm lazy).
Thanks.
-Tig |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Jan 21, 2003 11:54 pm |
I'm sure there is a way. Unfortunately, without more information, that is about as much as we can help you.
Kjata |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Wed Jan 22, 2003 2:25 am |
well.... um.... er.. heh. sorry. what kind of information are you looking for? I'll supply what I can. Thank you again
-Tig |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Jan 22, 2003 2:46 am |
What exactly do you want the alias to do? Do you already have a set of aliases that perform some actions and you want this alias to call the other aliases? If so, what are these aliases called? How do you call them? What parameters do you supply to them? Do you also need to capture some text from the MUD or is all the information supplied to you? If the alias that is to be created uses commands from your MUD, what are those commands?
The most important question is the first one. Try to explain exactly what you want the alias to do, and how do you expect the alias to do it (even if you don't know the exact implementation details regarding the code used in zMUD to do it).
Kjata |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Wed Jan 22, 2003 3:28 am |
Whee... lemmie try this one at a time:
1. I want the alias (or script or whatever) to build a full suit of armor from a single command
2. Yes. They're really basic though. To make a piece of armor you would type makearmor <location> <armor name>. The aliases that I currently use are the name of the armor piece (in this game there are 4 layers, and only the top layer shows... so I can make the bottom 3 all 'generic'). An example would be:
'arms1' comes up 'makearmor arms arms1' on the mud.
3 / 4. They're just called 'arms1, arms2, arms3' etcetera. As for calling... like how I use them.. its all just typing. Sorry. Not all that mud literate.
5. To make some of the triggers work I need to get text.. but for these I simply type in which armor piece I want to build.
I think thats it. Many thanks again. |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Wed Jan 22, 2003 6:58 am |
What kind of forced delay does the mud give you?
Perhaps cut/paste the relevant parts from a log of you doing it manually.
I doubt an alias that spams all locations and four layers at once will work .
Probably would need to see the success/fail message to determine a good way to do this.
It wouldn't be hard to run through an entire string list of things to be made which are executed every success/fail message.
Ton Diening |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jan 22, 2003 10:12 am |
What exactly do you want the alias to do?
1. I want the alias (or script or whatever) to build a full suit of armor from a single command
That's interesting, but not at all helpful. What are the commands you would use to do this without any aliases? (Example: to make gloves the commands might be "kill rabbit, skin corpse, tan hide, buy thread, buy needle, thread needle, sew gloves")
Your answers to the other questions are similarly unenlightening. Pretend we know absolutely nothing about SWR (I for one don't) and tell us everything we would need to know in order to do this ourselves. We need to know this because, in order to write a script, someone has to explain to zMUD exactly what it's supposed to do and when.
LightBulb
Senior Member |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Wed Jan 22, 2003 4:47 pm |
SWR is Star Wars Reality (v1.0).
Ok... here's the log... or at least a partial one. Making a full set of armor takes a looong time, but this is the basic. To make a full set of armor you need a piece of fabric (in this example, synthafabric), and a needle and thread. I have all the materials in a room, so I don't really need to get anything. The only command I need to enter is the 'makearmor' command (ie makearmor (location) (title) and when I complete a layer I have a button that puts everything in a bag (easier to hand them a single container than the 29 pieces of armor thats standard for a set).
Ok... here's the log... or at least a partial one:
Health:500/500 Mov:985/1000 Users:10>get 7 synthafabric
You get some thin synthafabric (7).
Health:500/500 Mov:985/1000 Users:10>makearmor hands hands1
You begin the long process of creating some armor.
Health:500/500 Mov:1000/1000 Users:9>
You finish your work and hold up your newly created garment.
You gain 40000 engineering experience.
Health:500/500 Mov:1000/1000 Users:9>makearmor arms arms1
You begin the long process of creating some armor.
Health:500/500 Mov:1000/1000 Users:9>
You finish your work and hold up your newly created garment.
You gain 40000 engineering experience.
Health:500/500 Mov:1000/1000 Users:9>makearmor body body1
You begin the long process of creating some armor.
Health:500/500 Mov:1000/1000 Users:9>
You finish your work and hold up your newly created garment.
You gain 40000 engineering experience.
The forced delay I was talking about is the time inbetween the message 'You begin the long process of creating some armor.' and 'You finish your work and hold up your newly created garment.' Its 30-45 seconds and I guess it represents the time it takes to build the armor or whatever you're making. Also, if you type in any command (literally anything that sends data to the mud) it will interupt the process ('You are interrupted and fail to finish your work') and you have to enter the command to start again. Also, I thought about making something that would execute after every success message, but since its the same, it would activate every one of them at the same time, and only end up making the last piece on the list.
Again, I've seen some of the scripts on here and they're abit more complex than i've even attempted. I was wondering if there was a command to have zmud delay a command for a time before exectuing it. IE wait 40 seconds before sending the next command to the MUD. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jan 22, 2003 5:51 pm |
It's possible to build-in a delay, but it would be preferable to trigger off the completion message. This can be done by using two variables. The first will contain a list of the items you want to make (use your existing alias names), and the second will be a number which keeps track of where you are in the list. A third variable can be used (if desired) for a status line display (so you'll know when it's safe to type again). Since you already have individual aliases with the necessary commands for each item, you can continue using them but have a new alias or trigger do the typing instead of you. It's best to use a subclass for the triggers, so that you can control when they work. That way, you can easily make individual armor pieces when you want, without setting off the triggers.
The easiest way to make a list (as long as it doesn't have any duplicate items) is with the #ADDITEM (#ADDI) command. This works just like the #VARIABLE (#VAR) command, except it adds a new item to the end of the list instead of replacing the entire variable. You use #VAR to clear the list. #ADD is the simplest way of changing the tracking variable.
First, make your list:
#VAR ArmorList %null
#ADDI ArmorList hands1
#ADDI ArmorList arms1
#ADDI ArmorList body1
#ADDI ArmorList hands2
#ADDI ArmorList arms2
etc.
Then make the triggers and alias.
#CLASS MakeArmor disable
#TR {You finish your work and hold up your newly created garment} {#IF (@ArmorPointer < %numitems(@ArmorList)) {#ADD ArmorPointer 1;#EXEC %item(@ArmorList, @ArmorPointer)} {#T- MakeArmor;#VAR ArmorPointer 1;#VAR ArmorMaking finished}}
#TR {You are interrupted and fail to finish your work} {#VAR ArmorMaking INTERRUPTED;#MESSAGE {Armor making interrupted! Type RESUME when ready to continue}}
#AL RESUME {#VAR ArmorMaking working;#EXEC %item(@ArmorList, @ArmorPointer)}
#CLASS 0
#AL MakeSet {#VAR ArmorPointer 1;#VAR ArmorMaking working;#T+ MakeArmor;#EXEC %item(@ArmorList, @ArmorPointer)}
#ST {Armor making: @ArmorMaking}
#VAR ArmorMaking finished finished
Untested. The command you would type to start making a set is "makeset".
LightBulb
Senior Member |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Wed Jan 22, 2003 11:52 pm |
ok... so all i do is copy / paste this into... where? sorry. I havent worked with anything this complex before. Thank you for helping, btw.
-Tig |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Jan 23, 2003 12:21 am |
Copy and paste it into the command line and hit Enter.
Kjata |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Thu Jan 23, 2003 1:04 am |
and this will activate each alias on the list, one after the other... right? Just making sure. I don't want to end up crashing the mud because I left out something. Also, I have an alias (totebag) that takes every single item (arms1, legs1, waist1, body1, hands1, feet1, about1) and puts them in a container. Is it possible to add that alias in after each set of 7? Many many thanks again.
|
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Thu Jan 23, 2003 1:08 am |
one last thing. this all goes in the ALIAS 'commands' line or each in their own thing (aliases, triggers, classes, variables, etc)? Just want to do this right.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jan 23, 2003 4:38 am |
Yes, this should activate each alias in the list, one at a time. Try it with a short list (3 or 4 items) the first time to be sure there aren't any problems. If that works okay, then add the rest of the items with the #ADDItem command.
You can add your "totebag" alias to the trigger with the #IF, right after #T- MakeArmor. Make sure the trigger is still in the MakeArmor class.
#TR {You finish your work and hold up your newly created garment} {#IF (@ArmorPointer < %numitems(@ArmorList)) {#ADD ArmorPointer 1;#EXEC %item(@ArmorList, @ArmorPointer)} {#T- MakeArmor;totebag;#VAR ArmorPointer 1;#VAR ArmorMaking finished}}
It all goes in the MAIN command line, the white bar at the bottom of the screen that you type in most of the time.
LightBulb
Senior Member |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Thu Jan 23, 2003 4:58 am |
and of course, like a twit i fergot to mention that i need fabric. each time I need to pick up 7 of a certain type of fabric, in this order (and the alias i use):
Synthafabric (syntha)
Cu-pu hide (cupu)
Durasteel Plating (durasteel)
REALLY sorry I forgot that. Whats an easy way to include that in the loop? |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Thu Jan 23, 2003 5:12 am |
oh... and every time i don't have the material it gives me a message:
'You need some sort of fabric or material.'
I was wondering if its possible to program it so that after every 7 pieces it picks up the next type. If this is geting too complex... lemmie know. |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Thu Jan 23, 2003 5:51 am |
nevermind. I figured it out. I set triggers so that every message that doesn't correspond with 'You hold up your...' just enters the resume command. Thank you very much for helping me. The script works wonderfully.
-Tig |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jan 23, 2003 7:05 am |
Thanks for confirming that the script works.
You did mention picking up material earlier, but I thought you had that built into your other aliases. I'm glad to hear you found your own solution already.
LightBulb
Senior Member |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Thu Jan 23, 2003 10:26 pm |
One final little detail... how do i stop / restart the script?
|
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Thu Jan 23, 2003 10:38 pm |
oh... and how do i 'subclass' the triggers? I got the problem of them activating when I don't want them to.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jan 24, 2003 7:29 am |
To stop the script: Do something (anything) else.
To restart the script at the same place it stopped: Type RESUME (or resume)
To restart the script at the beginning: Type MakeSet
The script should already be in subclass MakeArmor if you cut-and-pasted. If not, you can make the subclass by typing
#CLASS MakeArmor disable
#CLASS 0
and then move the triggers into it using drag-and-drop.
It would probably be a good idea to move the alias, RESUME, out of the subclass. If you did that, you could then add the #T- command to the interrupt trigger. You would also need to add the #T+ command to the RESUME alias.
#TR {You are interrupted and fail to finish your work} {#VAR ArmorMaking INTERRUPTED;#MESSAGE {Armor making interrupted! Type RESUME when ready to continue};#T- MakeArmor} {MakeArmor}
#AL RESUME {#T+ MakeArmor;#VAR ArmorMaking working;#EXEC %item(@ArmorList, @ArmorPointer)}
LightBulb
Senior Member |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Fri Jan 24, 2003 7:11 pm |
Sweet. It works. Thank you very much. The only problem I have is when I pick up the fabric I need, it just enters the same command over and over again... for example:
The first command is:
get 7 syntha
which triggers:
You get some thin synthafabric (7)
which I have triggered to the command 'resume' but all it does is input first command again (get 7 snytha). Is there a command I can use to make it goto the next item on the list? |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Fri Jan 24, 2003 7:38 pm |
HA! Trial and error have succeded! I feel so special. Now if I could understand HOW I did it. I added the following lines / triggers to the list:
#TR {You put about2 in a totebag} {#IF (@ArmorPointer < %numitems(@ArmorList)) {#ADD ArmorPointer 1;#EXEC %item(@ArmorList, @ArmorPointer)} {#T- MakeArmor;#VAR ArmorPointer 1;#VAR ArmorMaking finished}}
#TR {You get some cu-pa hide} {#IF (@ArmorPointer < %numitems(@ArmorList)) {#ADD ArmorPointer 1;#EXEC %item(@ArmorList, @ArmorPointer)} {#T- MakeArmor;#VAR ArmorPointer 1;#VAR ArmorMaking finished}}
#TR {You get some thin synthafabric} {#IF (@ArmorPointer < %numitems(@ArmorList)) {#ADD ArmorPointer 1;#EXEC %item(@ArmorList, @ArmorPointer)} {#T- MakeArmor;#VAR ArmorPointer 1;#VAR ArmorMaking finished}}
#TR {You get durasteel plating} {#IF (@ArmorPointer < %numitems(@ArmorList)) {#ADD ArmorPointer 1;#EXEC %item(@ArmorList, @ArmorPointer)} {#T- MakeArmor;#VAR ArmorPointer 1;#VAR ArmorMaking finished}}
each of those match the different messages I recieve that are different than 'You hold up...' and it works. Thank you SOOOOO much for helping (read: Giving) me this script.
Most Greatful,
Tig |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jan 24, 2003 11:32 pm |
You're most welcome. It sounds like you've learned quite a bit over the last few days.
LightBulb
Senior Member |
|
|
|
zxtiggerxz Beginner
Joined: 21 Jan 2003 Posts: 18
|
Posted: Fri Jan 24, 2003 11:42 pm |
only how to copy and modify other peoples work. God willing, with enough practice... I might be able to chrun out some original code. hehe.
|
|
|
|
|
|