mIRC Home    About    Download    Register    News    Help

Print Thread
[Twitch] Count how many a times timed out. #257649 02/05/16 10:19 AM
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
Hello I got a cool idea for my bot and that is to see how many times a user has been timed out in a channel and store it in a txt document.

The message that twitch sends when someone gets timed out is
tmi.twitch.tv CLEARCHAT #channel nick

so it should write to a file everytime that triggers

it should look like this in chat.

User: !timeouts
Bot: User you have been timed out X times. Last time was (timestamp)

User: !timeouts User2
Bot: User2 has been timed out X times. Last time was (timestamp)


The part of the write to file Is the one I cant code.
Code:
on *:text:!timeouts:#: {
  if (%flood) { return }
  set -u4 %flood On
  msg $chan $nick you have been timed out (read file) times. etc
}

Re: [Twitch] Count how many a times timed out. [Re: TUSK3N] #257676 05/05/16 07:38 AM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Use ini files to write to and read from:

http://en.wikichip.org/wiki/mirc/ini_files

Play around with /writeini and $readini, and open the .ini file to see how it's structured -- after that you will probably realize how to solve this problem

Last edited by Sakana; 05/05/16 07:38 AM.