mIRC Home    About    Download    Register    News    Help

Print Thread
#213558 30/06/09 09:58 PM
Joined: Apr 2007
Posts: 21
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Apr 2007
Posts: 21
hey;
i use the following code to kick+ban someone for 3 repetitions. but it also kick/bans channel ops and voices, what if i dont want them to be kicked. please make changes, and paste the new one here. thanks
code ==>
on @*:text:*:#: {
if ( %rept == $null ) { set %rept 60 }
if ( %rep_ban == $null ) { set %repb 120 }
if ( %rep_antal == $null ) { set %repa 3 }
if ($nick == null) { return }
var %rp.repeats = rp. $+ $nick $+ . $+ $chan
var %rp.text = rp. $+ $nick $+ . $+ $chan $+ .text
if ( % [ $+ [ %rp.repeats ] ] == $null ) {
set -u [ $+ [ %rept ] ] % [ $+ [ %rp.repeats ] ] 1
set -u [ $+ [ %rept ] ] % [ $+ [ %rp.text ] ] $1-
}
elseif ( % [ $+ [ %rp.text ] ] == $1- ) {
inc % [ $+ [ %rp.repeats ] ]
}
elseif ( % [ $+ [ %rp.text ] ] != $1- ) {
set -u [ $+ [ %rept ] ] % [ $+ [ %rp.text ] ] $1-
set -u [ $+ [ %rept ] ] % [ $+ [ %rp.repeats ] ] 1
}
if ( % [ $+ [ %rp.repeats ] ] >= %repa ) {
ban -u $+ %repb # $nick 3
kick # $nick % [ $+ [ %rp.repeats ] ] repeats,no repeating, i repeat "No repeating" Banned for $calc(%repb / 60) $+ minute(s)
unset %rp. $+ $nick $+ . $+ $chan
unset %rp. $+ $nick $+ . $+ $chan $+ . $+ text
}
}


WornBean
khurram_ch #213560 30/06/09 10:21 PM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try this :

Code:
on @*:text:*:#: {
  if ($nick isop $chan) || ($nick isvoice $chan) { halt }
  if (%rept == $null) { set %rept 60 }
  if (%rep_ban == $null) { set %repb 120 }
  if (%rep_antal == $null) { set %repa 3 }
  if ($nick == null) { return }
  var %rp.repeats = rp. $+ $nick $+ . $+ $chan
  var %rp.text = rp. $+ $nick $+ . $+ $chan $+ .text
  if (% [ $+ [ %rp.repeats ] ] == $null) {
    set -u [ $+ [ %rept ] ] % [ $+ [ %rp.repeats ] ] 1
    set -u [ $+ [ %rept ] ] % [ $+ [ %rp.text ] ] $1-
  }
  elseif (% [ $+ [ %rp.text ] ] == $1-) {
    inc % [ $+ [ %rp.repeats ] ]
  }
  elseif (% [ $+ [ %rp.text ] ] != $1-) {
    set -u [ $+ [ %rept ] ] % [ $+ [ %rp.text ] ] $1-
    set -u [ $+ [ %rept ] ] % [ $+ [ %rp.repeats ] ] 1
  }
  if (% [ $+ [ %rp.repeats ] ] >= %repa) {
    ban -u $+ %repb # $nick 3
    kick # $nick % [ $+ [ %rp.repeats ] ] repeats,no repeating, i repeat "No repeating" Banned for $calc(%repb / 60) $+ minute(s)
    unset %rp. $+ $nick $+ . $+ $chan
    unset %rp. $+ $nick $+ . $+ $chan $+ . $+ text
  }
}


NOTE: I added the if ($nick isop $chan) { halt } and the if ($nick isvoice $chan) { halt }

Last edited by westor; 30/06/09 10:22 PM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #213562 30/06/09 10:53 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Westor, you missed a $ in
Quote:
if ($nick == $null)
And why use halt when you can negate them?
Code:
if ($nick !isop $chan) || ($nick !isvoice $chan) {
Or
Code:
 if (!$nick($chan,$nick,oh)) {

westor #213574 01/07/09 03:18 AM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Just a thought, but if a user isn't voiced then they can't send a message so this text event wouldn't see them anyway.

If the room is unmoderated and the user is not voiced you would still want the proytection on.

DJ_Sol #213579 01/07/09 10:25 AM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Tomao, I did not change anything else as you saw in the NOTE that i wrote i had just add to halt if user is oper,voice on the channel! the other mistakes is from the author but yes is a mistake!

so the code must be like this, correct it!:

Code:
on @*:text:*:#: {
  if ($nick isop $chan) || ($nick isvoice $chan) { halt }
  if (%rept == $null) { set %rept 60 }
  if (%rep_ban == $null) { set %repb 120 }
  if (%rep_antal == $null) { set %repa 3 }
  if ($nick == $null) { return }
  var %rp.repeats = rp. $+ $nick $+ . $+ $chan
  var %rp.text = rp. $+ $nick $+ . $+ $chan $+ .text
  if (% [ $+ [ %rp.repeats ] ] == $null) {
    set -u [ $+ [ %rept ] ] % [ $+ [ %rp.repeats ] ] 1
    set -u [ $+ [ %rept ] ] % [ $+ [ %rp.text ] ] $1-
  }
  elseif (% [ $+ [ %rp.text ] ] == $1-) {
    inc % [ $+ [ %rp.repeats ] ]
  }
  elseif (% [ $+ [ %rp.text ] ] != $1-) {
    set -u [ $+ [ %rept ] ] % [ $+ [ %rp.text ] ] $1-
    set -u [ $+ [ %rept ] ] % [ $+ [ %rp.repeats ] ] 1
  }
  if (% [ $+ [ %rp.repeats ] ] >= %repa) {
    ban -u $+ %repb # $nick 3
    kick # $nick % [ $+ [ %rp.repeats ] ] repeats,no repeating, i repeat "No repeating" Banned for $calc(%repb / 60) $+ minute(s)
    unset %rp. $+ $nick $+ . $+ $chan
    unset %rp. $+ $nick $+ . $+ $chan $+ . $+ text
  }
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #213632 04/07/09 08:53 AM
Joined: Apr 2007
Posts: 21
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Apr 2007
Posts: 21
thank you dear, its helping. God bless you.


WornBean
Tomao #213675 05/07/09 06:26 AM
Joined: Jul 2008
Posts: 236
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
There's a point where for many people, excessive leading whitespace (eg. tabbing) becomes a problem. It's better to have less tabbing for very similar code, if possible.


Link Copied to Clipboard