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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Fri Feb 14, 2003 7:54 am   

New line triggers and a stupid problem i have
 
OK, in my spellup script all the success messages for every spell in the mud i have as triggers to make sure every spell i know is cast and it all works fine... the problem is this..

When I dont want to lvl I can turn on No experience which then leaves a *[NOEXP]* flag on every new line after my prompt with NO newline after it, so during a spellup, i sometimes end up with

{prompt} (i cant' be bothered to put that in hereP)
*[NOEXP]* The success message for the spell

So now my triggers are not picking up the success messages because they do not start at the beginning of a new line eg i would have to take out the ^ from all the triggers i have to fix this... is there a way to get around this or do i have to go edit all my triggers?

thanks for any help :)
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Feb 14, 2003 9:39 am   
 
similar to this developped from this works.

So supposedly something like this works: *untested*

#tr {^~*~[NOEXP~]~* (*)} {
pos = %len(%trigger) - %len(%1)
#gag {%insert(%crlf, %trigger, @pos)}
}

Ton Diening
Reply with quote
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Tue Feb 18, 2003 2:49 pm   
 
OK this solution does not work at all, The trigger fires ok yes, BUT, the results are terrible, I end up with a whole heap of triggers being created by it... EG if the line is

*[NOEXP]* c true

I then find a trigger in my Triggers section
that looks like this

#TRIGGER {
*[NOEXP]* c true} {#gag}

So, all it does is create triggers with the %1 as its pattern... can someone help me here plz :)

(took so long to reply as I recently got a new job and hadn't done much with scripting :) )
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Feb 18, 2003 6:08 pm   
 
quote:
So now my triggers are not picking up the success messages because they do not start at the beginning of a new line eg i would have to take out the ^ from all the triggers i have to fix this... is there a way to get around this or do i have to go edit all my triggers?

No, you don't have to take the ^ out of all your triggers. If you prefer, you can just make new ones which include the *[NOEXP}* flag. It will still take about the same amount of work.
Original trigger: #TR {^The success message for the spell}
New trigger: #TR {~*~[NOEXP~]~* The success message for the spell}

You might try subbing out the flag, I don't know whether that will help or not.
#TR {^~*~[NOEXP~]~* } {#SUB ""}

LightBulb
Advanced Member
Reply with quote
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Tue Feb 25, 2003 5:15 am   
 
I think i tried the Sub command and it didn't work, however if i must make new triggers is there a fast way of doing it or do i have to copy each one and edit it etc ... *sigh*

See the problem may arise where you not only have NOEXP flag but QUIET flag also so... preferably a SUB command would be much more effective it it only worked properly instead of having to make heaps more triggers..
thanks
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Feb 25, 2003 7:26 am   
 
i think there is a way to do this without editing all of your triggers. Triggers won't fire on #SUB'ed text, but they will fire on #SHOW's:

#trigger {^~*~[NOEXP~]~* (*)} {
#gag
#show NOEXP for me
#show %1
}

You'll need to insert the appropriate number of spaces into the pattern above. I've assumed that there is 1 space between *[NOEXP]* and the rest of the line, but if there is more or less please adjust the pattern accordingly.

--------

moon.icebound.net:9000
Reply with quote
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Wed Feb 26, 2003 9:27 am   
 
this sorta works, but sometimes it just fails to work at all so.. i dunno, very confusing :(
and when i say it fails, i mean it gags the line but does not reproduce it so.. yeah, i'm too tired to think about it right now :P
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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