Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Lua
➜ Gagging lines with a script.
|
Gagging lines with a script.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Batista
(15 posts) Bio
|
| Date
| Sun 30 Apr 2006 01:32 PM (UTC) Amended on Sun 30 Apr 2006 01:50 PM (UTC) by Batista
|
| Message
| Greetings,
Is there a way to gag a line that is also a trigger in certain situations? I'll give an example.
The line 'Hmmmm. Why must everything be so difficult to figure out?' is a trigger I have that sets the Stupidity variable to 1.
Whenever I get 'Hmmmm. Why must everything be so difficult to figure out?' by itself, I want it to appear as normal. However, when I get it followed by the Doubleslash message, I want it to gag that line but still set the Stupidity variable to 1.
This is the way it is now:
===============================
3500h, 3500m, 16400e, 16400w cexdb-
Hmmmm. Why must everything be so difficult to figure out?
3500h, 3500m, 16400e, 16400w cexdb-
3500h, 3500m, 16400e, 16400w cexdb-
Lightning-quick, Batista jabs you with a rapier.
Hmmmm. Why must everything be so difficult to figure out?
Lightning-quick, Batista jabs you with a rapier.
Hmmmm. Why must everything be so difficult to figure out?
3500h, 3500m, 16400e, 16400w cexdb-
===============================
This is the way I want it to be:
===============================
3500h, 3500m, 16400e, 16400w cexdb-
Hmmmm. Why must everything be so difficult to figure out?
3500h, 3500m, 16400e, 16400w cexdb-
3500h, 3500m, 16400e, 16400w cexdb-
Lightning-quick, Batista jabs you with a rapier.
Lightning-quick, Batista jabs you with a rapier.
3500h, 3500m, 16400e, 16400w cexdb-
===============================
Any ideas? I'd rather not have three sets of triggers to make this work, heh. Is there some sort of function I can use for this?
Thanks in advance for the help!
EDIT: Oh, and by gagging I mean is there a way I can retroactively check and uncheck 'omit from output' from a trigger? | | Top |
|
| Posted by
| Flelm
(15 posts) Bio
|
| Date
| Reply #1 on Sun 30 Apr 2006 10:10 PM (UTC) Amended on Sun 30 Apr 2006 10:17 PM (UTC) by Flelm
|
| Message
| Short answer: No, not the way you want it to.
EDIT: Expanded why not: You can't gag multiline triggers, nor can you go back and remove lines once they've been drawn. That is by design.
Long answer: Here's how I would do it.
I'd have two triggers for the stupidity message. One always on at priority 90 or so, and one disabled by default at priority 100. I'd have the 90 one enable your stupidity affliction variable, and 100 gag the line.
DSL line would enable the 100 trigger, prompt would disable it.
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="^Hmmmm\. Why must everything be so difficult to figure out\?$"
regexp="y"
send_to="9"
sequence="90"
variable="Stupidity"
>
<send>1</send>
</trigger>
<trigger
enabled="y"
group="DSL"
match="Lightning-quick, * you with *."
send_to="12"
sequence="100"
>
<send>EnableTriggerGroup("gag_stupid")</send>
</trigger>
<trigger
group="gag_stupid"
match="*h, *m, *e, *w*-"
send_to="12"
sequence="100"
>
<send>EnableTriggerGroup("gag_stupid", false)</send>
</trigger>
<trigger
group="gag_stupid"
match="^Hmmmm\. Why must everything be so difficult to figure out\?$"
omit_from_output="y"
regexp="y"
sequence="100"
>
</trigger>
</triggers>
=============================================
EDIT 2: Alternatively (I just thought of this) you can run a subroutine that looks something like this (not promising this code is correct):
function stupidity_gag ()
if (GetVariable("DSL") == 0) then ColourNote("gray", "black", "Hmmmm. Why must everything be so difficult to figure out?") end
SetVariable("Stupidity", 1)
end
And have the DSL trigger set DSL to 1, prompt set it to 0, and have the stupidity line gag from output, and just call this function. | | 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.
12,888 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top