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
mksay
Novice


Joined: 25 Apr 2001
Posts: 32
Location: Singapore

PostPosted: Tue Aug 14, 2001 7:33 am   

Re: Rainchild's TellWindow (TM)
 
I have trying to modify Rainchild's script to capture the different types of communications into DIFFERENT windows - tell goes to tell window, chat goes to chat window etc.

#VAR comms {FORM|tell|shout|chat|gossip}
#TRIGGER {{@comms}} {#CAP ???}

I am stucked with the ??? part and it seems %ismember() cannot help me too :(

Any suggestions?
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Tue Aug 14, 2001 12:04 pm   
 
#TRIGGER {({@comms})} {#CAP 1 %1}

Putting round brackets () around the {@comms} lets you access the particular item in the list that fired the trigger.



Caled
zMud 6.16
Reply with quote
mksay
Novice


Joined: 25 Apr 2001
Posts: 32
Location: Singapore

PostPosted: Tue Aug 14, 2001 2:21 pm   
 
Thank you! Work like a charm.
Reply with quote
mksay
Novice


Joined: 25 Apr 2001
Posts: 32
Location: Singapore

PostPosted: Wed Aug 15, 2001 8:48 am   
 
For performance considerations ;)
I am wondering if it would be better to do what I did (storing the channels into a variable) OR simply

#TRIGGER {({FORM|tell|shout|chat|gossip})} {#CAP 1 %1}
instead

Any idea which is perhaps faster?

Thanks :)
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Wed Aug 15, 2001 11:38 am   
 
quote:

For performance considerations ;)
I am wondering if it would be better to do what I did (storing the channels into a variable) OR simply

#TRIGGER {({FORM|tell|shout|chat|gossip})} {#CAP 1 %1}
instead

Any idea which is perhaps faster?

Thanks :)





Logically, the way you suggested should be faster, because if stored in a variable, the parser first has to expand the variable "@comms" into {tell|say etc}, THEN match it, whereas done directly in the trigger, it doesn't have to bother with the expansion stage.

But that's just what -my- logic tells me, I could be completely wrong. Either way, I dont think the difference in speed, if there is one, would be large enough to be noticeable.

Caled
zMud 6.16
Reply with quote
Rainchild
Wizard


Joined: 10 Oct 2000
Posts: 1551
Location: Australia

PostPosted: Thu Aug 16, 2001 7:26 am   
 
Variable manipulation, generally, is something a computer does *REALLY* fast. The main slowdowns come from matching the patterns.

The problem with a trigger as broad as the one specified (ie just one word to set it off) is it has to scan every word in a line to see if it maches.

To speed things up significantly, you should provide as much as you can to fail the trigger as possible... to hasten trigger processing, you need to FAIL the pattern as quickly as possible.

Soo.. if a comms channel always starts with a one word name, and the second word is always the channel (eg: You tell, Bob tells)

Then you should make the pattern:
^%w ({@comms})

Meaning it will fail any line whose second word isn't a channel, thus not having to process the trigger for every word on the line... so instead of running the trigger 14 times per line, it only runs it once...

Wham, there's your performance boost

-- Rainchild
Reply with quote
mksay
Novice


Joined: 25 Apr 2001
Posts: 32
Location: Singapore

PostPosted: Thu Aug 16, 2001 8:02 am   
 
Thanks for the response.

I wish I can make it so simple.
Generally there are two formats used in the mud.

A.
(CHANNEL NAME) So-and-So: 'hi', eg (CLAN), (GROUP)

B.
So-and-so tells you 'hello'.
You tell So-and-so 'hello'.
So-and-so says 'hello'.
So-and-so shouts 'hello'.
and of course the zchat part
So-and-so chats to you|everyone
You chat to everyone|So-and-so

If there is a single list of patterns that I can use to capture all channels and also the channel_name into %1, that will be perfect.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Aug 16, 2001 8:40 am   
 
2 cases, 2 triggers to fail quicker as RainChild points out



#VAR {Comms} {say|tell|shout|chat}
#TR {^%x ({@comms}){ |s | to |s to }} {#CW green}
#SH So-and-so tells you 'hello'.
#SH You tell So-and-so 'hello'.
#SH So-and-so says 'hello'.
#SH So-and-so shouts 'hello'.
#SH So-and-so chats to you|everyone
#SH You chat to everyone|So-and-so



#VAR {Chans} {FORM|Gossip|Info|Chat|Clan|Group|CHANNEL NAME}
#TR {^~({@chans})~) %x:} {#CW red}
#SH (CHANNEL NAME) So-and-So: 'hi'
Reply with quote
mksay
Novice


Joined: 25 Apr 2001
Posts: 32
Location: Singapore

PostPosted: Thu Aug 16, 2001 9:01 am   
 
Thanks TonDiening.

What to improve that to capture that specific line into individual channel window too?

Currently, I have it setup as
#TRIGGER {({FORM|tell|shout|chat|gossip})} {#CAP 1 %1}
which is working well, just that it is not perfect yet because of the performance consideration as we discussed.
Reply with quote
mksay
Novice


Joined: 25 Apr 2001
Posts: 32
Location: Singapore

PostPosted: Thu Aug 16, 2001 9:07 am   
 
I guess what you were saying is that %1 can still be used to capture the channel name. Looks great. I will test it out. Thanks.

#VAR {Comms} {say|tell|shout|chat}
#TR {^%x ({@comms}){ |s | to |s to }} {#CW green;#CAP 1 %1}
#SH So-and-so tells you 'hello'.
#SH You tell So-and-so 'hello'.
#SH So-and-so says 'hello'.
#SH So-and-so shouts 'hello'.
#SH So-and-so chats to you|everyone
#SH You chat to everyone|So-and-so


#VAR {Chans} {FORM|Gossip|Info|Chat|Clan|Group|CHANNEL NAME}
#TR {^~({@chans})~) %x:} {#CW red;#CAP 1 %1}
#SH (CHANNEL NAME) So-and-So: 'hi'
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Aug 16, 2001 9:21 am   
 
Add the check from beginning of line ^ that will speed it up.

quote:

#TRIGGER {^Your trigger here...



Test different things with
#VAR V_Start %ctime
#LOOP 1000 {tell youname test} // if you can and not get spam warnings
#VAR V_End %ctime
#ECHO [@V_End - @V_Start]

If you can't spam that to the mud try
#VAR V_Start %ctime
#LOOP 1000 {#SH You tell youname test}
#VAR V_End %ctime
#ECHO [@V_End - @V_Start]

Probably over 1000 iterations the fastest would be as explicit as possible ie
#TR {^You tell the group} versus
#TR {^%w ({tell|say|..})}

Although I find it hard to believe that capturing text is your most
called trigger/aliases which impedes your speed for whatever you need it
for.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Aug 16, 2001 9:37 am   
 
As a side point, when I go hot and enter a PK battle,
all by class folders turn off except those necessary in the
killing of that other player.

The class folders come back on upon a button toggle or if I
kill the other. I have a none, passive and active pk level
which turn all/some/less clss folders.

When I am safe I use the #SC command to see if I missed anything.

You could use that to see what communication events you missed.

From the help file:
SCROLL

Syntax: #SC pattern [lines]

Displays all lines in the scrollback buffer that match the specified pattern. If you do not specify how many lines to display, zMUD displays all matching lines.

SCROLL example
#SC Zugg

Displays every line in the scrollback buffer that contains the string "Zugg"

#SC Zugg 4

Displays the last 4 lines in the scrollback buffer that contains the word "Zugg"



You could search for ({@Comms})
Reply with quote
mksay
Novice


Joined: 25 Apr 2001
Posts: 32
Location: Singapore

PostPosted: Thu Aug 16, 2001 10:41 am   
 
Hmmm.... looks like I have missed out another possible pattern:

So-and-so channel_name,

e.g.
Jack whispers, 'Hi'.
You whisper, 'Hi'.

I tried to use %p to try to match the punctuation immediately after the channel name and have failed :(

My trigger patterns now looks like this
({[CLAN]|[GROUP]|tell|say|shout|chat}){ |s| to |s to }
It works well for all except the pattern with a punctuation directly following the channel_name.

Thanks for your help :D
Reply with quote
Rainchild
Wizard


Joined: 10 Oct 2000
Posts: 1551
Location: Australia

PostPosted: Thu Aug 16, 2001 11:00 am   
 
Try

^%w ({[CLAN]|[GROUP]|whisper|tell|say|shout|chat}){,|s,| to |s to }

Though that requires a 1-word name, so "A sexy elfin lass" won't be captured to your tell windows...
Reply with quote
Sinema
Beginner


Joined: 14 Nov 2001
Posts: 27
Location: USA

PostPosted: Wed Dec 26, 2001 8:58 am   
 
Hey Hey!

I tried to install this setup for Rainchild's TellWindow (TM) :-)

But having no luck I guess.

I'm not sure what's going on, as I tried #TRIGGER {tells you} {#CAP tell;#GAG} and it worked just fine.

If your curious how I installed the lines .. they were all enter via the Command Line..

I just copy and pasted each line in and it created folder/aliases/triggers/variables etc.. on it's own

The MUD I play on uses "Tells you" , "Shouts" , "Yells" etc.. so I shouldn't have to alter anything in the coding to make it work..

It just seems my zMUD is not picking up the triggers for this particular script ( which, if it does work for me, will be pretty darn useful *Grin*)

Any help is appreciated and all thanks in advance!

~
Regards,

Sinema
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Thu Dec 27, 2001 4:13 am   
 
quote:

The MUD I play on uses "Tells you" , "Shouts" , "Yells" etc.. so I shouldn't have to alter anything in the coding to make it work..


Which mud do you play?


Caled
Reply with quote
Sinema
Beginner


Joined: 14 Nov 2001
Posts: 27
Location: USA

PostPosted: Wed Jan 02, 2002 4:28 am   
 
Sorry,

I play on a MUD called Avalon

I use zMUD 6.22

Not sure why it's not working but hopefully someone can see.
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