Register forum user name Search FAQ

Gammon Forum

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 ➜ General ➜ Multicolor Triggering Help

Multicolor Triggering Help

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


Posted by BlackGuard   USA  (12 posts)  Bio
Date Thu 01 Nov 2012 09:54 AM (UTC)
Message
For my MUD, they have made line gathering for combat much easier. Rather than gathering 123543423423 different lines for a system, we now only really need just a handful of lines to code a decently functioning system.

You are afflicted with anorexia.
You have cured anorexia.

Now the problem I'm having is against illusion offenses where they use those lines to trick my system. Luckily illusions appear as one solid color: grey

Whereas the line from the mud is split into two different colors like so:

"You are afflicted with" is the grey color and "anorexia" would be colored in green.

So basically, I'm trying to tackle illusions for my system by triggering variables based on color. As such, after asking around and banging my head against a wall I've come up with this code Affliction Illusion Checker (AIC):


function AIC(name, line, wildcards, styles) -- Affliction View Illusion Checker
   if ((#styles == 3) and (styles[2].textcolour == GetNormalColour(3))) then
		aic = true
  else
		aic = false
  end
end


This basically checks if the affliction word is green in the line: ^You are afflicted with (.*?)\.$ If it matches the color then it sets variable aic to true. I've set that particular line to keep evaluating and lowered the sequence so it gets processed first before the following trigger gets executed:

^You are afflicted with anorexia\.$

if (aic == true) then
aff_anorexia = true
end


And then I have the prompt reset the aic variable back to false.

Quote:

You ask your angel to afflict yourself with anorexia and it glares at him, tormenting his soul.
You are afflicted with anorexia.
aic: false
aff_anorexia: false
aff_anorexia: false
aic: true
aic: true
[4600] [5024] E100 W99 S100 Dev100 Spark56 <<XP 43%>> [csdb eb] 23:9.963 -100 -
> - ALERT: Target is at 90 % mana. - <
[4600] [4974] E100 W99 S100 Dev100 Spark56 <<XP 43%>> [csdb eb] 23:9.994 -50 -
With a swift movement, you strike yourself with a buckler, the symbol of the Gods flaring as you attack.
You jerk your body to the side, lessening the blow.
You are afflicted with paralysis.
aic: false
aff_paralysis: false
aff_paralysis: false
aic: true
aic: true


This leads me to believe that the script is firing too fast and that's why it's not curing. Rather than toss a delay into the system, I imagine there is a much more reliable and simple method out there. Or maybe there's something else that I'm missing/overlooking? Please help me? I think it's lame these cheap system tricks are whats costing me some fights.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 04 Nov 2012 01:03 AM (UTC)
Message
Is one doing "send to script" and one calling a script? Perhaps if you paste both triggers.

Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by BlackGuard   USA  (12 posts)  Bio
Date Reply #2 on Fri 16 Nov 2012 11:58 PM (UTC)
Message
Sorry for the delay. Here's the info you asked for:

Quote:

<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="^You are afflicted with (.*?)\.$"
regexp="y"
script="AIC"
sequence="1"
>
</trigger>
<trigger
enabled="y"
keep_evaluating="y"
match="^You are afflicted with anorexia\.$"
regexp="y"
send_to="12"
sequence="100"
>
<send>if (aic == true) then
aff_anorexia = true
end</send>
</trigger>
</triggers>
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.


13,997 views.

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

Go to topic:           Search the forum


[Go to top] top

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