mIRC Home    About    Download    Register    News    Help

Print Thread
#269598 14/11/21 03:25 AM
Joined: Jul 2020
Posts: 14
D
druino Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Jul 2020
Posts: 14
works for me in mircv7.67...
i have this addons works great to add blacklisted nicks
try adding the variant that can be added ips for example:
*!*@190.55* or also *!*@180.256.39* remove the variant but it only works when I add the identd plus ip for example:
*!*cucuxo@190.55.36* only this is how it works for me, please, someone who helps me so that this addosn recognizes all variants for
add ips to the blacklist like for example: *!*@190.55* or also *!*@180.256.39*

Code
; ####################################
; #         Mr.KOlanG  ScRiPt        #
; #                                  #
; #            BlackList             #
; #                                  #
; ####################################

MenU Channel,status {
  BlaCk List:/dialog -m bl bl
}

;;;; Coding del dialog
dialog bl {
  title "Black List By Mr.KolanG"
  size -1 -1 110 100
  option dbu
  tab "List" 1, 5 5 100 90
  tab "Setup" 2,
  button "Add" 3, 7 85 25 10, tab 1
  button "Remove" 4, 35 85 25 10, tab 1
  list 5, 7 20 95 66, tab 1
  button "Close" 6, 75 85 25 10,
  check "KickBan" 7, 10 80 27 10, tab 2
  box "Setup" 8, 7 57 50 35, tab 2
  check "Kick" 9, 10 66 27 10, tab 2
  box "Reason" 10, 7 23 94 25, tab 2
  edit "" 11, 9 33 90 10, tab 2
}

;;; Coding Alias
alias bl { /dialog -m bl bl }

;;;; Coding eventi dialog
on 1:dialog:bl:init:0:{
  tokenize 32 %blacklist
  /did -a bl 5 $*
  /did -ra bl 11 %blkreason
  if (%blp == 1) { /did -c bl 7 | /did -u bl 9 }
  else { /did -c bl 9 | /did -u bl 7 }
}

on 1:dialog:bl:sclick:6: { /dialog -x bl bl }

on 1:dialog:bl:sclick:3: {
  /set -u5 %badd $input(Nick da addare alla blacklist:,-eq,Blacklist Management")
  if (!%badd) { $input(Nessun nick inserito!,-ow,Errore!) }
  else {
    if ( $istok(%blacklist,%badd,32) ) { var %errore = $input(Nick giĆ  blacklistato!,-ow,Errore!) | halt }
    else { %blacklist = $addtok(%blacklist,%badd,32) | did -a bl 5 %badd }
  }
}
on 1:dialog:bl:sclick:4:{
  if ( $did(5).seltext) { /set -u5 %brem $did(5).seltext | %blacklist = $remtok(%blacklist,%brem,1,32) | did -d bl 5 $did(5).sel }
  else { var %errore = $input(Non hai selezionato alcun nick!,-ow,Errore!) }
}

on 1:dialog:bl:edit:11:{
  if ( $did(11).text) { /set %blkreason $did(11).text } | else { /set %blkreason 9,1KolanG Script }
}

on 1:dialog:bl:sclick:7:{ /did -c bl 7 | /did -u bl 9 | /set %blp 1 }
on 1:dialog:bl:sclick:9:{ /did -c bl 9 | /did -u bl 7 | /set %blp 0 }


;;;; Coding Load
on *:join:#:{
  var %x = 32
  if ($istok(%blacklist,$address,%x)) {
    if ( %blp == 0 ) { /kick $chan $nick %blkreason }
    else { /mode # +b $nick | /kick # $nick %blkreason }
  }
  else { return }
}

on *:join:#:{
  if ($istok(%blacklist,$nick,32)) {
    if ( %blp == 0 ) { /kick $chan $nick %blkreason }
    else { /mode # +b $nick | /kick # $nick %blkreason }
  }
  else { return }
}

On *:nick:{
  if ($istok(%blacklist,$newnick,32)) {
    set %ii $comchan($newnick,0)
    if ( %blp == 0 ) { /kick $comchan($newnick,%ii) $newnick %blkreason }
    else { /ban -u300 $comchan($newnick,%ii) $newnick 1 | /kick $comchan($newnick,%ii) $newnick %blkreason }
  }
  else { return }
}

on *:load:{
  /echo -a 4K10o4l10a4n10G 4S10c4r10i4p10t 12v1.0 13,1Blacklist Loaded....
  /set %blkreason KolanG ScRiPt Blacklist
  /set %blp 0
}


I added these variants but they don't work for me as I mentioned at the beginning..
I would like you to recognize variants NICK! * @ * NICK1! * @ * NICK2! * @ * rene! * @ * pol! * @ * or nicknames with wildcards for variants of nick Pol*! * @ *
Code
on *:join:#:{
  tokenize 32 %blacklist
  var %x 1
  while %x <= $numtok(%blacklist,32) {
    if ($wildtok($fulladdress,$gettok(%blacklist,%x,32),0,32)) {
      if (%blp == 0) { kick $chan $nick %blkreason }
      else { mode # +b $nick | kick # $nick %blkreason }
    }
    inc %x
  }
}

on *:nick:{
  tokenize 32 %blacklist
  var %x 1
  while %x <= $numtok(%blacklist,32) {
    if ($wildtok($fulladdress,$gettok(%blacklist,%x,32),0,32)) {
      set %ii $comchan($newnick,0)
      if (%blp == 0) { kick $comchan($newnick,%ii) $newnick %blkreason }
      else { ban -u300 $comchan($newnick,%ii) $newnick 1 | kick $comchan($newnick,%ii) $newnick %blkreason }
    }
    inc %x
  }
}

but when I use those new variants it doesn't work for me as I would like, can someone please help me.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
You were not clear what you mean by "didn't work". There can be many reasons that something does not perform the goal you wish, but it's still working at doing something, even if it's the wrong thing.

You should include some debugging messages so you can see in the status window if something is reaching certain locations. At minimum these messages should include $scriptline $nopath($script) so you can find them later and kill them based on the message being displayed.

One thing the debugging message tells you is whether the event-handler is even being triggered, which could be caused by having remote events disabled, which you can check by: /remote

Another thing it tells is whether something is branching the correct direction after a while() or if() condition. If you put one of these debugging echoes above and below the while(), then that can be a problem depending on whether it should/shoutdn't be seeing the 2nd echo. Once you see where the branching mistake is happening, then you can edit your echo to include extra info to see why the mistake is happening.

echo -s $scriptline $nopath($script) : $ $+ istok( %blacklist , $nick , $32 ) )
if ($istok(%blacklist,$nick,32)) { do this }
echo -s $scriptline $nopath($script)

When you echo variables you must make sure they don't touch parenthesis, commas, etc - because the rules in an echo are different than when they're parameters inside an identifier.

I also edited one of your events to make it a little more efficient. You don't care about the $numtok, you only care about each token in the list, so this avoids calculating $numtok. You can do this since the token will not be $null until you run out of tokens. Also, you don't care about how MANY wildtok matches there are, you just care if there are ANY matches, so you simply check if there is a 1st match, not counting how many matches are are. The $v1 is destroyed as soon as it encounters another if() or while(), so if you need it later on you can do something like "/var %v1 $v1"

One thing I didn't change is how you're handling $comchan. The way you are handling this, it only kicks them out of the last common channel in your switchbar/treebar, which isn't necessarily the same as the last channel they joined, or the channel you really want to kick them out of, If you want to kick them out of each channel, then you'd need to have a while() loop to do that. Your using of %ii only needs a local variable that vanishes when leaving the alias/event, so there's no need to create a permanent global variable

You may want to look at /help Event Prefixes
The @ event prefix can avoid this script triggering the ON JOIN if someone joins a #channel where you don't have the Ops powers to do any of this

Code
on *:nick:{
  tokenize 32 %blacklist
  var %x 1
  while ($gettok(%blacklist,%x,32) != $null) {
    if ($wildtok($fulladdress, $v1 ,1,32) != $null) {
      var %ii $comchan($newnick,0)
      if (%blp == 0) { kick $comchan($newnick,%ii) $newnick %blkreason }
      else { ban -u300 $comchan($newnick,%ii) $newnick 1 | kick $comchan($newnick,%ii) $newnick %blkreason }
    }
    inc %x
  }
}


Some of what you're doing can be handled in "user lists" It would've been easier to understand user lists if a list of the identifiers and commands that the users tab of scripts editor interacts with were found in 1 page, instead of being split across the help pages at

/help Remote Commands
/help Remote Identifiers
/help Remote Levels

Joined: Jul 2020
Posts: 14
D
druino Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Jul 2020
Posts: 14
it didn't work for me

Joined: Jul 2020
Posts: 14
D
druino Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Jul 2020
Posts: 14
i tried the variant and it doesn't work as i want

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
You waited 7 months to reply, so I assumed everything was ok.
But first you replied saying it doesn't work, and then a month later your post reads as if it does work but not the way you want.
You'll need to be a bit more descriptive if you need help. I don't know what your code looks like 9 months later, and what's happening that's different than you want to happen


Link Copied to Clipboard