Since the last time I noticed this thread, I started experimenting with writing macros for the purpose of idiot proofing!
~~Idiot Proofing with professor mageykun. ~~ What I mean is you can write a function to check conditionals and / or ask for confirmation and then map that function over the regular key for the action you want to idiot proof.
For example, instead of disabling auto-explore (bindkey = [o] CMD_NO_CMD_DEFAULT) as I used to, I now have it protected with a confirmation prompt.
- Code:
#Put this in in init.txt
{
function confirm_autoexplore()
crawl.formatted_mpr("Really autoexplore?", "prompt")
local res = crawl.getch()
if string.lower(string.char(res)) == "y" then
crawl.sendkeys("o")
end
end
}
#Put this in macro.txt
M:o
A:===confirm_autoexplore
In practice, you can tweak this code snippit to add a confirmation to pretty much anything you want! I haven't experimented with doing this to commands inside menus and stuff, but I
think you can- it's just in how you assign the macro. (You can also tweak the confirmation dialog to be more strenuous or forgiving as you feel circumstances dictate- forcing capital Y for confirmation, or letting a double key press confirm for example).
Here's another (silly) example- it stops Troglodytes from stupidly read ID-ing all their book bombs in inventory because you accidentally hit M somehow (this actually
happens to me for some dumb reason). This shows how you can make
conditional dummy proofing- that only kicks in when you want it.
- Code:
#Put this in init.txt
{
function trog_illiterate()
if you.god() == "Trog" then
crawl.formatted_mpr("Really attempt memorization?", "prompt")
local res = crawl.getch()
if string.lower(string.char(res)) == "y" then
crawl.sendkeys("M")
end
else
crawl.sendkeys("M")
end
end
}
#Put this in macro.txt
M:M
A:===trog_illiterate
I'm not sure what else merits a confirmation prompt at this point. You could write yourself one that asks for confirmation before ascending with you.num.runes() is less than 15, if you're someone who forgets one when all rune-ing. I've considered writing one that checks before descending to branch ends the first time, but I haven't found all the lua hooks I'd need yet, and it's never really been a problem.
Aside from macros, I've also started setting up a bunch of conditional (for god/race/background) autoinscriptions (mostly for !<char> protections). They're incomplete for the moment, but maybe someone will find the ones I've got so far convenient.
- Code:
# prevents dropping the orb, unnecessary in 0.11 or greater
autoinscribe = orb:!d
## adds use confirmations on dangerous or problematic consumables
# gods / race are taken into account
# bad potion is too general, ignores temporary resistances, chei, etc
# rework later with ifs.
autoinscribe = bad_item.*potion:!q
autoinscribe = potion.*mutation:!q
: if you.god() ~= "Ashenzari" then
autoinscribe = curse armour:!r
autoinscribe = curse weapon:!r
autoinscribe = curse jewellery:!r
: end
autoinscribe = immolation:!r
# This is mostly to make me pause before panicking and wasting ?blink on ctele levels
autoinscribe = blinking:!r
: if you.race() == "Mummy" or you.race() == "Ghoul" or you.race() == "Vampire" then
autoinscribe = holy word:!r
: end
: if not (you.race() == "Mummy" or you.race() == "Ghoul") then
autoinscribe = scroll.*torment:!r
: end
#This doesn't prevent accidentally mashing M. There's a macro for that.
: if you.god() == "Trog" then
autoinscribe = book:!r
: end
: if you.god() == "Okawaru" then
autoinscribe = enslavement:!v
: end
...and finally, the ever useful --more--'s.
- Code:
##### mores
#Saftey
force_more_message = You are starting to lose your buoyancy.
force_more_message = An Orb of Fire comes into view.
force_more_message = You have a vision of a gate.
force_more_message = You have a vision of multiple gates.
#Hell Effect Messages
force_more_message = "Die, mortal!"
force_more_message = Brimstone rains from above.
force_more_message = You sense an ancient evil watching you...
force_more_message = You hear words spoken in a strange and terrible language...
force_more_message = You feel a terrible foreboding...
force_more_message = A gut-wrenching scream fills the air!
force_more_message = You shiver with fear.
force_more_message = Something frightening happens.
force_more_message = "We do not forgive those who trespass against us!"
force_more_message = "You do not belong in this place!"
force_more_message = "You will not leave this place."
force_more_message = "Trespassers are not welcome here!"
force_more_message = "We have you now!"
force_more_message = You hear diabolical laughter.
force_more_message = You suddenly feel all small and vulnerable.
force_more_message = "Leave now, before it is too late!"
force_more_message = You sense a hostile presence.
force_more_message = You feel lost and a long, long way from home...
Before anyone points it out- yes, I'm aware it was more work to write half this idiot proofing than was worth it (except the mores-
need those). It's kind of fun getting it all set up and customized though.