Torch Auto
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Torch Auto
Just wondering about something here. Would it be at all possible to automatically light torches with a trigger if it's dark, and extinguish them when there is light again? Cuz let's be honest, everyone occasionally forgets about their torches until they burn out after you've been sitting somewhere idle for three hours.
Think it could be done? Currently I'm using Mudlet.
Think it could be done? Currently I'm using Mudlet.
Alea iacta est. Serius regredi est.
Re: Torch Auto
I haven't used torches in a long time. Do they give a message just before they go out (e.g. "the flame on the excellent torch begins to flicker and fade" or whatever)? If so just make a trigger. But I also think you can light a torch, as long as it's in inventory but not in a pack or anything, even if you're in darkness.Kwevin wrote:Just wondering about something here. Would it be at all possible to automatically light torches with a trigger if it's dark, and extinguish them when there is light again? Cuz let's be honest, everyone occasionally forgets about their torches until they burn out after you've been sitting somewhere idle for three hours.
Think it could be done? Currently I'm using Mudlet.
Re: Torch Auto
Have 2 out, 1 lit. When the message pops, light torches, get torch from pack.
Re: Torch Auto
I like to use the Excellent Torches from Avenir/Sybarus. I usually run through the tunnels underneath the Dark Elves and grab some from the crates/chests. They burn about 30min each and I carry 5 or so. I have this simple trigger in Mudlet for lighting them after one burns out (I usually burn two at once)
PATTERN (perl regex):TRIGGER CODE:
If you wanted to set it up so that it auto-lights when you enter "A dark room." you could use the following. It is dependent on having at least one torch in your inventory when you enter the dark room.
PATTERN (perl regex):TRIGGER CODE:
PATTERN (perl regex):
Code: Select all
^(?:> )?The excellent torch goes out\.$
Code: Select all
sendAll("light torch","light second torch",false)
sendAll("open scrip","get torch from scrip",false)
tempTimer(1,function() send("close all",false) end)
If you wanted to set it up so that it auto-lights when you enter "A dark room." you could use the following. It is dependent on having at least one torch in your inventory when you enter the dark room.
PATTERN (perl regex):
Code: Select all
^A dark room\.$
Code: Select all
send("light torches",false)
Re: Torch Auto
One can also:Shanoga wrote:
PATTERN (perl regex):Code: Select all
^(?:> )?The excellent torch goes out\.$
TRIGGER CODE:
Code: Select all
send ("drop burnt torch")
Re: Torch Auto
I have no idea how to code, but could one write a script to periodically <appraise light> and then <extinguish torches> if 1) it's light, naturally or otherwise, and 2) nothing is emitting darkness?
Re: Torch Auto
I don't see why not. Sounds like you'd want A. a alias that starts (and another that stops) B. a timer and C. a trigger with two patterns, that fires when either one is matched.Raelle wrote:I have no idea how to code, but could one write a script to periodically <appraise light> and then <extinguish torches> if 1) it's light, naturally or otherwise, and 2) nothing is emitting darkness?
This would be easy in Mudlet (so easy that I could do it!), but if you're using something else, including the web client, I've no idea.
Re: Torch Auto
It would interfere with magic map and seeing exits - you can not see them in dark and you would have to move to other room with active light source to be able to. It is easier to have torch on all the time.Raelle wrote:I have no idea how to code, but could one write a script to periodically <appraise light> and then <extinguish torches> if 1) it's light, naturally or otherwise, and 2) nothing is emitting darkness?
Re: Torch Auto
Certainly. I'm one who tends to try and reduce spam, so I would create some an additional trigger that gags the typical MUD output from appraise light when it checks. You could check whenever you want - including in every room you enter. You could do some combination of the following things.Raelle wrote:I have no idea how to code, but could one write a script to periodically <appraise light> and then <extinguish torches> if 1) it's light, naturally or otherwise, and 2) nothing is emitting darkness?
Keep in mind, I am writing this here only and not in Mudlet therefore I haven't tested it.
Trigger "Automatically Extinguish Torches":
PATTERNS:
Code: Select all
^(\w+) is in the open air and naturally light\.$
^(\w+) is indoors and lit\, either by a torch\, or by natural sources\.$
Code: Select all
selectCurrentLine()
deleteLine()
if torchLit = true then
send("extinguish torches", false)
torchLit = false
end
Trigger "Gag Dark Room":
PATTERNS:
Code: Select all
^(\w+) is indoors and naturally dark\.$
^It is dark\, very dark\. What else is there to observe\? Nothing\, you see nothing\.$
Code: Select all
selectCurrentLine()
deleteLine()
Script "AutoExtinguish":
User Event Handler:
Code: Select all
gmcp.room
Code: Select all
function AutoExtinguish()
if torchLit = true then
enableTrigger("Gag Dark Room")
enableTrigger("Automatically Extinguish Torches")
send("appraise light",false)
end
tempTimer(.5, function()
disableTrigger("Gag Dark Room")
disableTrigger("Automatically Extinguish Torches")
end)
end
If you don't want to check in every room, you could set this up to check every 5th, 10th, or any interval of rooms that you want. Simply add this to the code just below "function AutoExtinguish()" and change "10" to the interval of rooms that you want to check:
Code: Select all
roomLightCounter = roomLightCounter or 0
roomLightCounter = roomLightCounter + 1
if roomLightCounter ~= 10 then
return
end
roomLightCounter = 0
PATTERN (perl regex):
Code: Select all
^A dark room\.$
Code: Select all
send("light torches",false)
torchLit = true
I would also recommend an alias like this if you go this route:
ALIAS PATTERN:
Code: Select all
^light (\w+ )(torch|torches)$
Code: Select all
send(matches[1])
torchLit = true
And just to be safe, if you ever DO want to appraise the light in the room and something has gone weird with your torchLit variable, we want to make sure we aren't gagging the output:
ALIAS PATTERN:
Code: Select all
^appraise light$
Code: Select all
disableTrigger("Gag Dark Room")
disableTrigger("Automatically Extinguish Torches")
send(matches[1])(
This allows you to automatically be checking the light status in the room for EVERY room you enter IF you have a torch lit, but it shouldn't be spamming your screen with all of the checks. As soon as you enter a lit room, you will automatically extinguish your torch and set Mudlet to NOT send the <appraise light> command to the MUD. Your Mudlet will be running the code, but you won't be spamming the Genesis servers this way.
Note: It's kinda hacky. There are probably more elegant ways of doing it. This may have some errors since it's totally untested. and I wrote it in this post instead of in Mudlet. But this will at least get you started and you could potentially add specific cases on top of this.
Re: Torch Auto
thanks for posting that Shanoga!!
like I said, I don't know how to do this stuff, but I'd like to learn, so it's really helpful to see all the different parts laid out as you did above.
like I said, I don't know how to do this stuff, but I'd like to learn, so it's really helpful to see all the different parts laid out as you did above.
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/