Mudlet: Ritual Help

Ok, so having issues with mudlet and Bloodborn rituals. Trying to get them to go through each step, but it is firing the next one without eq. Below are the files I have

Do Ritual:

function doRitual(ritual)

if not ksys.rituals[ritual] then

output("<red>" .. ritual:title() .. " not a valid Ritual!")

return false

else

output("Beginning " .. ritual:title() .. " ritual. Total steps: " .. #ksys.rituals[ritual])

ksys.temp.ritual = ritual

ksys.temp.ritual_step = 1

end

end


Definitions:

ksys.rituals["blur"] = {

"secure scythe",

"WIELD athame",

"speak albedi",

"chant bujev kuy wo de ulo du elnur nu",

"paint ulo on me with blood",

"empty pipe",

"outc bladder slice; ",

"put bladder slice in pipe",

"light pipe",

"smoke pipe",

"secure athame:,

"wield scythe",

"speak aetolian"}


next ritual steps:


function nextRitualStep()

local step = ksys.rituals[ksys.temp.ritual][ksys.temp.ritual_step]

output("Ritual Step " .. ksys.temp.ritual_step .. " of " .. #ksys.rituals[ksys.temp.ritual] .. ": " .. step)

expandAlias(step)

ksys.temp.ritual_step = ksys.temp.ritual_step + 1

if ksys.temp.ritual_step > #ksys.rituals[ksys.temp.ritual] then

output(ksys.temp.ritual:title() .. " ritual completed!")

ksys.temp.ritual = nil

ksys.temp.ritual_step = 0

end

end


Ritual Hook:


ksys.hooks.functions.rituals =

function()

if not ksys.balances.both() and not ritual_attempt or ksys.temp.ritual == nil then return false end

send(";")

nextRitualStep()

ritual_attempt = true

tempTimer(.2, [[ritual_attempt = false]])

tempTimer(.4, [[send(";")]])

end


Any help or advice would be wonderful.



Comments

  • Not familiar with mudlet, but this line looks suspicious:

    if not ksys.balances.both() and not ritual_attempt or ksys.temp.ritual == nil then return false end


    Looks like you want to abort if you either aren't doing a ritual, or don't have balance, or are already attempting a step. So something like this:

    if not ksys.balances.both() or ritual_attempt or ksys.temp.ritual == nil then return false end

  • MacavityMacavity Chicago, Il
    look in your hooks...

    ksys - system - prompt hooks - hooks - hooks ordering.

    check to see if this line is in there some place.

    addActionHook("Rituals", "ksys.hooks.functions.rituals")

    if not add it.   
    “Unless someone like you cares a whole awful lot,
    Nothing is going to get better. It's not.” 
    ― Dr. Seuss, The Lorax

    Veritas says, "Sorry for breaking your system Macavity."
    Veritas says, "My boss fights crash Macavity's computer now."
    Damonicus
  • MacavityMacavity Chicago, Il
    if you need additional help just msg me IG.  I am happy to help.  My ritual script works great 
    “Unless someone like you cares a whole awful lot,
    Nothing is going to get better. It's not.” 
    ― Dr. Seuss, The Lorax

    Veritas says, "Sorry for breaking your system Macavity."
    Veritas says, "My boss fights crash Macavity's computer now."
    Damonicus
  • Thread can be closed, thanks Mac for all of your help!!

This discussion has been closed.