|
Stormchoir Newbie
Joined: 07 Jun 2001 Posts: 7
|
Posted: Sat Jan 12, 2002 1:43 pm
Script Help |
First, let me explain that I am trying my hand at creating an autonomus potion creating character (bot) and I don't have a lot of experience with script writing.
I would like to make the char as hastle free as possible so with that in mind I have tried to take as many steps in covering all of the posible things that could go wrong. Simple things like keeping track of available mana when brewing potions I think I have covered. I set currentmana and maxmana to two seperate variables and check them against one another and have the bot trance to regain mana until they match.
What I am having a bit of trouble with is when a specific function of the brewing process fails. The highest cause of failure is the act of brewing itself. The problem I'm running into is when an action fails such as casting a spell or brewing a potion, the mud output is always the same (You failed.)so it is difficult to create a trigger that fires on that pattern when it is going to happen for more than one issue. I have a few items that I want to be able to re-do immediatly if they should fail. While going over the predefined variables within zmud I came across %lastcom which as you know returns the last command issued. What I would like to know in this instance is how I can put that to use in my triggers or aliases to have the value of that variable re-issue the command that failed.
I've been over the forums and found a number of similar issues but nothing that quite matches this particular issue. At least not that I found. I appologise if I'm beating a dead horse.
I think thats about it for now. Any input on this would be greatly apprecated. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Jan 12, 2002 8:56 pm |
Regretably %lastcom will not help you. It is set by the parser to be whatever section of script it just finished parsing, the same for %action. Neither of those will consistently hold the last command you sent to the mud.
The only way to do what you want with surety is to put your brew command into a variable before you actually send it, then when you fail you can just resend that variable. |
|
|
|
Threndil Newbie
Joined: 09 Jan 2006 Posts: 9 Location: Guatemala
|
Posted: Mon Jan 09, 2006 4:22 pm |
Hello, I am currently attempting to create a tankset trigger, which comprehends of various potions in which if they fail to brew the message is also "You failed."
what I tried to perform was a patterns named after the potion I wanted to brew, ie: brew shadowform, brew sanctuary, brew true, etc.
so that I could use this trigger:
%if(%line = "You failed.") {brew sanctuary}
but what it does is this:
{brew sanctuary}
in a limitless loop...
I've tried many ways to make him rebrew if he fails at it, but have been unnable to.
tried:
#IF (%1 = You failed , brew sanctuary)
but realized that %1 would fall into the pattern itself like so:
brew sanctuary %1 <<<
I'm not quite sure how to do the whole variable thing with ease, so bare with me :S
I put the post here, since this is the closest to my situation.
cheers :) |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue Jan 10, 2006 12:18 am |
You should post t some sample mud output, it would be much more helpful.
But I did some testing and you are using the %if function when you should really be using the #IF command.
Code: |
#IF { %match( %line, "You failed.")} {brew sanctuary} |
or this
Code: |
#IF { %line = "You failed."} {brew sanctuary} |
That should do what you want. The %match function gives you much more flexibility. |
|
_________________ Asati di tempari! |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Jan 10, 2006 5:47 am |
I'd use a multi-state trigger with a temp trigger that would reset the state.
Would need mud ouput to give an example. |
|
|
|
Dodgester Wanderer
Joined: 17 Nov 2005 Posts: 65
|
Posted: Sun Jan 15, 2006 2:11 pm |
I have ran into similar type issues, which there is no easy answer for this. About the only thing you can do is to map out the various mud patterns, which I haven't even really done due to the amount of time that would be involved to do, and setup an alias for each and every command (first word command anyhow), and then use a set of variables to store those commands, and each command gets discharged in the order they were sent based upon the order of the command, though I have also noticed that there are few instances that there is only a blank line returned from the mud site, so that has to be somehow taken into account as well. I have had thoughts of doing that though cause of this very issue. Of course, within the aliases, you would need to use the tilde (~) key in order for the command to be sent to the mud rather than calling up the alias again, just as how it's done with the inherited recall alias within the AutoMapperAll class.
Sincerely,
Dodgester |
|
|
|
Threndil Newbie
Joined: 09 Jan 2006 Posts: 9 Location: Guatemala
|
Posted: Wed Feb 01, 2006 3:28 pm |
Thanks for your answers peeps. It helped alot.
I however found an error with the way I was actually creating the trigger, though your help was really useful and I'm a bit more clear of how to make it... I just have to make it now. (reluctant to do it before cause of how much time it would take me).
Thanks again for your help. Really useful.
Threndil. |
|
|
|
|
|