I'm not good with Lua (basic stuff even doesn't work sometimes)
Just wondering the easiest way to use an alias or a keybinding to cycle through different options for a variable (in this cast stafftype...or something)
this is off the top of my head, but I would like to know if I'm close...or if there's anything else I can do:
if stafftype == dissolution then
stafftype=scintilla
cecho("<orangered> SCINTILLA / FIRE CAST")
else if stafftype == scintilla then
stafftype=lightning
cecho("<yellow> LIGHTNING / ELECTRIC CAST")
else if stafftype == lightning then
stafftype=horripilation then
cecho("<cyan> HORRIPILATION / ICE CAST")
else if stafftype == horripilation then
stafftype=dissolution
cecho("<greenyellow> DISSOLUTION / MAGIC CAST")
And my alias for staffcast would be something like:
send ("staffcast "..stafftype.." at "..target)
Any advice (or a code fix :P) would be incredible. Thanks!
Comments
local staffcastTypes = {"dissolution", "scintilla", "lightning", "horripilation"}
local staffcastIndex = 1
function staffcast()
send("staffcast " .. staffcastTypes[staffcastIndex] .. " at " .. target)
staffIndex = (staffcastIndex == #staffcastTypes and 1) or (staffcastIndex + 1)
end
Then your alias just does:
staffcast()
Results of disembowel testing | Knight limb counter | GMCP AB files
→My Mudlet Scripts
Results of disembowel testing | Knight limb counter | GMCP AB files