mIRC Home    About    Download    Register    News    Help

Print Thread
#250091 02/01/15 08:16 PM
Joined: Nov 2014
Posts: 13
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Nov 2014
Posts: 13
I have this script for it, but its not working, i cant see why its not working

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
msg /timeout $nick 120
}
}
}

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
The last line should be msg $chan .timeout $nick 120

At least that's I think the command is on Twitch, but it might be .ban


Joined: Nov 2014
Posts: 13
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Nov 2014
Posts: 13
The command on twitch its
msg $chan /timeout $nick (Timeofban)

i had that set but still wont work, it keeps adding a *# before the command

i dont know why its doing that

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
The /timeout command only works in the Twitch chat (web browser). AFAIK, you have to use "msg $chan .timeout $nick 120", which will do the same as using /timeout in the web chat (except it's visible).

I made that change to your script, and it's working as intended.





Joined: Nov 2014
Posts: 13
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Nov 2014
Posts: 13
Thank you its working now, my next question is that, i have a link protection script and i can turn it off and on, i want to be able to do this for my cap protection aswell, how would i go about doing this

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
There are a number of ways to do that depending on how you want it to work. If it was me, I would want a single command for on/off that could be accessed via Twitch chat by any mod.

Code:
on *:TEXT:!capsprotection:#:{
  if ($nick !isop) { return }
  if (%capsprotection = $null) { set %capsprotection 1 }
  if (%capsprotection = 1) { 
    set %capsprotection 0
    msg $chan Caps lock protection disabled
  }
  else if (%capsprotection = 0) { 
    set %capsprotection 1
    msg $chan Caps lock protection enabled 
  }
}


on *:text:*:#:{
  if ($nick isop #) { halt }
  if ( $len($1-) >= 10 ) && ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 70 ) && ( %capsprotection = 1 ) {
    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
    msg $chan .timeout $nick 120
  }
}

Joined: Nov 2014
Posts: 13
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Nov 2014
Posts: 13
I would want the commands for it as !cap on for cap protection to be on and !cap off for it to be off and i would also want it to be different channels

Thanks for you help pal

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Code:

on *:TEXT:!caps *:#:{
  if ($nick !isop) { return }
  if ($2 = on) { 
    set %capsprot. [ $+ [ $chan ] ] 1 
    msg # Caps protection enabled
  }
  else if ($2 = off) { 
    set %capsprot. [ $+ [ $chan ] ] 0 
    msg # Caps protection disabled
  }
}

on *:text:*:#:{
  if ($nick isop #) { halt }
  if ( $len($1-) >= 10 ) && ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 70 ) && ( %capsprot. [ $+ [ $chan ] ] == 1 ) {
    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
    msg $chan .timeout $nick 120
  }
}

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Originally Posted By: Sakana
Code:

on *:TEXT:!caps *:#:{
  if ($nick !isop) { return }
  if ($2 = on) { 
    set %capsprot. [ $+ [ $chan ] ] 1 
    msg # Caps protection enabled
  }
  else if ($2 = off) { 
    set %capsprot. [ $+ [ $chan ] ] 0 
    msg # Caps protection disabled
  }
}

on *:text:*:#:{
  if ($nick isop #) { halt }
  if ( $len($1-) >= 10 ) && ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 70 ) && ( %capsprot. [ $+ [ $chan ] ] == 1 ) {
    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
    msg $chan .timeout $nick 120
  }
}


fix line 2 adding $chan identifier

Code:
if ($nick !isop $chan) { return }


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Nov 2014
Posts: 13
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Nov 2014
Posts: 13
Thanks man


Link Copied to Clipboard