[Mudlet] tempTimer spamming

KlendathuKlendathu Eye of the Storm
edited January 2015 in Client Help

I am trying to use a tempTimer to re-sing aria before it runs out (approx 50 seconds) and am using the following script, triggered from the successfully sung line:

function startAriaTimer()
if ariaTimer then killTimer(ariaTimer) end
ariaTimer = tempTimer(45,[[ ariaTimerFunction() ]] )
end

function ariaTimerFunction()
if otg.defs.current.aria then
send("QUEUE ADD CLASS sing aria at me")
end
killTimer(ariaTimer)
end

The problem is, it just spams sing aria at me until I set my aria priority to 0. What am I doing wrong?


Furthermore, it keeps doing even if I disable the trigger and reset aria to 25 or above :(


Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."

Comments

  • AustereAustere Tennessee
    edited January 2015
    Have you tried adding ariaTimer = nil? I dunno, killTimer looks like it should work there. Why not use a permanent timer for this? Much easier to manually disable.
  • KlendathuKlendathu Eye of the Storm
    Will give it a go, been seriously banging my head on my desk over this. Can't for the life of me see why it's wrong :|

    Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."
  • AustereAustere Tennessee
    Oh I feel you. I went through it a week or so ago with tempTimers. Just start praying to the god @Antonius , sent from on high to fixafy your timers, and hope he takes pity enough to do it. He is a compassionate code god from the look of it, so you should get lucky
  • Are you sure it's a mudlet problem, not a queueing bug? Have you tried just sending the "QUEUE ADD CLASS sing aria at me" manually to make sure it works as expected?

    If queueing it manually works as expected, you might try turning on the "Show sent text" setting in Settings->Input line and adding a couple echos to those two functions, and looking at how often they're being called and what's happening when they are. For example, is it sending "queue add class sing aria at me" a bunch of times at once, or more often than expected?

    You might also want to make sure you don't have another script/trigger somewhere defining ariaTimer (maybe search for "aria" in the script editor search box).

    When it starts spamming you, do you get any error messages in the mudlet error display?
  • My first thought was, as Eld already said, there might be a problem with Aria on server-side curing, rather than an issue with your timer. The code looks correct, and you said you had the same problem even with the trigger disabled but Aria configured to be active on your defense list.
  • KlendathuKlendathu Eye of the Storm
    Thanks all for input. Scrapped the log, rewrote from scratch, exited Mudlet and restarted, job's a good'un. (no idea why it wasn't working and is now)

    Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."
  • You prolly created a lot of tempTimers that you didn't kill while you were coding, that would be the most likely explanation.
Sign In or Register to comment.