Doing more with one alias.
Posted: Sun Aug 05, 2018 11:22 pm
I was asked on the Mudlet discord channel to post some of my scripts, so this is just a couple, all of my scripts follows this same pattern since it's the only way I have learned to script at the moment. This is probably the most simplest script to most of you, but I didn't know how to script and still really don't. I had asked someone to send me a script for my charming spells on the MUD I play, Avalon The Legend lives. He sent me this one first.
function charmingSpell(spell, spellTarget)
send("chant " .. spell)
if spellTarget then
send("cast " .. spellTarget)
elseif target then
send("cast " .. target)
else
send("cast")
end
end
With this you can cast spells at someone else, like a friend, or yourself, or at your target. With this one script I learned a lot about scripting with "if,elseif and else" commands. This one I wrote for poisons.
function PoisonSS(PoiS, SpiTT)
if SpiTT then
send("outp " .. PoiS .. " spit " .. PoiS " at " .. target)
else
send("rub " .. PoiS .. " on knife;stab " .. target)
end
end
With this I can either spit or stab poisons at my target.
function charmingSpell(spell, spellTarget)
send("chant " .. spell)
if spellTarget then
send("cast " .. spellTarget)
elseif target then
send("cast " .. target)
else
send("cast")
end
end
With this you can cast spells at someone else, like a friend, or yourself, or at your target. With this one script I learned a lot about scripting with "if,elseif and else" commands. This one I wrote for poisons.
function PoisonSS(PoiS, SpiTT)
if SpiTT then
send("outp " .. PoiS .. " spit " .. PoiS " at " .. target)
else
send("rub " .. PoiS .. " on knife;stab " .. target)
end
end
With this I can either spit or stab poisons at my target.