|
nadden Newbie
Joined: 10 Feb 2002 Posts: 8 Location: USA
|
Posted: Sun Feb 10, 2002 9:00 am
variable question |
Hi I am a newbie who just recently started using zmud v6.16. I saw in a post of someone who also plays realms of despair and had a trigger for being disarmed but he used v4.65. I was wondering if that trigger would work for me and also do the variables have to be specific? I change my weapons fairly frequently or I may dual wield and may not know wich weapon was disarmed. Is there a way to get weapon then wield weapon with out me actually having to type in what weapon I lost.
I figured out most of the basic alias and triggers and even put on a couple of buttons but this variable thing has me confused. Thank for your help. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Feb 10, 2002 1:59 pm |
The script you saw should work in version 6.16 with no problems (provided the syntax has changed that much - I really don't remember well.)
The variables used in the script don't need to be the ones you use in your script. You can name them anything you want. Just make sure that you change all of the references to the old variables to use the name that you chose.
Basically, the script you need consist of a single trigger. The trigger will have as pattern whatever message you receive that lets you know you have been disarmed. In the commands you need then to have it send the command to get the weapon and wild the weapon, but you use the variable name where you would normally put the weapon's name.
You then have the option of typing in the commanline:
varName=newWeapon
every time you want to change the weapon that is to be automatically retreived. Where varName is the name of the variable you chose and newWeapon is the keyword of the weapon to be retreived. You can also create an alias called wield. The alias could be like this:
#ALIAS wield {#VAR weapon %1;~wield %1}
This alias will set the variable @weapon to whatever you write after wield, and then send the actual wield command (that's why it has ~) to the MUD so you wield that weapon.
Kjata |
|
|
|
nadden Newbie
Joined: 10 Feb 2002 Posts: 8 Location: USA
|
Posted: Sun Feb 10, 2002 4:42 pm |
Thank you for your response.
I guess I just don't understand the variable thing very well, I have read the help file several times but just don't see how setting up a variable would be quicker than writing the object out. I.E. @container = waterskin (in helpfile) or haveing to write @weapon instead of chisel or sword.
When I am dual wield how can I set it up so that zmud knows which weapon was disarmed and so it can get it instead of the one I still have? Or am I just making this too complicated. I have a tendency to miss when I am disarmed for several attacts and this is why I wanted to have a trigger to rearm myself. While I am at it can I change the color of the text that tells me someone DISARMS YOU?
Thanks again |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Feb 10, 2002 5:46 pm |
Variables help you in many ways, you just need to be creative. Let's take as an example this trigger:
#TRIGGER {Someone DISARMS YOU!} {get sword;wield sword}
This trigger will get your sword and wield it again when you get disarmed. Cool, so now we don't have to worry when we are disarmed. Now, suppose you stop using your sword because you found a dagger. You need to open up the Settings Editor, look for your trigger, and change both mentions of the word "sword" to "dagger". Ok, the trigger now works again. However, conside this trigger:
#TRIGGER {Someone DISARMS YOU!} {get @weapon;wield @weapon}
So now you use a variable @weapon instead of the weapon's keyword. This variable can contain anything you want. Now, instead of going into the settings editor to change what weapon it should get, you can type at the command-line:
weapon=dagger
weapon=sword
weapon=whip
And now you can change what weapon the trigger gets without going into the Settings Editor. Aside from faster changing of the weapon and fewer typing, however, there aren't that much more benefits. But, now, consider this alias:
#ALIAS wield {#VAR weapon %1;~wield %1}
and you use it like:
wield sword
wield dagger
wield whip
The alias will then set the variable @weapon to the weapon you are about to wield, and sends the command to the MUD to wield it. You are now making the action of updating the @weapon variable automatic.
You see what I'm getting at? Clever use of various kinds of zMUD settings will make your life easier. Variables are essential to this. They allow you to store any value in them which can be, as the name says, variable. This in turns, allows for your scripts to be dynamic, performing whole different set of actions, just by setting a variable to a different variable. If you take this a little further, you can have scripts that update the values of variables by code, so other scripts will do the different set of action without you having to do anything.
So basically, there really is no benefit, like you say, in doing:
enemy=orc
kill @enemy
versus:
kill orc
In fact, in this particular case, it is even better to do the latter. But used in different forms, variables will have an effect and will help you do stuff which is impossible otherwise.
As for having zMUD know which weapon is disarmed when you are dual-wielding, you need to provide more specific. Does you MUD tell you which weapon was disarmed when it sends the message that you are disarmed? Is the Primary Weapon the one that always gets disarmed or is it the Secondary Weapon? When you dual-wield, does the second weapon you wield go into Secondary Weapon or does it displace the one in Primary Weapon? Providing some sample MUD output would also help a lot.
As for changing the color of a line, you might want to look into the #COLOR command. You use this command inside triggers and it tells zMUD to color the last line, whatever color you specify.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Feb 10, 2002 5:56 pm |
Writing out the variable name isn't any faster than writing out the weapon's name, however, changing a variable is usually much easier and faster than changing a trigger. If both weapons can be disarmed, I usually just pick them both up (that will get whichever one I lost) and rewield both of them (which will rewield whichever one I lost). You can use this set of triggers, variables, and aliases. Change the actual phrases and commands to match your mud.
#AL wield {#VAR weapon1 %1;~wield %1}
#AL second {#VAR weapon2 %1;~second %2}
#TR {has disarmed you} {get @weapon1;get @weapon2;~wield @weapon1;~second @weapon2}
LightBulb
All scripts untested unless otherwise noted |
|
|
|
nadden Newbie
Joined: 10 Feb 2002 Posts: 8 Location: USA
|
Posted: Mon Feb 11, 2002 11:31 am |
lightbulb your trigger and alias worked. I get disarmed and it takes either weapon I am wielding and it doesn't tell me wich one was taken. as I used the trigger more it didn't always work. occasionally it would try to get the wrong weapon. but then again I would see that and then get and wield the right weapon. I haven't tried Katja's trigger yet buy I plan on trying it real soon. will things get confused if I use both katja and lightbulbs tirggers and alias's? thank you for your help :)
|
|
|
|
doomfyre Apprentice
Joined: 03 Jan 2002 Posts: 152 Location: USA
|
Posted: Mon Feb 11, 2002 12:03 pm |
Could you do something like:
#var weapon (broadsword|shieldbreaker|dagger|longsword) basically put any possible weapon you might have.
#trigger {DISARMS YOU} {get @weapon; wield @weapon}
not perfect of course, because you may end up wielding a weapon in primary that you really want to wield in offhand. And you would have to add both the name of the weapon when it's laying on the ground, and it's name when it's in your inventory, since they can be different sometimes.
I play RoD also, i wield the same named weapon in both hands and rarely switch.
So my trigger is just #trigger {DISARMS YOU} {get shieldbreaker; wield shieldbreaker}
I don't know the exact syntax of the command to load a variable with all possible instances of something, but i think its pretty close to what i showed up there.
For the color question. I think that would be:
#trigger {DISARMS YOU} {#color yellow} or whatever color.
You could also make the text blink if you wanted
#trigger {DISARMS YOU} {#color yellow, blink}
something like that. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Feb 11, 2002 12:58 pm |
Use LightBulb's script, it should work for your case.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Feb 11, 2002 7:00 pm |
My script is just an expanded version of Kjata's which covers two weapons instead of just one. There's no need to use both scripts.
LightBulb
All scripts untested unless otherwise noted |
|
|
|
nadden Newbie
Joined: 10 Feb 2002 Posts: 8 Location: USA
|
Posted: Mon Feb 11, 2002 8:16 pm |
ok when I tried to "second weapon" based on the alias I assumed it would wield it and it didn't. did I misinterpret something? I am thinking that maybe I should dual-wield the same weapon as soon as I can get another one. when I would get disarmed the mud would come back with huh? after i got the first weapon am I doing something wrong. I cut and pasted the scripts to avoid my horrible typing.
|
|
|
|
doomfyre Apprentice
Joined: 03 Jan 2002 Posts: 152 Location: USA
|
Posted: Tue Feb 12, 2002 1:17 am |
Could it have something to do with the "disarms you" not being capitalized in lightbulbs script? Im pretty sure you need to have it in there the same way it appears in the mud.
|
|
|
|
nadden Newbie
Joined: 10 Feb 2002 Posts: 8 Location: USA
|
Posted: Tue Feb 12, 2002 1:53 am |
The disarming part isn't the part that doesn't work. It sets off the trigger like it is supposed to. I had to change the text to match the muds that part was easy. I looked at what was happening closer this time and when I go to weild a second weapon the command second is sent instead of wield and not sure how to fix that. there seems to be some confusion on what to wield sometimes but I can live with that if it tries to get both weapons and then wield both weapons but when it goes to wield the second weapon it comes back with "huh?"
|
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Tue Feb 12, 2002 4:38 am |
The problem is that there is no 'second' command in Realms. You use 'wield' to wield both weapons.
Another bit of Realms info: when you are disarmed, the weapon that was wielded falls to the ground and the weapon that was duel-wielded is promoted to the wielded slot. When you wield the disarmed weapon again, it is placed in the dual-wield slot.
Therefore create two variables with your weapons:
#VAR wielded trident
#VAR dualwielded axe
#TR {DISARMS you!} {#VAR weapon @wielded; get @weapon; wield @weapon; #VAR wielded @duelwielded; #VAR duelwielded @weapon}
As you are disarmed and you rearm, the weapons in the wielded and dual-wielded slots are tracked.
Troubadour |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Feb 12, 2002 12:31 pm |
Just another perfect example on why detailed information concerning the problem at hand is necessary. Without that knowledge of how disarm and dual-wield works in Realms, it is impossible to create the trigger as Troubadour did.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Feb 12, 2002 6:53 pm |
Yep. I did say to change the phrases and commands to match the MUD.
LightBulb
All scripts untested unless otherwise noted |
|
|
|
|
|