Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Sat Nov 17, 2012 2:26 am   

#cond For Prac script Need help.
 
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger priority="10400" copy="yes">
    <pattern>* Clan Training Dummy *</pattern>
    <value>cast,%item( '@spellList', Dummy, @listPosition)
#cond (You haven't the energy to cast that spell) {#abort}
</value>
  </trigger>
</cmud>


I read up on Cond and this should work , it does not, Like the whole prac script !

It sometimes reads the @spellist ,It sometimes puts the " ' " around the spell ie cast 'fireball' dummy

The #abort never stops the trigger when the text "You haven't the energy to cast that spell"

Any help in getting this to work , I could figure this out if there where more real world mud example in help, but I don't want to colour the txt :) Just stop a trigger from firing
_________________
Entropy rules
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sat Nov 17, 2012 2:41 am   
 
#cond never goes in the code of a trigger. Similar to the #trigger command, #condition actually makes a new trigger as a second state to the previously entered trigger. You could just make a second state through the package editor, or paste this in:
Code:
#trigger {* Clan Training Dummy *} {cast,%item( '@spellList', Dummy, @listPosition)}
#cond {You haven't the energy to cast that spell} {#abort}
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Sat Nov 17, 2012 3:08 am   
 
The trigger is still turning it self off before this is even on the mud output screen "You haven't the energy to cast that spell "
_________________
Entropy rules
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Nov 17, 2012 9:41 am   
 
Triggers can only be turned off via the #t- command. Also, #abort only affects the current state.
_________________
EDIT: I didn't like my old signature
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Sat Nov 17, 2012 10:39 am   
 
MattLofton wrote:
Triggers can only be turned off via the #t- command. Also, #abort only affects the current state.


Ok so this #trigger is wrong then, I understand you telling me it's wrong because I want to turn off a trigger when a txt is sent from the mud, using a #cond, YES ?. It's just me and Daern thought it would be right. So confused.

{* Clan Training Dummy *} {cast,%item( '@spellList', Dummy, @listPosition)} "Dummy" is there because @targetlist won't work.
#cond {You haven't the energy to cast that spell} {#abort}

So how to use the #t- to turn off triggers when an event happens so another triggers can fire. then turn it back on, after that second triggers has worked. I used #t- in classes , but been unable to get them to work in triggers, spaces or something.
_________________
Entropy rules
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sat Nov 17, 2012 10:54 pm   
 
To turn a trigger on or off, you need to give it an ID, then use #T+ or #T- <id>.
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Sat Nov 17, 2012 11:02 pm   
 
Daern wrote:
To turn a trigger on or off, you need to give it an ID, then use #T+ or #T- <id>.


I like the library information , but a practical example of a trigger would be a help

{* Clan Training Dummy *} {cast,%item( '@spellList', Dummy, @listPosition)} "Dummy" is there because @targetlist won't work.
#cond {You haven't the energy to cast that spell} {#abort}

I still need to get this on trigger to work.
_________________
Entropy rules
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Nov 18, 2012 4:35 am   
 
1)read the helpfile for %item().

2)move the single quotes out of the %item() function. Where they are placed now, they will either be parsed away entirely (to produce something like "cast lightning storm dummy" which is clearly incorrect) or will be included in the first and last elements of the spellList stringlist variable (ie, "cast 'fireball dummy" or "cast fireball' dummy").

3)get rid of the #condition entirely (or otherwise better explain and provide direct examples of what you want to do).

There, problem solved.
_________________
EDIT: I didn't like my old signature
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Sun Nov 18, 2012 5:45 am   
 
MattLofton wrote:
1)read the helpfile for %item().

2)move the single quotes out of the %item() function. Where they are placed now, they will either be parsed away entirely (to produce something like "cast lightning storm dummy" which is clearly incorrect) or will be included in the first and last elements of the spellList stringlist variable (ie, "cast 'fireball dummy" or "cast fireball' dummy").

3)get rid of the #condition entirely (or otherwise better explain and provide direct examples of what you want to do).

There, problem solved.


So glad I asked for an example of a trigger, He is an example of casting a spell instead that is used on my mud. It requires it to be written like this cast 'fireball' dummy.

(or otherwise better explain and provide direct examples of what you want to do).
The below trigger does not work and I would like it too.

{* Clan Training Dummy *} {cast,%item( '@spellList', Dummy, @listPosition)} "Dummy" is there because @targetlist won't work.
#cond {You haven't the energy to cast that spell} {#abort}

I just can't be bothered with this anymore , waste of time asking, so your right problem has been solved .
_________________
Entropy rules
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Nov 18, 2012 9:13 am   
 
"The below trigger does not work and I would like it too" is not a better explanation nor a direct example of what you're trying to do. What EXACTLY is the MUD text that you want to trigger on, and what EXACTLY do you want to happen when the trigger fires? Explaining that would be a good start, cause right now your code makes no sense so it's impossible to derive any meaning of what you're trying to do from it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net