Triggers for Crisol
A trigger is a rule in your client: when a line that matches a pattern arrives, or a piece of data through GMCP, the client plays a sound, reads it aloud or sends a command. You set it up in your client; the game does nothing for you. They are allowed as long as you are at the keyboard (the check question).
With a screen reader, in the middle of a fight, a warning can arrive behind a lot of text. A trigger tells you as soon as it arrives that you have been disarmed, blinded or poisoned, or that your life is low. This page has the lines just as the game writes them and examples to copy. In the game, help triggers.
Before you start
- Don't tie the pattern to the start of the line (no
^in front): the line can arrive stuck behind the prompt. - With
sound mute on, the line that only names the ailment does not come when its sound plays, so a text trigger does not fire. For that, use GMCP or keepsound mute off. - Some ailments arrive with other sentences, above all those that name who puts them on you. If you don't want to depend on the text or the language, use GMCP.
- Nothing depends on colour: the patterns match the text, with colour or without it.
From the text
Each of these lines comes on its own line, also with the combat summary (reader combat). What goes between <> changes. Under each line, the regular expression pattern that matches it; in almost every client you have to mark the pattern as a regular expression.
- You are disarmed
- line:
<who> DISARMS you and sends your weapon flying!
pattern:DISARMS you and sends your weapon flying!
- line:
- You are blinded ("You can't see a thing!" also comes when you look while blind)
- line:
You are blinded!
pattern:You are blinded! - line:
You can't see a thing!
pattern:You can't see a thing!
- line:
- You are poisoned
- line:
You feel very sick.
pattern:You feel very sick\. - line:
You feel poison coursing through your veins.
pattern:You feel poison coursing through your veins\.
- line:
- You are cursed
- line:
You feel unclean.
pattern:You feel unclean\.
- line:
- You are weakened
- line:
You feel your strength slip away.
pattern:You feel your strength slip away\.
- line:
- You are slowed
- line:
You feel yourself slowing d o w n...
pattern:You feel yourself slowing d o w n\.\.\.
- line:
- Low life
- line:
Warning: less than 40% of your life left
pattern:Warning: less than 40% of your life left - line:
Warning: less than 10% of your life left
pattern:Warning: less than 10% of your life left
- line:
- Your sight returns
- line:
You can see again.
pattern:You can see again\.
- line:
- The poison wears off
- line:
You feel less sick.
pattern:You feel less sick\.
- line:
- The curse wears off
- line:
The curse wears off.
pattern:The curse wears off\.
- line:
In reader mode, after a disarm the prompt starts with Unarmed. until you wield again (help prompt).
Through GMCP
If your client gets GMCP (Mudlet does by itself), the game sends it data apart from the text, the same in English and in Spanish:
Char.Status:unarmedistruewhile the prompt would say unarmed;armed, if you wield something.Char.Affects: each effect carrieskey, its fixed key, in lower case and without accents (blindness,poison,curse,weaken,slow,plague,sleep...);bad,trueif it harms you; andstates, the states it puts on you (blindness, even when it is not the blindness spell that blinds you).nameis its name in your language, for reading.Char.Vitals:hpandmaxhp, to warn you at the life you choose.Char.Items.Equip: your weapon hasslotwieldedand, inkw, the word to pick it up and wield it with.
This is how blindness arrives, for example:
Char.Affects [{"name":"Blindness","key":"blindness","bad":true,"states":["blindness"],"source":"spell","hours":61}]
Every field, in the GMCP help.
In the Crisol packages
The Crisol packages for Mudlet, MUSHclient and genericMud (How to play) already bring these warnings: disarmed, blinded, poisoned, low life, left unarmed, each new ailment with its name, blindness from whatever source and life below the percentage you choose. They come turned off, so you turn on only the ones you want, and they only warn you: they never act for you.
crisol warnings: the list, each on its own line, with its number and whether it is on.crisol warningsand the number or name (crisol warnings disarm): turns it on or off.crisol warnings allorcrisol warnings none: all at once.crisol warnings threshold 25: warns you below 25% of your life.
In Mudlet they come as a line of text, or Mudlet's voice speaks them with crisol warnings voice (crisol warnings text puts it back). In MUSHclient they write a line, which MushReader reads. In genericMud its voice speaks them, and you can also turn them on in the Automation Manager (Triggers and MUD data), each in its crisol_aviso_ group. All three remember what you turn on.
In Mudlet
If you don't use the Crisol package, or want to change the warnings to your liking: open the editor (Alt+E), make a new script, paste this and save it. They are separate examples: keep the ones that suit you. It only speaks the warnings; if you also want it to do something, remove the -- from the line that says so. You can save it again without the warnings doubling up.
-- Example triggers for Crisol. They only speak the warnings.
crisolDisp = crisolDisp or {disparadores = {}, eventos = {}}
for _, id in ipairs(crisolDisp.disparadores) do killTrigger(id) end
for _, id in ipairs(crisolDisp.eventos) do killAnonymousEventHandler(id) end
crisolDisp.disparadores, crisolDisp.eventos = {}, {}
local function avisa(texto) ttsSpeak(texto) end
local function disparador(patron, texto)
table.insert(crisolDisp.disparadores, tempRegexTrigger(patron, function() avisa(texto) end))
end
local function evento(nombre, funcion)
table.insert(crisolDisp.eventos, registerAnonymousEventHandler(nombre, funcion))
end
-- From the text, in English or in Spanish
disparador([[te DESARMA y tu arma sale volando\.|DISARMS you and sends your weapon flying!]], "Disarmed")
disparador([[¡Te quedas ciego!|¡No ves nada!|You are blinded!|You can't see a thing!]], "Blind")
disparador([[Te sientes muy enfermo\.|Sientes el veneno correr por tus venas\.|Sientes el veneno corriéndote por las venas\.|You feel very sick\.|You feel poison coursing through your veins\.]], "Poisoned")
disparador([[Aviso: te queda menos del 40 % de la vida|Aviso: te queda menos del 10 % de la vida|Warning: less than 40% of your life left|Warning: less than 10% of your life left]], "Low life")
-- Your weapon's word, to pick it up again
local arma = nil
local function miraArma(objeto)
if objeto and objeto.slot == "wielded" then arma = objeto.kw end
end
evento("gmcp.Char.Items.Equip", function()
for _, objeto in ipairs(gmcp.Char.Items.Equip) do miraArma(objeto) end
end)
evento("gmcp.Char.Items.Add", function()
if gmcp.Char.Items.Add.location == "equip" then miraArma(gmcp.Char.Items.Add.item) end
end)
-- Through GMCP: unarmed
local sinArma = false
evento("gmcp.Char.Status", function()
local ahora = gmcp.Char.Status.unarmed == true
if ahora and not sinArma then
avisa("Unarmed")
-- remove the -- to have it picked up and wielded:
-- if arma then send("get " .. arma) send("wield " .. arma) end
end
sinArma = ahora
end)
-- Through GMCP: each new ailment, with its name in your language
local males = {}
evento("gmcp.Char.Affects", function()
local ahora = {}
for _, efecto in ipairs(gmcp.Char.Affects) do
if efecto.bad then
ahora[efecto.key] = true
if not males[efecto.key] then avisa(efecto.name) end
end
end
males = ahora
end)
-- Through GMCP: blindness, whoever puts it on you
local ciego = false
evento("gmcp.Char.Affects", function()
local ahora = false
for _, efecto in ipairs(gmcp.Char.Affects) do
if efecto.key == "blindness" then ahora = true end
for _, estado in ipairs(efecto.states or {}) do
if estado == "blindness" then ahora = true end
end
end
if ahora and not ciego then avisa("Blind") end
ciego = ahora
end)
-- Through GMCP: life below the percentage you choose
local umbral, vidaBaja = 30, false
evento("gmcp.Char.Vitals", function()
local v = gmcp.Char.Vitals
if v.maxhp > 0 then
local tanto = v.hp * 100 / v.maxhp
if tanto < umbral and not vidaBaja then
vidaBaja = true
avisa("Low life")
elseif tanto >= umbral + 10 then
vidaBaja = false
end
end
end)
In other clients
In MUSHclient and genericMud, the Crisol package already brings them (above). In VIPMud, zMUD or any other, make a trigger for each pattern above and have it play a sound or have your screen reader read it. If your client takes GMCP in its scripts, check in Char.Status whether unarmed turns true and in Char.Affects whether an entry appears with bad set to true, or one with blindness in key or in states.
More help
- The help on triggers. In the game,
help triggers. - Playing Crisol with a screen reader.
- Sounds: the disarm and each ailment also play a sound, if your client asks for them.