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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Yaldair
Novice


Joined: 10 May 2003
Posts: 37
Location: Netherlands

PostPosted: Sat Dec 02, 2006 8:29 am   

Triggers not working in classes
 
Hey all,

In WoTMUD you've certain global channels. Such as narrate and chats. Charbal used to have this plugin that would seperate them from the normal output and place them in this different window. Unfortunately that ain't working anymore, so I wrote a simple trigger that does roughly the same.

Basically, it copies the line to another window...gagging the line afterwards doesn't really help since it leaves a blank line (any solution to that?)

Anyway, whenever I place this trigger:

(*) chats '(*)' (pattern)
#capt communication (script)

in the package, it works just fine. However, when I create a new class, then place this trigger in that class, restart cmud (1.17), and see if it works still....it fails. For some reason it just stops working. Class and trigger are both enabled.

It appears only to happen to some triggers, since I've others I can place in different classes that still work. Anyone have an idea what I'm doing wrong?

Thanks in advance
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Dec 02, 2006 12:18 pm   
 
Gag doesn't leave a blank line for me. Simple test:

#loop 30 {#echo blah %i}
#gag -4

Is the trigger actually firing? Try adding an #echo to it and see if it's really going off and it's a problem with your script.

EDIT: In order to test this, I created a new window called "Channels" with the command line and status bar options unchecked, and the no network connection option selected. I then created a trigger in the untitled window that looked like this:

#trig {* chats '*'} {#capture Channels}

and it worked just fine, even when I put it into a class. Even with none of the window options changed, it still works fine. Also, adding a #gag to it didn't create any blank space in the main window. Are you sure it's not left over space from before and after the message or something?
Reply with quote
crycry
Apprentice


Joined: 24 Jun 2006
Posts: 169
Location: UK - South Coast

PostPosted: Sat Dec 02, 2006 12:40 pm   
 
On the mud I play, I get the blank line as well.. this always happens unless im gaging after #capture, the same as your finding. Various people on my mud have tried to get around it as well to no avail. Id be interested to know why this is, maybe its something to do with the way a mud outputs? Ive heard of people using different clients experiencing the same issue, which maybe implies its an idiosyncrasy of the way telnet works in general.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Dec 02, 2006 12:55 pm   
 
Well, I've never had this problem on the MUDs I play. Does it still leave the blank like if you change it to #gag;#gag rather than a single one, or does that just delete another line of output, but leave two blank lines?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
crycry
Apprentice


Joined: 24 Jun 2006
Posts: 169
Location: UK - South Coast

PostPosted: Sat Dec 02, 2006 1:00 pm   
 
Its an odd one for sure. Tried that just now Fang, leaves 2 lines for me instead of the one. Ive never been able to figure it out.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Dec 02, 2006 1:07 pm   
 
Okay, so I connected to WoTMUD and created a new character. If I type LOOK NOTICE in the first room I get this output:

WoTMUD wrote:
Welcome to WoTmud IV, the Wheel of Time MUD, the largest free Wheel of
Time-based online RPG. With more than 6,000 players from 80+ different
countries, we hope that you will enjoy yourself in our corner of the Internet.

Please have a look at our website at http://wotmud.org/ before starting out in
this game. There are a number of features unique to WoTmud that should be taken
account of prior to character creation, and the website is a good place to
discover those. Type "Tell guardian kit" (followed by return) to obtain some
starting equipment, and read the news boards around the cities to obtain the
latest information about the game.


If I create a trigger like so:

#trig {account of prior to character creation, and the website is a good place to} {#gag}

The output then changes to this:

WoTMUD wrote:
Welcome to WoTmud IV, the Wheel of Time MUD, the largest free Wheel of
Time-based online RPG. With more than 6,000 players from 80+ different
countries, we hope that you will enjoy yourself in our corner of the Internet.

Please have a look at our website at http://wotmud.org/ before starting out in
this game. There are a number of features unique to WoTmud that should be taken
discover those. Type "Tell guardian kit" (followed by return) to obtain some
starting equipment, and read the news boards around the cities to obtain the
latest information about the game.


Looks like it's working to me. I do notice, however, that there's a blank line between the last line of the MUD message and your prompt. It could be that this is the blank line you're seeing inbetween the prompts - if you want to get rid of this, you can change the command to #gag 2, which will gag the current line (the chat) and the line after it (the blank one). If you want to get rid of the prompt before the message so you don't get doubled-up prompts, change it to #gag -1;#gag 2 and see how that works.
Reply with quote
crycry
Apprentice


Joined: 24 Jun 2006
Posts: 169
Location: UK - South Coast

PostPosted: Sat Dec 02, 2006 1:39 pm   
 
thats the same line that im getting generated, if you #gag -1;#gag 2, it eats up the previous output line by line, so im finding. its an odd problem..

even if i turn off the mud generated blank line before the prompt, you always get a blank line. maybe the answer lies in a multistate trigger? newb comment for me really, i havnt gotton my head around them yet..

just a thought. just seems like it should be possible if you could make the #gag -1 fire at the right time, firing it actually on the trigger line, will always remove that line before the trigger pattern, thus eating up output that you might want, when it actually needs to fire afterwards. hmms.. just tried making an alias that #gag -1, so its definatly called afterwards, but that goes a bit screwy as well.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Dec 02, 2006 3:07 pm   
 
Well the idea behind #gag -1 is that your output will look like this:

<Prompt>
Trigger pattern
Whitespace
<Prompt>

The #gag -1 goes first, and that removes the line before the Trigger pattern, the prompt. The #gag 2 then removes the trigger pattern and the line following it, the space. If you didn't have the #gag -1 you'd end up with

<Prompt>
<Prompt>

Which some people don't like. That's the only reason I suggest it.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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