|
Enathe Novice
Joined: 17 Nov 2001 Posts: 34 Location: USA
|
Posted: Fri Feb 14, 2003 10:38 pm
Basic Script Help Needed |
I have two chars on Realms of Despair (Ranger and Cleric) and am trying to make an eating script so that they may both eat and drink automatically. I have tried this with simple triggers such as:
#TRIGGER {Enathe tells you 'food'} {cast 'create food'}
#TRIGGER {mushroom appears in your hand} {give mushroom Enathe}
But these pose the problem of what do I do when my cleric gets hungry. He creates a mushroom then gives it to the other. Not sure how to make a simple script that would create food for whomever is hungry and then have them eat. Also what happens if I lose my concentration? How would I have them try and cast the same spell over again? If any have a solution that could be broken down I would greatly appreciate it. I would like an explanation if possible so that I could apply a simple script like that to something like a healing script as I need it.
Thanks |
|
|
|
Evangelist Adept
Joined: 10 Oct 2000 Posts: 224 Location: USA
|
Posted: Fri Feb 14, 2003 11:10 pm |
Can you have both players logged in at the same time?
Evangelist/Pernius
telnet://phidar.com:9000 |
|
|
|
Enathe Novice
Joined: 17 Nov 2001 Posts: 34 Location: USA
|
Posted: Fri Feb 14, 2003 11:13 pm |
Yes both chars are working together. One has casting ability (Cleric) and the other does not (Ranger). I am using the Ranger as my tank.
|
|
|
|
Enathe Novice
Joined: 17 Nov 2001 Posts: 34 Location: USA
|
Posted: Sat Feb 15, 2003 12:33 am |
Ok I am attempting to start this script on my own from the helps and what I have read on the forums and I am running into a problem. My trigger is this:
#TRIGGER {(%w) gives you a bottle} {cast 'create water' bottle}, #IF (bottle is filled) {give bottle to %1}{cast 'create water' bottle}
Now from the helps I gather that if the bottle is filled bottle will be given to %1, but if bottle is not filled cast 'create water' is cast again on the bottle. Instead both {give bottle to %1} AND {cast 'create water' bottle} are being sent to the mud. Please advise on where I am going wrong.
Thanks |
|
|
|
Talanthas Beginner
Joined: 26 Mar 2001 Posts: 12 Location: earth
|
Posted: Sat Feb 15, 2003 1:15 am |
For refilling the bottle, try this:
#TRIGGER {(%w) gives you a bottle} {#IF (bottle is filled) {give bottle to %1}{cast 'create water' bottle}}
You had it mostly correct, but sent an unconditional command before the #IF statement. This told zMud to try to fill the bottle before knowing whether or not it was full, THEN it would parse your #IF statement.
I used to play an augurer on RoD, and had some triggers that would recast any spell when I lost my concentration. I don't know if this method will still work since they did that major change 4 or 5 months ago, but my approach was to use the mud output (e.g. "You lost your concentration." or "You have an itch on your leg.") as the pattern for a trigger, with the response being ~!
! in RoD is a default character that tells the mud you want to repeat your last command. The ~ tells zMud not to strip out the ! before sending any commands to the mud.
Good luck! |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Feb 15, 2003 1:39 am |
For the food, try this:
#TR {Enathe tells you 'food'} {#VAR food Enathe;#VAR spell {'create food'};cast 'create food'}
#TR {mushroom appears in your hand} {#IF (@food = "Enathe") {#VAR food cleric;#VAR spell {};give mushroom Enathe} {#VAR spell {};eat mushroom}}
#TR {You lost your concentration} {#IF (@spell) {cast @spell}}
I'm not clear on how you tell whether the bottle is filled, but something similar should work for water.
#TR {(%w) gives you a bottle} {#VAR bottle %1;#VAR spell {'create water' bottle};cast 'create water' bottle}
#TR {the bottle is filled} {#IF (@bottle) {#VAR spell {};give bottle @bottle;#VAR bottle {}} {#VAR spell {};drink bottle}}
The problem you are having where both parts of the #IF are sent to the MUD is because you didn't leave a space between } and {.
LightBulb
Advanced Member |
|
|
|
Enathe Novice
Joined: 17 Nov 2001 Posts: 34 Location: USA
|
Posted: Sat Feb 15, 2003 2:13 am |
Ok, I couldn't get the #if thing to work so here is what I have:
(Tank)
#TRIGGER {You are parched} {Drink bottle}
#TRIGGER {It is already empty} {Give bottle Anathe}
#TRIGGER {Anathe gives you a bottle} {Drink bottle}
#TRIGGER {You are hungry} {Tell Anathe Enathe is hungry}
(Healer)
#TRIGGER {tells you '(%w) is hungry'} {cast 'create food';give mushroom to %1}
#TRIGGER {(%w) gives you a bottle} {cast 'create water' bottle';give bottle to %1}
It seems a little primitive. Also if I fail in a cast I simply continue on and give the bottle back or try to give a mushroom I don't have, but considering my tank is still hungry it will continue to recieve the same messages from the MUD and continue to signal my healer to try again. Now both my players will remain fed and watered on their own. Unless of course something happens (like running out of mana). Also, I can't begin to imagine how to setup something this simple for healing. I would like something that when my tank gets to 20HP he says heal or something and then my healer will heal him of course. But how would I get a trigger to look at my prompt? Any hints or comments on what I have so far would be great. Thanks all for the help |
|
|
|
Enathe Novice
Joined: 17 Nov 2001 Posts: 34 Location: USA
|
Posted: Sat Feb 15, 2003 2:18 am |
Thanks Lightbulb! That worked great. Not sure what all that is but it worked. How about the HP heal? Any suggestions there?
|
|
|
|
Enathe Novice
Joined: 17 Nov 2001 Posts: 34 Location: USA
|
Posted: Mon Feb 17, 2003 8:13 pm |
I have added another char to the mix here and I have modified the trigger so it reads:
#IF (@food = "Enathe") {#VAR food enathe}
#IF (@food = "Manthera") {#VAR food manthera} {
#VAR spell {}
give mushroom @food
} {
#VAR spell {}
eat mushroom
}
This works great for the first #IF but not at all for the second. Can you have two "IF" back to back? If not how do I get two if's in the same trigger?
Thanks |
|
|
|
Enathe Novice
Joined: 17 Nov 2001 Posts: 34 Location: USA
|
Posted: Mon Feb 17, 2003 11:04 pm |
#IF (@food = "Enathe" or "Manthera") {
#VAR spell {}
give mushroom @food
} {
#VAR spell {}
#VAR food {}
eat mushroom
}
That works! Thanks all for the advice and help with the scripts. I am learning :) |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Feb 18, 2003 12:14 am |
Actually, it should be:
#IF (@food = "Enathe" or @food = "Manthera") {
#VAR spell {}
give mushroom @food
} {
#VAR spell {}
#VAR food {}
eat mushroom
}
LightBulb
Advanced Member |
|
|
|
|
|