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
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Fri May 12, 2006 2:55 pm   

Old trigger help
 
I have this old trigger and am trying to get it to work.. It will capture and gag it and thats it. If you could please go into to detail I am trying to relearn zmud Embarassed Thanks a bunch

#CLASS {arrivals}
#TRIGGER {(%x %x) just arrived in the world.} {#gag;#gag -1;:Arrivals:#sub %ansi(green,bold)%1%ansi(white)";arrived:"%time( h:mm:ssampm);#cap Arrivals}
#TRIGGER {(%x %x) has left the world.} {#gag;#gag -1;:Arrivals:#sub %ansi(yellow,bold)" "%1%ansi(white)" left: "%time(h:mm:ssampm);#cap Arrivals}
#TRIGGER {(%x %x) has left the world unexpectedly.} {#gag;#gag -1;:Arrivals:#sub %ansi(red,bold)" "%1%ansi(white)" disco'd: "%time(h:mm:ssampm);#cap Arrivals}
#CLASS 0
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri May 12, 2006 4:16 pm   
 
Well, they all do very similar things.

#TRIGGER, of course specifies that you are setting up a command to perform an action on particular output from the MUD.

The first part specifies your matching criteria, for example
Code:
{(%x %x) just arrived in the world.}
. Matches text that starts with two non-whitespace 'words' followed by the phrase " just arrived in the world." Note: %x - match any amount of non-white space.

Next you have your command list that's executed.
Code:
#gag;#gag -1;:Arrivals:#sub %ansi(green,bold)%1%ansi(white)";arrived:"%time( h:mm:ssampm);#cap Arrivals


The #GAG removes the current line from the screen. Specifying a numeral indicates the number lines to remove relative to matched one. -1 will remove the previous line. Note: The line still exists in memory, it's just not displayed

":Arrivals:" The colon at the start pecifies that the following commands are sent to the current window.

Code:
#sub %ansi(green,bold)%1%ansi(white)";arrived:"%time( h:mm:ssampm);
#SUB tells zMud to subsitute the current line the way you specify.

In this case, you specify the color green for the name (i.e. %1 which is what you matched in the parantheses with (%x %x)) with the %ansi function; then you specify the time stamp with in white using the %time function.

Finally using #CAP you capture the current line (which you've just modified) and put that output to the Arrivals window.
_________________
Asati di tempari!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri May 12, 2006 10:03 pm   
 
The #SUB would be extraneous, unless you want to have the changed line in your logs (since you're gagging it you won't be seeing the results on your screen).

#CAPTURE is also extraneous, since it's performing a similar action to the :Arrivals:#sub command. Unless you really want to see double messaging in your Arrivals window, you should get rid of one or the other.
_________________
EDIT: I didn't like my old signature
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Sat May 13, 2006 2:40 am   
 
Thanks a bunch for the replys. I copied he same script into my command line. It captures like it is supposed to and puts it into the arrival window but it wont timestap it nor color it.

This is what is in zmud

#CLASS {arrivals}
#TRIGGER {(%x %x) just arrived in the world.} {
#gag
#gag -1
:Arrivals:#sub %ansi(green,bold)%1%ansi(white)";arrived:"%time()
#cap Arrivals
}
#TRIGGER {(%x %x) has left the world.} {
#gag
#gag -1
:Arrivals:#sub %ansi(yellow,bold)" "%1%ansi(white)" left: "%time()
#cap Arrivals
}
#TRIGGER {(%x %x) has left the world unexpectedly.} {
#gag
#gag -1
:Arrivals:#sub %ansi(red,bold)" "%1%ansi(white)" disco'd: "%time()
#cap Arrivals
}
#CLASS 0


also the above is actually making triggers in my arrival window

#TRIGGER {%ansi(green,bold)Dravon} {#sub Soulkill%ansi(white)";arrived:"%time()}


ahh maybe the problem this is what i see when they arrive

** Dravon Soulkill just arrived in the world.
I see there first name and last would that mess things up?
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Sat May 13, 2006 3:39 am   
 
Try this:
Code:
Pattern:
^~*~* (*) ({just arrived in|has left}) the ({world|world unexpectantly}).$

Value:
:Arrivals:#SAY {%if( %eval( %2)=just arrived in, %ansi( green, bold)%char( 32)%1%ansi( white)%char( 32)arrived:%char( 32)%time( ), %if( %eval( %3)=world, %ansi( yellow, bold)%char( 32)%1%ansi( white)%char( 32)left:%char( 32)%time( ), %ansi( red, bold)%char( 32)%1%ansi( white)%char( 32)disco'd:%char( 32)%time( )))};#GAG;#GAG -1


Edited to include a missed '#'
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Sat May 13, 2006 12:52 pm   
 
sorry that one wont do anything It doesnt gag them or move them
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Sat May 13, 2006 5:57 pm   
 
If you actually tried it you would have seen that it does indeed gag and move it, but then again perhaps you know more about coding than I do. The only part that may require a little tweaking is the trigger pattern which I can only guess at as you haven't actually provided much in the way of output from the mud.

I would go through the code and explain what each portion does however I dislike the dismissive attitude you demonstrated in your previous post so I won't.
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Sun May 14, 2006 10:56 am   
 
I dont waste peoples time I get to the point and make it short as possible. I doubt you or anyone else wants to see me drone on and on about stuff.

I did indeed try your script. I even removed erased and reinstalled zmud and put your script only in there. It did not work.

I also thought I provided enough information for people to work with. I posted this

** Dravon Soulkill just arrived in the world.
I wanted to gag that put it into another window and timestamp it. I am not sure what other mud input you need?

hopefully that clarifys my posts and addresses yours
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Sun May 14, 2006 11:38 am   
 
Which mud is it from? I'll login and make sure the pattern matches correctly.
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Sun May 14, 2006 1:40 pm   
 
unfourntantly it is Dragons gate and they are only allowing people with old accounts to reopen them. Thanks for the offer would it help if I posted a small snippet of my screen?



** Command Queue Cleared.
>

The ork scavenger wanders out via the small opening.

The ork brute wanders southeast.

The ork brute wanders southeast.
Done.
I don't see what you are referring to.
look
>
[Ork Clan.]

Low hoots and howls echo along the corridor walls from the south, alerting to the presence of more than just slimy water and brown lumps further into the cave. The odors of rotting food, sludge and stale air mix together creating a stench that emanates throughout the passage. A small opening is here.

This room is not illuminated.
Obvious exits: southeast.
>

** Dravon Soulkill just arrived in the world.
look
[Ork Clan.]

Low hoots and howls echo along the corridor walls from the south, alerting to the presence of more than just slimy water and brown lumps further into the cave. The odors of rotting food, sludge and stale air mix together creating a stench that emanates throughout the passage. A small opening is here.
se

This room is not illuminated.
Obvious exits: southeast.
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Sun May 14, 2006 7:09 pm   
 
That is indeed unfortunate.. I think the probelm we are having may be that the browser/forum can sometimes strip characters such as extra spaces when posting. The solution to this is to place the output between code tags. If you could highlight another example of output and paste them within code tags it would make life much easier.

In the mean time you may be able to get the trigger pattern I posted in my previous post to work by removing the '^' from the beginning of the pattern and also removing the '$' from the end. These characters I added to make the trigger more secure (I dislike insecure triggers) to minimise the possibility of someone spoofing the trigger.
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Mon May 15, 2006 1:40 am   
 
ok ill give it a try thanks
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Mon May 15, 2006 8:57 am   
 
I got something to work.


[/code]
#TRIGGER {** ([%x%s]) has left the world.} {#sub {{%1 %2} has left the world. {%time( )}}
#cap arrivals
#gag
[/code]

only problem is that it only takes there last name and i see this
[/code]
{Soulkill } has left the world. {Monday May 15, 2006 3:44:17 pm}
[/code]


not alot of people going and coming right now so ill have to get a log of it later
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Mon May 15, 2006 9:22 am   
 
When posting within code tags you only need to use the / on the closing tag.

With your pattern matching if you remove the square brackets and add another %x after the %s you should capture both names, does everyone have two names?

The trigger should look like this:
Code:
Pattern:
(%x%s%x) has left the world.

Value:
#GAG
:Arrivals:#SAY %ansi( green, bold)%char( 32)%eval(%1)%ansi( white)%char( 32)arrived:%char( 32)%time( )


I also remove the ** as they are not necessary because they are special chars within zMud used to match entire lines of text. There is also no need to capture the line and send it to the arrivals windo as you are altering it using #sub, I believe the code is more efficient (and performs the same function) by simply using :Arrivals:#say whatever to put text into the designated window.
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Mon May 15, 2006 9:42 am   
 
cool thanks ill give that a try when my character is out of training

/code like this/


is that what you mean?[/code]
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Mon May 15, 2006 9:55 am   
 
Like this:
Code:
[code]whatever the output from the mud is
more output

even more output[/code]

Which will result in:
Code:
whatever the output from the mud is
more output

even more output
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Mon May 15, 2006 4:14 pm   
 
hmm I put that in and it changed it to the way I wanted it but wouldnt move it. I finnally figured out ow to fix that.
Code:

#CLASS {arriveing}
#TRIGGER {(%x%s%x) has left the world.} {
  #gag
  #SAY %ansi( green, bold)%char( 32)%eval( %1)%ansi( white)%char( 32)left:%char( 32)%time( )
  #cap arrivals
  #gag
  }
#TRIGGER {(%x%s%x) just arrived in the world.} {
  #gag
  #SAY %ansi( green, bold)%char( 32)%eval( %1)%ansi( white)%char( 32)arrived:%char( 32)%time( )
  #cap arrivals
  #gag
  }
#CLASS 0


I couldnt get it to capture it with :arrival: so I put the #cap back in and it would gag the original and the new code so I put a #gag at the end as well. But it is working like i wanted it. Thanks a bunch for taking the time to help me. I really do appreciate it.[/code]
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