I am in the process of making a Twitch.tv Chat Bot. I ran into a problem when I had the bot welcome 1 user at a time, for some reason the bot disconnected and reconnected to the chat and welcomed everyone who was already in the chat at once. Twitch.tv has a rule that you cannot send 20+ messages in 30 seconds, this results in an 8 hour suspension.
My bot account has been suspended twice already.

What I want the bot to do is welcome the new users that have joined every 5 seconds. This is what I want it to say: Welcome to the stream $nick1 $nick2 $nick3
I know I need a timer, but I don't know how to get the script to display multiple users.

This is what I have now.
Code:
on *:JOIN:#ll_delirious_ll: { msg $chan Welcome to the stream $+($nick,!) }


I tried this script, but it did not welcome anybody.
From this post
Code:
 on !@*:JOIN:#:{
    if ($mid(#,2) ison $chan) {
    if ($nick == $mid(#,2)) { return }
    set -e $+(%,ajwelcome.,$cid,#) $addtok($($+(%,ajwelcome.,$cid,#),2),$nick,44)
    if (!$timer($+(.ajw.,$cid,#))) { $+(.timer.ajw.,$cid,#) 1 3 ajwelcome # }
  }
}
alias -l ajwelcome {
  if ($($+(%,ajwelcome.,$cid,$1),2)) {
    msg $1 welcome $v1 $+ , to my channel enjoy your nuggets!!.
    unset $+(%,ajwelcome.,$cid,$1)
  }
}


I also tried this one, but I was only able to get it say something when the bot joined, but not when anyone else joined.
From this other post
Code:
on *:join:#<3:{ 
  if ($nick == $me) { msg # Have no fear Ike_Bot is here. }
  elseif ($me isop #) && (%welcome) {
    set -e %welcome.nicks [ $+ [ # ] ] $addtok(%welcome.nicks [ $+ [ # ] ],$nick,32)
    var %msg = Hey everyone $list(%welcome.nicks [ $+ [ # ] ]) $iif($numtok(%welcome.nicks [ $+ [ # ] ],32) > 1,have,has) joined the stream.
    .timer.welcome [ $+ [ # ] ] 1 3 msg $safe(#) %msg $(|,0) unset %welcome.nicks [ $+ [ # ] ]
  }
}

alias -l list {
  tokenize 32 $1
  var %items = $1-, %list = %items
  if ($0 > 2) {
    %list = $regsubex(%items,/(\x20)/g,$iif(\n == \0,$chr(44) and $chr(32),$chr(44) $chr(32)))
  }
  elseif ($0 > 1) {
    %list = $1 and $2
  }

  return %list
}

alias safe return $!decode( $encode($1,m) ,m)


For the 2 scripts above I did put my channel after the :join:#

Can somebody please help me?

Last edited by Thedelirious1; 11/04/14 11:27 AM.