Hi guys, pretty new to scripting but loving the client. Everything runs so quickly, problems are being fixed constantly and although I'm new to all this, I can already tell how flexible my options are using this client. You guys should be proud of your work
So anyhow, just a quick query - is it possible to trigger something from a variable? I have a variable "target" and I'd like to configure it so when text matching that value is sent from the MUD, it gets highlighted. So if I'm targetting "goblin" and "A goblin hits you" gets sent, the word "goblin" can picked out and highlighted.
I dunno if it's possible with mudlet, or how to go about it if it is, just curious. Thanks in advance.
Triggering from variables?
Re: Triggering from variables?
Hope that explains it all.
Re: Triggering from variables?
In your case Vadi's solution is certainly the best choice.
However, as this forum is intended as a general FAQ, I'll explain how to do real variable triggers.
If you want to trigger on the value of the variable "myVariable" you can make following trigger:
pattern:if myVariable == 17 then return true else return false end
pattern type: Lua condition
script: echo("the variable myVariable=" .. myVariable)
However, as this forum is intended as a general FAQ, I'll explain how to do real variable triggers.
If you want to trigger on the value of the variable "myVariable" you can make following trigger:
pattern:if myVariable == 17 then return true else return false end
pattern type: Lua condition
script: echo("the variable myVariable=" .. myVariable)
Re: Triggering from variables?
Awesome, thank you so much!
Re: Triggering from variables?
What would cause this not to work? (Vadi's solution) I did exactly what was in the picture, and it doesn't highlight. Also, is there an ignore case function as well? Or could I perform something like string.lower on both matches[2] and target so that they'll match even if case isn't the same?
Re: Triggering from variables?
tbh I wouldn't use that, as it's kinda slow. I've come up with a much better "Mudlet way" as described here:
http://dl.dropbox.com/u/84880/mudlet_do ... ing-howtos
(will be in online manual soon)
http://dl.dropbox.com/u/84880/mudlet_do ... ing-howtos
(will be in online manual soon)
Re: Triggering from variables?
Alright. Why do I want capitalize, though? I guess my issue was I'd want it to match either as Renegade or renegade.
Re: Triggering from variables?
Capitalize for the players name. If you'd like to match on both, well then duplicate the 2 lines needed for that one trigger, make one for non-capital name first and another for capitalized.