|
bebamedo Novice
Joined: 02 Aug 2006 Posts: 32
|
Posted: Wed Aug 02, 2006 9:32 pm
script help |
i have made following script :
#ALIAS thefton {#T+ Theft}
#ALIAS theftoff {#T- Theft}
#CLASS {Theft}
#ALIAS steal {hypnotise @tar;#T+ Theft/pack}
#TRIGGER {drops pack} {get pack}
#CLASS 0
#CLASS {Theft/pack}
#TRIGGER {with an entrancing stare} {suggest @tar action drop pack}
#TRIGGER {You issue the suggestion} {#T+ Theft/pack/action1}
#CLASS 0
#CLASS {Theft/pack/action1}
#TRIGGER {You have regained your mental equilibrium.} {suggest @tar action remove pack}
#TRIGGER {You issue the suggestion} {#T+ Theft/pack/action2;#T- Theft/pack/action1}
#CLASS 0
#cLASS {Theft/pack/action2}
#TRIGGER {You have regained your mental equilibrium.} {suggest @tar action remove flame from pack}
#TRIGGER {You issue the suggestion} {#T+ Theft/pack/action3;#T- Theft/pack/action2}
#CLASS 0
#cLASS {Theft/pack/action3}
#TRIGGER {You have regained your mental equilibrium.} {seal @tar 2}
#TRIGGER {You issue the suggestion} {#T+ Theft/pack/action4;#T- Theft/pack/action3}
#CLASS 0
#cLASS {Theft/pack/action4}
#TRIGGER {You have regained your mental equilibrium.} {#T- Theft/pack/action4;#T- Theft/pack; theftoff}
#CLASS 0
the problems start when it commes to class Theft/pack/action1. It fires, but i goes all the way to the end, so it basicaly turns off script instead to perform all necesary actions in between.
Any suggestiion would be helpfull |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Aug 03, 2006 3:08 am |
With a quick glance, I see nothing wrong with the script. But I currently don't have zMUD in this machine to test it, so I can't tell you for sure. However, I'm not sure what exactly is the problem you are describing that you have. Please explain it further.
|
|
_________________ Kjata |
|
|
|
bebamedo Novice
Joined: 02 Aug 2006 Posts: 32
|
Posted: Thu Aug 03, 2006 6:54 am |
the problem is following:
when script commes to
#TRIGGER {with an entrancing stare} {suggest @tar action drop pack}
it normaly executes the trigger. but when #TRIGGER {You issue the suggestion} {#T+ Theft/pack/action1} is fired all lines from there on are done simultaneusly instead one by one. So basicaly script, instead performing one action on every balace, goeas all to the end and turns script off with #TRIGGER {You have regained your mental equilibrium.} {#T- Theft/pack/action4;#T- Theft/pack; theftoff}. (i have used echo to see what happens |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Aug 03, 2006 3:10 pm |
Ok, got it. The problem is that when the second trigger enables the next class, the current line that fired this trigger is checked against the newly enabled triggers. This will cause the second of the newly enabled triggers to match and the chain will keep repeating until it gets to the end.
A quick solution, is to eliminate the "You issue the suggestion" triggers, and instead have each "You have regained your mental equilibrium" trigger create it as a temporary trigger when it fires.
A much better solution is to look into multi-state triggers and change your script so it is done by a multi-state trigger. One multi-state trigger should be able to replace all of the triggers you have there. |
|
_________________ Kjata |
|
|
|
bebamedo Novice
Joined: 02 Aug 2006 Posts: 32
|
Posted: Thu Aug 03, 2006 3:59 pm |
Thanks. One plea though. I'm quite a newbie on this scripting. So if it is not a trouble, could you post an example of thet multy trigger your takking? I would appreciate it, so i have refrence for my future scripting
Thanks again |
|
|
|
bebamedo Novice
Joined: 02 Aug 2006 Posts: 32
|
Posted: Thu Aug 03, 2006 10:37 pm |
i have mand another script accordin to your suggestion
#ALIAS thefton {#T+ Theft;#T- Theft/pack/action4}
#ALIAS theftoff {#T- Theft}
#CLASS {Theft}
#ALIAS steal {hypnotise @tar;#T+ Theft/pack}
#TRIGGER {drops pack} {get pack}
#CLASS 0
#CLASS {Theft/pack}
#TRIGGER {with an entrancing stare} {suggest @tar action drop pack;#TEMP {You issue the suggestion} {#T+ Theft/pack/action1;#echo 1}}
#CLASS 0
#CLASS {Theft/pack/action1}
#TRIGGER {You have regained your mental equilibrium.} {suggest @tar action remove pack;#TEMP {You issue the suggestion} {#T+ Theft/pack/action2;#echo 2;#T- Theft/pack/action1;#echo 3}}
#CLASS 0
#cLASS {Theft/pack/action2}
#TRIGGER {You have regained your mental equilibrium.} {suggest @tar action remove flame from pack;#echo 4;#TEMP {You issue the suggestion} {#T+ Theft/pack/action3;#echo 5;#T- Theft/pack/action2;#echo 6}}
#CLASS 0
#CLASS {Theft/pack/action3}
#TRIGGER {You have regained your mental equilibrium.} {seal @tar 2;#TEMP {You issue the suggestion} {#T+ Theft/pack/action4;#echo 7;#T- Theft/pack/action3;#echo 8}}
#CLASS 0
#cLASS {Theft/pack/action4}
#TRIGGER {You have regained your mental equilibrium.} {#T- Theft/pack; theftoff}
#CLASS 0
it doesn't work completely. It gives random resoults. Let me give my output.
A)
H:252 M:246 <eb> hypnotise trax
You prepare yourself to hypnotise your victim, Demon Blade, Trax Llor'on.
H:252 M:241 <eb>
You fix Demon Blade, Trax Llor'on with an entrancing stare, and smile in
suggest trax action drop pack
satisfaction as you realise that (?his?) mind is yours.
H:252 M:241 <eb>
You issue the suggestion, concealing it deep within Trax's mind.
7
8
7
8
7
8
1
H:252 M:237 <-b>
You have regained your mental equilibrium.
suggest trax action remove pack
H:252 M:237 <eb>
You issue the suggestion, concealing it deep within Trax's mind.
2
3
H:252 M:232 <-b>
You have regained your mental equilibrium.
B)
You prepare yourself to hypnotise your victim, Demon Blade, Trax Llor'on.
H:252 M:275 <eb>
You fix Demon Blade, Trax Llor'on with an entrancing stare, and smile in
suggest trax action drop pack
satisfaction as you realise that his mind is yours.
H:252 M:275 <eb>
You issue the suggestion, concealing it deep within Trax's mind.
1
H:252 M:271 <-b>
You have regained your mental equilibrium.
suggest trax action remove pack
suggest trax action remove flame from pack
4
H:252 M:271 <eb>
You issue the suggestion, concealing it deep within Trax's mind.
2
3
5
6
H:252 M:266 <-b>
You must regain your equilibrium first.
H:252 M:266 <-b>
You have regained your mental equilibrium.
seal trax 2
H:252 M:266 <eb>
You draw Demon Blade, Trax Llor'on out of his hypnotic daze, your suggestions
indelibly printed on his mind.
H:252 M:248 <-b>
You have regained your mental equilibrium.
seal trax 2
H:252 M:248 <eb>
Demon Blade, Trax Llor'on is not under your hypnotic spell, Khunkao.
Any suggestion on whats wrong? |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Aug 04, 2006 2:36 am |
What's wrong is that the class Theft/pack is enabled until the very end, so the "You issue the suggestion" trigger within it will fire at the same time the triggers with this same pattern fire in the other classes, so this enables once more Theft/pack/action1 which repeats the sequence before it has actually finished.
Try a multi-state trigger which should be simpler and less prone to these kind of issues:
#ALIAS steal {hypnotise @tar;#T+ packtheft}
#TRIGGER {drops pack} {get pack}
#TRIGGER "packtheft" {with an entrancing stare} {suggest @tar action drop pack}
#COND {You have regained your mental equilibrium.} {suggest @tar action remove pack}
#COND {You have regained your mental equilibrium.} {suggest @tar action remove flame from pack}
#COND {You have regained your mental equilibrium.} {seal @tar 2}
#COND {You have regained your mental equilibrium.} {#T- packtheft}
I wasn't sure where the "drops pack" trigger fit into the sequence, so I left it as a separate trigger. If it should go somewhere specific in the sequence instead of at any time, then add it in the appropriate place similar to the other #CONDs. Find out more information about multi-state triggers here. |
|
_________________ Kjata |
|
|
|
bebamedo Novice
Joined: 02 Aug 2006 Posts: 32
|
Posted: Fri Aug 04, 2006 9:37 am |
Thanks Kjata. You have just solved the problem that has hindered my attemtpts at different stuff for months.
|
|
|
|
|
|