voops   -  Oct 27, 2013

Looking for an easy way to stop a command that is currently being executed.

Details: Made a bot that spams something over multiple periods of time
.....
.timer 1 2 msg $chan "phrase"
.timer 1 4 msg $chan "phrase"
.timer 1 6 msg $chan "phrase"
.....

I would like to make a "!stop" command that ends the above command when triggered. I'm sure I'm just over thinking this one.

KilllerX  -  Oct 27, 2013

what I suggest with timers is to NAME THEM

.timer.[name]

So you can more easily end them /timer.[name] off

otherwise it just lists them as .timer0 .timer1 .timer2, and to figure out what is the last one initiated is harder. Or I think you could just .timers off to turn all off.

voops  -  Oct 27, 2013

What I was looking for was more along the lines of something that stopped the entire script, regardless of what timer it was currently running. Seeing as the timers are set to go off within such a short amount of time it would be hard to keep track of which one was currently active [there's about 30 timers that go off in succession for a full minute of time]. Would there be a similar procedure to what you suggested that would work to turn off the script, by using it's name? like a /halt or something?

Here's what the original script looks like if that helps:

on *:TEXT: "!triggerhere" :#: {
if ($nick !== "mynickhere") {
.timer 1 2 msg "errormessagehere"
}
elseif ($2 == "mynickhere") {
.timer 1 2 msg $chan "phrasehere"
.timer 1 4 msg $chan "phrasehere"
.timer 1 6 msg $chan "phrasehere"
.timer 1 8 msg $chan "phrasehere"
......
.timer 1 60 msg $chan "phrasehere"
}
}

Also, feel free to make suggestions for the script. It is based of the very small amount of understanding that I have of scripting in mIRC. If there is a simpler way to do this, I'd be happy to know about it.

KilllerX  -  Oct 27, 2013

unless you have other timers you need running you can just /timers off

I am not sure if this starts up all timers at once, and I kind of doubt it. So it just might work labeling them as the same name, doesn't work then .[name]1 and then you can do /timer.[name]? off and it will shut off all with that name.

example

on *:TEXT: "!triggerhere" :#: {
if ($nick !== "mynickhere") {
.timer 1 2 msg "errormessagehere"
}
elseif ($2 == "mynickhere") {
.timer.trigger1 1 2 msg $chan "phrasehere"
.timer.trigger2 1 4 msg $chan "phrasehere"
.timer.trigger3 1 6 msg $chan "phrasehere"
.timer.trigger4 1 8 msg $chan "phrasehere"
......
.timer.trigger30 1 60 msg $chan "phrasehere"
}
}

on *:text:!trigger off:#: {
if ($nick !== "mynickhere") {
timer.trigger? off
}
}

would then turn off all the triggers. with the part name "trigger"

If you are typing as the 'bot' you could use !*:text:!Triggerhere:#: {

}

So that you as the bot can't activate it.

voops  -  Oct 28, 2013

Ok, how about using a trigger that puts the /timers off command into mIRC from Twitch chat? Because when I type /timers off in mIRC it stops all the timers and doesn't allow any more to go off.

I tried this...but it isn't working

on*:text:!endtrigger:#: {
if ($nick == "mynickhere") {
/timers off
}
}

KilllerX  -  Oct 28, 2013

I am sure you actually have the space between ON and the * in the actual code. I don't think you need the / in timers off, Typically I use nothing or use the . and it works.

on *:text:!endtrigger:#: {
 if ($nick == 'mynickhere') {
 timers off
}
}

Again, I had my bot up for an 'auto-post' to advertize a donation link. And if I /timers off, it would end it. Yet if I had another timer running that I wanted to end, lets say I name it timer.othertimer, I could /timer.othertime off (yes again I am suggesting naming your timers, it helps a whole lot)

voops  -  Oct 29, 2013

you were right i didn't need the /. it works now :D Thanks so much

KilllerX  -  Oct 29, 2013

No problem, just glad I still remember enough to help.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.