mIRC Homepage
Essentially, I want something like this:

Code:
<Californ1a>: !on
<Bot>: text
~10 minutes~
<Bot>: text
~10 minutes~
<Bot>: text
<Californ1a>: !off


What I have so far is this, but I'm sure there's something wrong (obviously, because it isn't working), and I'm sure there's an easier way to accomplish this. (I set the timer to 10 seconds for testing)

Code:
var %timed = 0
while (%timed == 1) {
    .timer 0 10 msg $chan text
}
ON *:TEXT:!on:#Californ1a: {
  var %timed = 1
  msg $chan text
}
ON *:TEXT:!off:#Californ1a: {
  var %timed = 0
}


I know a while loop is wrong because the timer itself loops with the 0 there, but I don't know how to disable that. No doubt someone just facepalmed at how bad that script is so forgive me, just now learning how to use timers.
All commands must be in an alias, event, or other type of definition. You can't just have commands sitting in a file not contained in anything.

Code:
on *:text:!on:#Californ1a: {
  .timer.timername 0 600 msg # text
}
on *:text:!off:#Californ1a: {
  .timer.timername off
}
I originally had the while inside the !on, but it just froze mIRC (I guess it was the double loop creating infinite timers?) Thanks though, I knew I was doing something really wrong.

Edit: I need it to say the message a couple seconds after the initial "!on" as well as after the end of each 10 minutes, this script just does it after each 10 minutes. Nevermind, I changed it to this and it's working, thanks:
Code:
on *:text:!on:#Californ1a: {
  .timer.quicktimer 1 5 msg $chan text
  .timer.timername 0 10 msg $chan text
}
on *:text:!off:#Californ1a: {
  .timer.piebux off
}
A timer does all that by itself. The while is unnecessary.

Doing
Code:
ON *:TEXT:!timer*:#: {
  if ($2 == on) {  timerMessage 0 600 msg $chan This is a Message!  }
  if ($2 == off) {  timerMessage off  }
}

Would do the trick, no?

Nvm, loki did it lol.
Yeah, I know the timers work in seconds. I had it set to 10 for testing. Don't want to wait out the 10 minutes every time I made an edit to see if it worked.
When you turn the timer off you need to use the same name as the one you turned on. You just have 3 differently named timers.
© mIRC Discussion Forums