mIRC Home    About    Download    Register    News    Help

Print Thread
Cap protection script #250091 02/01/15 08:16 PM
Joined: Nov 2014
Posts: 13
A
AcidzDesigns Offline OP
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
}
}
}

Re: Cap protection script [Re: AcidzDesigns] #250092 02/01/15 11:26 PM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
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


Re: Cap protection script [Re: Sakana] #250093 02/01/15 11:27 PM
Joined: Nov 2014
Posts: 13
A
AcidzDesigns Offline OP
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

Re: Cap protection script [Re: AcidzDesigns] #250094 02/01/15 11:53 PM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
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.





Re: Cap protection script [Re: Sakana] #250161 04/01/15 04:07 PM
Joined: Nov 2014
Posts: 13
A
AcidzDesigns Offline OP
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

Re: Cap protection script [Re: AcidzDesigns] #250163 04/01/15 07:43 PM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
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
  }
}

Re: Cap protection script [Re: Sakana] #250165 04/01/15 08:06 PM
Joined: Nov 2014
Posts: 13
A
AcidzDesigns Offline OP
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

Re: Cap protection script [Re: AcidzDesigns] #250171 04/01/15 09:04 PM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
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
  }
}

Re: Cap protection script [Re: Sakana] #250191 05/01/15 03:55 AM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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 }

Re: Cap protection script [Re: westor] #250412 13/01/15 03:14 PM
Joined: Nov 2014
Posts: 13
A
AcidzDesigns Offline OP
Pikka bird
OP Offline
Pikka bird
A
Joined: Nov 2014
Posts: 13
Thanks man