[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  * Triggers Minus Your Name....
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

* Triggers Minus Your Name....

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Kethlar   USA  (7 posts)  [Biography] bio
Date Fri 18 Mar 2005 02:04 PM (UTC)
Message
Iam sorry couldnt find any relevant information on the search for this, I apologize if this is a redundant question.

But here is goes...

I have a Trigger:

INFO: The gods shine upon *!

Now in turn it will send when the Client sees it:
ooc Grats %1

Of course %1 being the Name of the person when they have leveled.

Now in turn when I level it says the Exact same thing...

INFO: The gods shine upon Kethlar!
sends
ooc Grats Kethlar!

Now I will grats myself? I dont think so, I dont need it to grats myself. It there anyway to have the * for the wildcard and have it do anyone who levels besides me?

So if I level It wont grats myself? Frainkly I dont want to rely on a plug in but if i have to then I will have to, but I would like to know know if it is possible without one.

And if it isnt can anyone make a simple plug-in or script to do this? I dont know how to make one myself, that is why iam asking, let alone have it so it ignores my name in the Trigger/PLug-in.

Now in turn, If it is possible, I would like random grats messages... like maybe 10 different ones that it would cycle through or more, if somone levels yeh they maybe redundant, or 2 in a row i dont mind that but there is still a randomness, In my mud code, it cycles through 10 different 'quit' messages and randomizes it. I would like to have hte same if that is possible.

I hope you all read this or even acknowldge me.

Thank you so much for anyones help.

-Kethlar

"In the END everyone dies, I just make that END come sooner"
[Go to top] top

Posted by Shadowfyr   USA  (1,783 posts)  [Biography] bio
Date Reply #1 on Fri 18 Mar 2005 04:49 PM (UTC)
Message
This appears to work. After a lot of fiddling:

<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^The gods shine upon (?!Kethlar)(\w{0,})\!$"
   regexp="y"
   sequence="100"
  >
  <send>ooc Grats %1</send>
  </trigger>
</triggers>


Went a tad nuts trying to figure it out. Obvious things like 'do not match' Kethlar *or* 'do match anything else'. I.e.:

(?!Kethlar)|(\w*)

and other variations blew up on me... Guess I need to look into getting one of those regular expression building programs. lol In any case, I have tested the trigger above and it works as you wanted. ;) It will only send the command when not matching your name. You could also add more names like:

(?!Kethlar|Fred|Jim|Alice)

and also exclude them from the command too.

Its still a bit confusing why the 'or' version didn't work. I mean obviously it shouldn't 'ever' match any case when Kethlar 'is' there, but should match any where it isn't. Yet for some loony reason it produced the reverse situation, where, instead of failing to match, it passed a blank value for all cases where Kethlar wasn't there and Kethlar when it did appear. Basically the complete reverse of what you wanted and what the expression 'seemed' to be telling it to do.... I just do not comprehend why at all. O_o
[Go to top] top

Posted by Kethlar   USA  (7 posts)  [Biography] bio
Date Reply #2 on Fri 18 Mar 2005 06:19 PM (UTC)

Amended on Fri 18 Mar 2005 07:10 PM (UTC) by Kethlar

Message
OK what you just said is to put the "match" does this mean when you open up the trigger options that you put the:

^The gods shine upon (?!Kethlar)(\w{0,})\!$

In the "Trigger: _______________________" at the top of that option box?

Otehr than that I do Have the rest ok from the looks of it.

If this is something else... Then now iam just confused.

Thank you again though very much. I do appreciate it.

-Kethlar

Edit:
Ok i jsut made a new mct file and that is what it was bah.... But for some reason it isnt reading it or noticeing it.... I dont know why. Just really odd.

BTw either doing it manually, or using a mct file it doesnt work for some reason.

"In the END everyone dies, I just make that END come sooner"
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #3 on Fri 18 Mar 2005 09:05 PM (UTC)

Amended on Fri 18 Mar 2005 09:10 PM (UTC) by Flannel

Message
You don't need to worry about any sort of file creation.

Simply copy the text from <triggers> to </triggers> and then go to the trigger dialog (the one with all your triggers in the table) and click the 'paste' button. And it will be added. Simple as that.

Edit: Shadowfyr, it might have to do with the negative lookahead aspect (negative lookahead - doesn't consume characters, and then an or). At least that's my initial feeling.

Yeah, looks like the way you did it is the 'preferred' method. However my first attempt wouldve been what you tried as well.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Kethlar   USA  (7 posts)  [Biography] bio
Date Reply #4 on Sat 19 Mar 2005 10:07 AM (UTC)
Message
Well either or, manually, or file wise, both worked fine.

Even copy and pasteing still didnt work. It copy and pasted fine, and no errors, but when somone levels, it doesnt seem to work... It is really weird.

How did you go abouts and test it Shadowfyr? I would like to know how so I can see how it is supposed to work.

Thank you again for taking hte time with me.

-Kethlar

"In the END everyone dies, I just make that END come sooner"
[Go to top] top

Posted by Shadowfyr   USA  (1,783 posts)  [Biography] bio
Date Reply #5 on Sat 19 Mar 2005 06:12 PM (UTC)
Message
Hmm. Oops. I just noticed that there is an INFO: at the start. That means you really need:

<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^INFO\: The gods shine upon (?!Kethlar)(\w{0,})\!$"
   regexp="y"
   sequence="100"
  >
  <send>ooc Grats %1</send>
  </trigger>
</triggers>

The ^ symbol designates a start of line, so since the line didn't 'start' with "The", it never matched. You could also just delete the ^, but then it would match on 'any' line with that text, not just the INFO lines. When you paste the above, since the trigger has no 'name', you will probably want to delete the original that doesn't work, otherwise it has no way of knowing you intended to replace the bad one.
[Go to top] top

Posted by Kethlar   USA  (7 posts)  [Biography] bio
Date Reply #6 on Sun 20 Mar 2005 01:38 PM (UTC)
Message
AHh well, for some reason it doesnt seem to work at all still.

Even if i was to use my ability as an IMM to echo the:
INFO: The gods shine upon BLAH

It should logically still see it then ooc it. But oddly it doesnt.

That is doing it manually.

Non manually, when the game does it by iteself it still doesnt seem to do it.

I have done, the:
match="^INFO\: The gods shine upon
and
match="^INFO: The gods shine upon
and
match="^\: The gods shine upon
and
match="^: The gods shine upon
and
match="^ The gods shine upon

none seem to work at all..... I didnt add the '(?!Kethlar)(\w{0,})\!$"' to the above becuase it would look to conjested, anyways i never changed any of the ending parts.

Just for some reason it just doesnt like me.... and I cant figure out why.

Can i ask how you test the trigger? I mean there has to be something iam missing or not doing right.

Thank you so much for helping me, iam so trigger stupid that, your help is so appreciated.
Iam also sorry that nothing is working for me, and I keep pestering you and everyone about this Iam so sorry.

-Kethlar

"In the END everyone dies, I just make that END come sooner"
[Go to top] top

Posted by Shadowfyr   USA  (1,783 posts)  [Biography] bio
Date Reply #7 on Sun 20 Mar 2005 06:36 PM (UTC)

Amended on Sun 20 Mar 2005 06:38 PM (UTC) by Shadowfyr

Message
As for how I test it. I use a test world designed to connect to 127.0.0.1 port 1066 and a small program I wrote called Phantom, which fakes a proxy. Basically, instead of letting you connect through the proxy to another server, it simply takes anything sent through it and echoes it back to the client as input. This means you can simply type the line you are trying to match into the command box and it will be recieved as though from a mud. Other than some things like ansi codes, this is basically the same as connecting to a real mud and testing things there. You can find a copy of it at http://www.magnumsworld.com/muds where another player has been nice enough to host some of my stuff.

Now as to why it won't work. As I said, ^ means literally "the next character *must* be the first one on the line." If there is a space or anything else in front of 'INFO', it won't work. Obviously none of the others will either, because you keep changing the text, but your still telling it "This line should start with the following." Using ^ is "usually" safer, since without it someone could do:

OOC Fred: INFO: The gods shine upon Fred!

and it would fire anyway, even though this is obviously not when you want it to happen. But when you use ^ and $, you *must* make sure the stuff in between them is an 'exact' match to the line, including number of spaces, etc. For example, using the version of the trigger I gave you, this is what my test produces:

--- Connected on Sunday, March 20, 2005, 12:20 PM ---
IP list plugin started.
INFO: The gods shine upon Fred! <-command (success)
INFO: The gods shine upon Fred!
ooc Grats Fred <-command (from trigger)
ooc Grats Fred
 INFO: The gods shine upon Fred! <-command (fails)
 INFO: The gods shine upon Fred!
  INFO: The gods shine upon Fred! <-command (fails)
  INFO: The gods shine upon Fred!
INFO:  The gods shine upon Fred! <-command (fails)
INFO:  The gods shine upon Fred!

Just adding 1 or more spaces makes it completely fail. The only case that worked was the first one, which is immediately followed by the ooc command being sent out and recieved back. See what I mean? ;)

Basically, if it doesn't work, then its probably because you got the spacing wrong, its a appearing on a prompt line, or something else is making the line you said you wanted to match, and what is really arriving from the mud, different. It may even be a space at the 'end' of the line, so dropping $ from it could help. (Probably won't hurt anything anyway.) Oh, and you don't need the '\:', just use ':'. I tend to get confused if that is a 'special' character that needs to be forced into a normal one or not. It is used as a special, but only in things like :alphanumeric: or the like, just not where you need it.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #8 on Mon 21 Mar 2005 06:32 AM (UTC)
Message
You can also test with ctrl-shift-F12.

And as a note for testing with the dialog I just mentioned, I suggest having an empty line infront and afterwards (Ctrl-Enter before and after), since otherwise you (sometimes) run into problems matching ^ and $.

But yeah, trigger looks good to me. You most likely have a whitespace related issue (which is why we always ask for pastes of output, not retypes).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Kethlar   USA  (7 posts)  [Biography] bio
Date Reply #9 on Mon 21 Mar 2005 09:35 AM (UTC)
Message
OK you are not going to belive this.

But some how when i copied and pasted the G in gods, was capitalized tha tis the reason why it wasent working, I dont see how that can happen but it did.

Now it works perfectly I love it.

Now i just have to figure out how to make a random part of it so it can cycle through more than 1 grats.

Thank you very much again and Iam sorry to of been such a PITA(Pain in the Ass). I apologize.

Thank you again.

-Kethlar

"In the END everyone dies, I just make that END come sooner"
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #10 on Mon 21 Mar 2005 11:36 AM (UTC)
Message
You can also check the "ignore case" to make it do just that, if you have some stuff you don't know the case of (for whatever reason).

As for the random, you'll need to use scripting, but the random part of it won't be a problem at all. There's numerous posts in these forums (as well as a random social plugin) that can be used as a basis for what you need.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Kethlar   USA  (7 posts)  [Biography] bio
Date Reply #11 on Tue 22 Mar 2005 12:03 PM (UTC)
Message
Ok thank you very much I appreciate it.

Thank you for all your help Shadowfyr and Flannel, you have been so helpful I dont know how i can every repay you guys.

You ahve been so nice and patient with me, and not mean and angry nor did you even get that way when I was confused.
Than you so much.

Bless you both, and I hope you do well in what ever you do.

-Kethlar

"In the END everyone dies, I just make that END come sooner"
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


7,125 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]