mIRC Home    About    Download    Register    News    Help

Print Thread
#245215 13/04/14 07:44 PM
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
I found a snippet code and decided to use it for my twitch bot. I edited it to my requests:
1. give a warning on first 70% caps message
2. time out on 2nd caps if it ghas been less than 5 minutes from last caps message
My bot says "stop typing in caps! [warning]" on first message without timing out, and on 2nd message it does time them out, BUT it says the same [warning] message. How would i get it to not say warning on 2nd time out?

Code:
on *:text:*:#:{
  if ($nick isop #) { halt }
  if ( $len($1-) >= 10 ) {
    if ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 70 ) { msg $chan $nick -> stop typing in caps! [warning] }
    write capsban.txt $nick
    .timerCapsBan 1 300 CapsBan # $nick
  }
}
alias -l CapsBan {
  write $+(-ds,$nick) capsban.txt
}


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2014
Posts: 72
A
Babel fish
Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Thanks! Were did you find this snippet?

Joined: Mar 2014
Posts: 72
A
Babel fish
Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Also where do you type to say a message like Ay You! Calm your caps [Warning] ??

Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Originally Posted By: AllDayGrinding
Thanks! Were did you find this snippet?
http://hawkee.com/snippet/4373/ searching a code with MIRC in it will most likely bring you to a snippet


Originally Posted By: AllDayGrinding
Also where do you type to say a message like Ay You! Calm your caps [Warning] ??


add a random variable:
Code:
on *:text:*:#:{
  if ($nick isop #) { halt }
  if ( $len($1-) >= 10 ) {
    if ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 70 ) {
      var %capsblock = $rand(1,3)
      if (%capsblock == 1) { msg $chan $nick -> stop typing in caps! [caps] [warning] }
      if (%capsblock == 2) { msg $chan $nick -> Ey! stop yelling! [caps] [warning] }
      if (%capsblock == 3) { msg $chan $nick -> stop typing in BIG LETTERS! [caps] [warning] }
      write capsban.txt $nick
      .timerCapsBan 1 300 CapsBan # $nick
    }
  }
}


Also still need a way for it to not say warning the second time

EDIT: look at the "msg $chan" behind the variable spots
Code:
{ msg $chan $nick -> Ey! stop yelling! [caps] [warning] }

Last edited by judge2020; 13/04/14 08:54 PM.

#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2014
Posts: 72
A
Babel fish
Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
You are a really good "Script Writer" I Really need help with my script would you be able to help me out?

Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
I started scripting for twitch one month ago and just learned basics from other scripts that have been posted. If anything, I am a halfway good editor.

Anyone know how to make 2nd response not warn?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191

Code:
on !*:text:*:#:{
  if ($nick isop #) { return }
  if ( $len($1-) >= 10 ) {
    if ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 70 ) { 
    
      ; check if user is not warned yet
      if !$istok(%caps.warned,$nick,32) {

        ; warning user      
        msg $chan $nick -> stop typing in caps! [warning] 
        
        ; add user to %caps.warned, so we can check it later
        set -e %caps.warned $addtok(%caps.warned,$nick,32)
        
        ; set timer to remove user from %caps.warned after 300s
        .timer 1 300 remove.warned $nick
      }
      else {
        ; so user is already warned.. 
        ; place your timeout command here
      }
    }
  }
}

alias -l remove.warned {
  set -e %caps.warned $remtok(%caps.warned,$1,1,32)
}

Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
you have isop as a returning command :P but good script overall!

EDIT: sorry the original is right

Last edited by judge2020; 14/04/14 12:05 PM.

#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
So, do you want to warn your own ops? If you do, just remove the line. But afaik you can't timeout another op in the twitch irc just like that. So what you could do is put that where your own lines go when timing out.

You also displayed this same statement in your original code as well. So I don't think it's too surprising that it was included.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
edited it. was wrong...


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Originally Posted By: judge2020
you have isop as a returning command :P but good script overall!

EDIT: sorry the original is right

Return is more likely same as halt. In most cases i prefer return instead of halting.


Link Copied to Clipboard