mIRC Home    About    Download    Register    News    Help

Print Thread
Timer and Follows #249897 22/12/14 10:29 AM
Joined: Dec 2014
Posts: 6
N
NFNAlexx Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
N
Joined: Dec 2014
Posts: 6
Hello there I have two questions. If is possible to program your bot to be on a timer where at a certain time the bot will post something in the chat on it's own? If so I would like to put !christmas and !sleep on a timer.

Second is it possible to make a follower alert for the bot. Such as if someone follows my bot will know and say "Thanks for the follow [nick name of user who followed here] Enjoy the stream and welcome to the Knights!"

Re: Timer and Follows [Re: NFNAlexx] #249900 22/12/14 10:44 AM
Joined: Jun 2014
Posts: 248
B
Belhifet Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
Good news, both are possible!

Re: Timer and Follows [Re: Belhifet] #249902 22/12/14 10:48 AM
Joined: Dec 2014
Posts: 6
N
NFNAlexx Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
N
Joined: Dec 2014
Posts: 6
nice can I possibly have the scripts?

Re: Timer and Follows [Re: NFNAlexx] #250431 14/01/15 02:42 PM
Joined: Jan 2015
Posts: 2
S
sparky44863 Offline
Bowl of petunias
Offline
Bowl of petunias
S
Joined: Jan 2015
Posts: 2
i would like the answer as well lol

Re: Timer and Follows [Re: NFNAlexx] #250432 14/01/15 05:25 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Can you have the scripts? How would we know what the scripts are?
You can make them yourself however.
/help timers

For the second one, there are at least a dozen threads regarding that, use the search function on the site.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Timer and Follows [Re: NFNAlexx] #250460 15/01/15 05:56 PM
Joined: Jan 2014
Posts: 101
M
Majeye Offline
Vogon poet
Offline
Vogon poet
M
Joined: Jan 2014
Posts: 101
Originally Posted By: NFNAlexx
Hello there I have two questions. If is possible to program your bot to be on a timer where at a certain time the bot will post something in the chat on it's own? If so I would like to put !christmas and !sleep on a timer.

Second is it possible to make a follower alert for the bot. Such as if someone follows my bot will know and say "Thanks for the follow [nick name of user who followed here] Enjoy the stream and welcome to the Knights!"



This is VERY possible. Below I have included the entire code needed to make it possible. I will explain a few parts of it so you understand it a tad better. (I'm sure there is also an easier way to code this as well)

Every timer you add must have its own timerID.. so if you look at the code below you'll see 4 unique timers all with their own ID.

This code also has an ON/OFF feature.. "!links on" will obviously turn the timed messages on, just as "!links off" will turn the timed messages off.

If you look towards the top of the code, only twitch channel moderators will be able to use the ON/OFF features. (you can change this so only the channel streamer can access the code, I'll leave that up to you on how to code that since I'm providing this entire code for you)

Now look at the random numbers after the timerIDs.. see that 300,600,900,1200? Thats the amount of time needed to pass (in seconds) before it'll post that custom message again. 300 seconds = 5 minutes. 600 seconds = 10 minutes. Etc, Etc, Etc. So you can change that to your own discretion. (Keeping in mind that if you send more than 15 messages within a 20 minute period, Twitch will add an 8 hour global ban on your bot... and this is global, so if your bot is in more than 1 channel, every channel + every message = counts towards this formula)

Here is an example:

Code:
on *:TEXT:!links on:#: {
  if ($nick !isop #) return
  msg $chan AutoLINKS is now starting.
  .timer1 0 300 msg $chan Type your first message here
  .timer2 0 600 msg $chan Type your second message here
  .timer3 0 900 msg $chan Type your third message here
  .timer4 0 1200 msg $chan Type your fourth message here }
on *:text:!links off:#: { 
  msg $chan AutoLINKS are now off.
  .timer1 off
  .timer2 off
  .timer3 off
  .timer4 off
}


Now that you have the code, you can add/subtract as many timed messages as you want, just keep in mind you need to keep each one with its own unique timerID. (.timer1, .timer2, .timer3, etc, etc)

Cheers, and happy coding!

Last edited by Majeye; 15/01/15 05:57 PM.
Re: Timer and Follows [Re: Majeye] #250461 15/01/15 06:03 PM
Joined: Jan 2014
Posts: 101
M
Majeye Offline
Vogon poet
Offline
Vogon poet
M
Joined: Jan 2014
Posts: 101
As far as your followed/follower notification, I'd advise caution for reasons listed in my previous post. It'd be very easy for malicious people to get your bot a twitch global 8 hour ban.

Here is an example I have set up for people with a subscriber button, it announces when people subscribe to those specific channels.

I'm sure you could figure out how to modify it for new followers if you truly want that code.


Code:
ON *:TEXT:*subscribed*:#:{
  if ($nick == twitchnotify) { msg # /me $1 has subscribed, thank you for supporting the stream and enjoy the new emotes! }
}

Re: Timer and Follows [Re: Majeye] #250462 15/01/15 09:50 PM
Joined: Apr 2014
Posts: 170
Bramzee Offline
Vogon poet
Offline
Vogon poet
Joined: Apr 2014
Posts: 170
Originally Posted By: Majeye

This is VERY possible. Below I have included the entire code needed to make it possible. I will explain a few parts of it so you understand it a tad better. (I'm sure there is also an easier way to code this as well)

Every timer you add must have its own timerID.. so if you look at the code below you'll see 4 unique timers all with their own ID.

This code also has an ON/OFF feature.. "!links on" will obviously turn the timed messages on, just as "!links off" will turn the timed messages off.

If you look towards the top of the code, only twitch channel moderators will be able to use the ON/OFF features. (you can change this so only the channel streamer can access the code, I'll leave that up to you on how to code that since I'm providing this entire code for you)

Now look at the random numbers after the timerIDs.. see that 300,600,900,1200? Thats the amount of time needed to pass (in seconds) before it'll post that custom message again. 300 seconds = 5 minutes. 600 seconds = 10 minutes. Etc, Etc, Etc. So you can change that to your own discretion. (Keeping in mind that if you send more than 15 messages within a 20 minute period, Twitch will add an 8 hour global ban on your bot... and this is global, so if your bot is in more than 1 channel, every channel + every message = counts towards this formula)

Here is an example:

Code:
on *:TEXT:!links on:#: {
  if ($nick !isop #) return
  msg $chan AutoLINKS is now starting.
  .timer1 0 300 msg $chan Type your first message here
  .timer2 0 600 msg $chan Type your second message here
  .timer3 0 900 msg $chan Type your third message here
  .timer4 0 1200 msg $chan Type your fourth message here }
on *:text:!links off:#: { 
  msg $chan AutoLINKS are now off.
  .timer1 off
  .timer2 off
  .timer3 off
  .timer4 off
}


Now that you have the code, you can add/subtract as many timed messages as you want, just keep in mind you need to keep each one with its own unique timerID. (.timer1, .timer2, .timer3, etc, etc)

Cheers, and happy coding!


If you use this, I would fix it so not just anyone can shut it off. Or change it to include if statements instead.

Also, I think Majeye meant 30 messages in 20 seconds (I'm not sure what the exact amount/time ratio is but I know it's not 15 in 20 mins)


Originally Posted By: Majeye
As far as your followed/follower notification, I'd advise caution for reasons listed in my previous post. It'd be very easy for malicious people to get your bot a twitch global 8 hour ban.

Here is an example I have set up for people with a subscriber button, it announces when people subscribe to those specific channels.

I'm sure you could figure out how to modify it for new followers if you truly want that code.


Code:
ON *:TEXT:*subscribed*:#:{
  if ($nick == twitchnotify) { msg # /me $1 has subscribed, thank you for supporting the stream and enjoy the new emotes! }
}


As for this, I don't believe you can use this for followers. You'd have to read the twitch API (or even simpler, some sort of follower alert that stores the followers in a text file and you can read/welcome them from that) for new followers. As Nillen stated, there are more than a few threads on this. If it IS possible to do something so simple to welcome new followers I've been overworking my bot for awhile :P


Last edited by Bramzee; 15/01/15 09:52 PM.