mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
Greetingz gentz,

someone helped me with this rawmode code to display who got effected by various bans and extended bans as well as ipv6 banmasks i forgot who it was but thanks a lot for that as it works excellent except for it freezing client whenever multiple bans are set in a line like :

Quote


13:19:00 Falcon Sets Mode on #channel to: -bbbbbbbbbbbbbbb G:SV u:G:CO u:G:SG u:G:FI u:G:SE u:G:ES u:G:RU u:G:PR u:G:GR u:G:MU u:G:AZ u:G:BG u:G:RO u:G:AR u:G:LK

13:19:01 AutoBot Sets Mode on #channel to: +bbbbbbbbbbbbbbb G:SV u:G:CO u:G:SG u:G:FI u:G:SE u:G:ES u:G:RU u:G:PR u:G:GR u:G:MU u:G:AZ u:G:BG u:G:RO u:G:AR u:G:LK

13:19:03 Falcon Sets Mode on #channel to: -bbbbbbbbbbbbb u:G:CN u:G:IE u:G:SI u:G:BS u:G:FR u:G:NZ u:G:BR u:G:BB u:G:TR u:G:BT u:G:TH u:G:CZ u:G:ID

13:19:04 AutoBot Sets Mode on #channel to: +bbbbbbbbbbbbb u:G:CN u:G:IE u:G:SI u:G:BS u:G:FR u:G:NZ u:G:BR u:G:BB u:G:TR u:G:BT u:G:TH u:G:CZ u:G:ID




here is the code i use :

Code

ON ^*:RAWMODE:#:{
  echo -t $chan  12,08 $nick 1,15 Sets Mode on  5,15 $chan 1,15 to: 12,15  $strip($1-,bcru)  
  var %b = $countcs($1,b,e,I,q),%y = 1
  if (%b) {
    while (%y <= %b) {
      var %x = 1
      while (%x <= $nick($chan,0)) {
        var %banmask = $wildtok($2-,*!*@*,%y,32) 
        if (~quiet:?* iswm %banmask) var %banmask $mid(%banmask,8)   
        if (~?:?* iswm %banmask) var %banmask $mid(%banmask,4) 
        if (?:?* iswm %banmask) var %banmask $mid(%banmask,3)
        if (%banmask iswm $address($nick($chan,%x),5)) var %bl = %bl $nick($chan,%x)
        inc %x
      }
      inc %y
    }
    if (%bl) { var %i $query(0) | while (%i) { if ($istok(%bl,$query(%i),32)) echo -t $query(%i)  01,00 *** ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,Is,Are) effected 12 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t) 14  05 $1-   | dec %i } | haltdef } 
    if (%bl) {
      if ($me isin %bl && +q isin $1 ) {  mode # set $replace($1-,+,-) }
      if ( +b isin $gettok($1-,1,32))  echo $chan $timestamp 08,14 ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,is,Are) Banned  04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t)   
      if ( -b isin $gettok($1-,1,32))  echo $chan $timestamp 08,14 ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,is,Are) UNBanned  04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t)     
      if ( +I isin $gettok($1-,1,32))  echo $chan $timestamp 08,14 ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,is,Are) Invited  04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t)   
      if ( -I isin $gettok($1-,1,32))  echo $chan $timestamp 08,14 ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,is,Are) UNInvited  04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t)     
      if ( +e isin $gettok($1-,1,32))  echo $chan $timestamp 08,14 ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,is,Are) excempted  04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t)   
      if ( -e isin $gettok($1-,1,32))  echo $chan $timestamp 08,14 ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,is,Are) UNexcempted  04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t)     
      if ( +q isin $gettok($1-,1,32))  echo $chan $timestamp 08,14 ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,is,Are) MuteBanned 04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t)   
      if ( -q isin $gettok($1-,1,32))  echo $chan $timestamp 08,14 ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,is,Are) UN-MuteBanned  04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t)     
      haltdef
    }
  }
  haltdef
}


Last edited by Simo; 13/09/22 11:52 AM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
I don't know how much some of these inefficiencies affect time, but...

while (%x <= $nick($chan,0))

... This is inside a nested while loop, so this is calling $nick() repeatedly to find out how many people are in the channel, but it would be more efficient to create a variable above your nested loop, then compare against that variable, since the nick-count isn't going to change while the alias is running. It's probably not as bad as doing like...

while (%line.number <= $lines(filename))

--

if (%banmask iswm $address($nick($chan,%x),5)) var %bl = %bl $nick($chan,%x)

While this is more efficient than using $addtok, this is assuming that there aren't 2 different masks affecting the same nick, and looks like this can result in the same nick appearing multiple times if they match several masks.

--

$gettok($1-,1,32)

... is inefficient. Just use $1

--

It's been a while since I benchmarked it, but $iif is slower than the alternative. But even if not, there's no need to have code which could encounter one of these $iif's multiple times. Just have at the beginning:

var %user User , %is Is | if ($chr(32) isin %bl) var %user Users, %is Are

... and then you can replace

$iif($numtok(%bl,32) < 2,User,Users)

... with %user and ditto for the $iif deciding whether to use Is or Are.

Your code echoing the affected nicks has the potential for executing that $regsubex multiple times if you have bans affecting several query windows.

so instead of repeatedly doing

echo -t $query(%i) regsubex

... instead do

var %affected regsubex

.... and then echo %affected instead of calculating the same string repeatedly.

--

if ($me isin %bl && +q isin $1 ) { mode # set $replace($1-,+,-) }

Please get out of the habit of using as few parenthesis as legally possible. It's going to eventually bite you, such as how skipping the parenthesis can sometimes affect the values filled into $v1 and $v2. Plus, the lack of parenthesis makes your code harder to read. No clue what this 'set' is supposed to do...

--

if ( +I isin $gettok($1-,1,32)) echo $chan $timestamp 08,14 ( $+ $numtok(%bl,32) $iif($numtok(%bl,32) < 2,User,Users) $+ ) $iif($numtok(%bl,32) < 2,is,Are) Invited 04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t) 

Since you originally used $countcs to see if I is within $1, shouldn't it be using isincs here?

So you have 8 if() for these different + and - modes, so if the mode list has each of these used 1 time, and each affecting 1 different nick, then your %bl will contain 8 nicks. But your script will echo 8 lines, each of which is informing the user that there were 8 nicks invited, 8 nicks uninvited etc.

--

Your code always falls through to the bottom and executes that final /haltdef, so there's no need to have 3 of them.

--
you have 2 consecutive "if (%bl) { stuff }" that can all be combined into a single if()...

--

It would help if you had some debug info to report what kind of freezes are encountered/or-not for different conditions. I suspect that the slowness comes from looping through a huge nicklist for each mask in your mode list. It would be more efficient to instead use $ialchan to identify who (if any) of the nicks matches each wildmask. Of course that requires a /who #channel having been done...

If not, it would help to get some debug info to identify which line has most of the freeze in it.

Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
thanks maroon for your reply apreciated, altho im not sure how to get you the info you asked for, where to add what kind of debug

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
var %start.time $ticksqpc
do stuff
echo -s debug line $scriptline ticks: $calc($ticksqpc - %start.time)

Note that echoing to screen can affect how long something takes, so don't do it inside the loop. You can also save them all up to show them at the same time:

var %start.time $ticksqpc , %msg $null
do stuff
var %msg %msg line $scriptline ticks: $calc($ticksqpc - %start.time)
do stuff
var %msg %msg line $scriptline ticks: $calc($ticksqpc - %start.time)
echo -s debug %msg

Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
Thanks maroon i dont know where to add those lines and loops always give me issues of freezing client and ill have to close and restart

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
You'd put the
var %start.time $ticksqpc
right after the ON RAWMODE, and you'd sprinkle the echoes to the status window at various lines, where hopefully you'd narrow down where the long interval is located. But by 'freeze' you mean the client completely locks up so that ctrl+break doesn't work? I don't see anything here that should do that. But first, your code doesn't do what you want it to do, so it's back to the drawing board, and hopefully you remember who it was.

When you're trying to get code to work, you should have echoes to status window showing what values are being filled into variables, etc, and your while() can be spread across several rows. Then when you get the code working, you can take out the -s switches from var statements, the echoes, and can consolidate the code to fewer lines.

But again, you didn't address the fact that your code reports as if all affected nicks are affected by all of the modes being present.

But in addition to those false positives, it's going to have false negatives in some situations. For example, here's one that won't get reported because it doesn't contain the +I or +e strings you're looking for:

/mode #channelname +vIe nick1 mask1 mask2

You can verify from channel central that the exempt list (not excempted) and invite list are both affected, but there's no +I or +e present. Your script is going to need to do like some of these pushmode scripts do, which is to walk through each character of $1 to identify whether + or - is in effect when it reaches each letter, and there's a corresponding pointer through $2- to identify which 'word' matches each switch letter. Also note that + is implied, so the next command is the same as if +Ie were used.

/mode #channelname Ie mask1 mask2

Also, you can have masks affecting a nick without it matching your search for a token that wild-matches *!*@*, as the following are both equivalents, and your code doesn't see the 2nd one containing +e, and doesn't see it containing any wildmasks:

/mode #channelname e nick1
/mode #channelname +e nick1!*@*

Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
It freezes for like 5 or 10 seconds

Last edited by Simo; 14/09/22 09:11 AM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
All the code below does is change some of the inefficiencies I mentioned above plus insert some strategic echoes to status window. If it no longer freezes 5-10 sec, then it's because of the inefficiencies like calculating $nick(channel,0) 1000 times if there's 1000 nicks, or using the $regsubex parameters multiple times for the same inputs. It doesn't fix the issues where you're assuming that these 6 on/off modes are going to be paired with a parameter that looks like one of these wildcard-banmasks, which I showed isn't necessarily true. And that your code shows as if all nicks in %bl are affected by all 6 modes.
But, if it's still freezing, you should see from status window where the ticks count has a milliseconds gap that shouldn't be there. Note the ticks times are all a 'count up' of the total time from the beginning, and not showing the interval since the last echo

Code
ON ^*:RAWMODE:#:{
  echo -t $chan  12,08 $nick 1,15 Sets Mode on  5,15 $chan 1,15 to: 12,15  $strip($1-,bcru)  
  var %b = $countcs($1,b,e,I,q),%y = 1 , %start.time $ticksqpc
  if (%b) {
    while (%y <= %b) {
      var %x = 1 , %nick.count $nick($chan,0)
      while (%x <= %nick.count) {
        var %banmask = $wildtok($2-,*!*@*,%y,32) 
        if (~quiet:?* iswm %banmask) var %banmask $mid(%banmask,8)   
        elseif (~?:?* iswm %banmask) var %banmask $mid(%banmask,4) 
        elseif (?:?* iswm %banmask) var %banmask $mid(%banmask,3)
        if (%banmask iswm $address($nick($chan,%x),5)) var %bl = %bl $nick($chan,%x)
        inc %x
      }
echo -s line $scriptline ticks $calc($ticksqpc - %start.time) y %y < b %b nicks %nick.count
      inc %y
    }
    if (%bl) {

var %bl.count $numtok(%bl,32) , %user User , %is Is
if (%bl.count > 1) var %user Users, %is Are

var %regsubex $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t )
var %i 1 | while ($query(%i)) {
var %query $v1 | if ($istok(%bl,%query,32)) echo -t %query 01,00 *** ( $+ %bl.count %user $+ ) %Is effected 12 %regsubex 14  05 $1-  
inc %i }
echo -s line $scriptline ticks $calc($ticksqpc - %start.time) query+1 %i bl.count %bl.count
      if (($me isin %bl) && (+q isin $1)) { mode # set $replace($1-,+,-) }
      if ( +b isin $1)  echo $chan $timestamp 08,14 ( $+ %bl.count %user $+ ) %is Banned  04,00 %regsubex   
      if ( -b isin $1)  echo $chan $timestamp 08,14 ( $+ %bl.count %user $+ ) %is UNBanned  04,00 %regsubex     
      if ( +I isin $1)  echo $chan $timestamp 08,14 ( $+ %bl.count %user $+ ) %is Invited  04,00 %regsubex   
      if ( -I isin $1)  echo $chan $timestamp 08,14 ( $+ %bl.count %user $+ ) %is UNInvited  04,00 %regsubex     
      if ( +e isin $1)  echo $chan $timestamp 08,14 ( $+ %bl.count %user $+ ) %is exempted  04,00 %regsubex   
      if ( -e isin $1)  echo $chan $timestamp 08,14 ( $+ %bl.count %user $+ ) %is UNexempted  04,00 %regsubex     
      if ( +q isin $1)  echo $chan $timestamp 08,14 ( $+ %bl.count %user $+ ) %is MuteBanned 04,00 %regsubex   
      if ( -q isin $1)  echo $chan $timestamp 08,14 ( $+ %bl.count %user $+ ) %is UN-MuteBanned  04,00 %regsubex     
    }
  }
  haltdef
echo -s line $scriptline ticks $calc($ticksqpc - %start.time) finish
}



edit: edited the last elseif out. I got carried away with changing the if's to elseif's
edited again for missing parenthesis in %regsubex

Last edited by maroon; 14/09/22 03:55 PM.
Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
thanks maroon, ive added it and got this as output:


Quote

line 3655 ticks 0 y 1 < b 15 nicks 195
line 3655 ticks 0 y 2 < b 15 nicks 195
line 3655 ticks 0 y 3 < b 15 nicks 195
line 3655 ticks 0 y 4 < b 15 nicks 195
line 3655 ticks 0 y 5 < b 15 nicks 195
line 3655 ticks 0 y 6 < b 15 nicks 195
line 3655 ticks 0 y 7 < b 15 nicks 195
line 3655 ticks 0 y 8 < b 15 nicks 195
line 3655 ticks 0 y 9 < b 15 nicks 195
line 3655 ticks 0 y 10 < b 15 nicks 195
line 3655 ticks 0 y 11 < b 15 nicks 195
line 3655 ticks 0 y 12 < b 15 nicks 195
line 3655 ticks 0 y 13 < b 15 nicks 195
line 3655 ticks 0 y 14 < b 15 nicks 195
line 3655 ticks 0 y 15 < b 15 nicks 195
line 3680 ticks 0 finish
line 3655 ticks 0 y 1 < b 7 nicks 195
line 3655 ticks 0 y 2 < b 7 nicks 195
line 3655 ticks 0 y 3 < b 7 nicks 195
line 3655 ticks 0 y 4 < b 7 nicks 195
line 3655 ticks 0 y 5 < b 7 nicks 195
line 3655 ticks 0 y 6 < b 7 nicks 195
line 3655 ticks 0 y 7 < b 7 nicks 195
line 3680 ticks 0 finish
line 3655 ticks 0 y 1 < b 15 nicks 195
line 3655 ticks 0 y 2 < b 15 nicks 195
line 3655 ticks 0 y 3 < b 15 nicks 195
line 3655 ticks 0 y 4 < b 15 nicks 195
line 3655 ticks 0 y 5 < b 15 nicks 195
line 3655 ticks 0 y 6 < b 15 nicks 195
line 3655 ticks 0 y 7 < b 15 nicks 195
line 3655 ticks 0 y 8 < b 15 nicks 195
line 3655 ticks 0 y 9 < b 15 nicks 195
line 3655 ticks 0 y 10 < b 15 nicks 195
line 3655 ticks 0 y 11 < b 15 nicks 195
line 3655 ticks 0 y 12 < b 15 nicks 195
line 3655 ticks 0 y 13 < b 15 nicks 195
line 3655 ticks 0 y 14 < b 15 nicks 195
line 3655 ticks 0 y 15 < b 15 nicks 195
line 3680 ticks 0 finish
line 3655 ticks 0 y 1 < b 15 nicks 195
line 3655 ticks 0 y 2 < b 15 nicks 195
line 3655 ticks 0 y 3 < b 15 nicks 195
line 3655 ticks 0 y 4 < b 15 nicks 195
line 3655 ticks 0 y 5 < b 15 nicks 195
line 3655 ticks 0 y 6 < b 15 nicks 195
line 3655 ticks 0 y 7 < b 15 nicks 195
line 3655 ticks 0 y 8 < b 15 nicks 195
line 3655 ticks 0 y 9 < b 15 nicks 195
line 3655 ticks 0 y 10 < b 15 nicks 195
line 3655 ticks 0 y 11 < b 15 nicks 195
line 3655 ticks 0 y 12 < b 15 nicks 195
line 3655 ticks 0 y 13 < b 15 nicks 195
line 3655 ticks 0 y 14 < b 15 nicks 195
line 3655 ticks 0 y 15 < b 15 nicks 195
line 3680 ticks 0 finish
line 3655 ticks 0 y 1 < b 6 nicks 195
line 3655 ticks 0 y 2 < b 6 nicks 195
line 3655 ticks 0 y 3 < b 6 nicks 195
line 3655 ticks 0 y 4 < b 6 nicks 195
line 3655 ticks 0 y 5 < b 6 nicks 195
line 3655 ticks 0 y 6 < b 6 nicks 195
line 3680 ticks 0 finish
line 3655 ticks 0 y 1 < b 6 nicks 195
line 3655 ticks 0 y 2 < b 6 nicks 195
line 3655 ticks 0 y 3 < b 6 nicks 195
line 3655 ticks 0 y 4 < b 6 nicks 195
line 3655 ticks 0 y 5 < b 6 nicks 195
line 3655 ticks 0 y 6 < b 6 nicks 195
line 3680 ticks 0 finish



wich seems to be this line

Quote

echo -s line $scriptline ticks $calc($ticksqpc - %start.time) y %y < b %b nicks %nick.count

Last edited by Simo; 14/09/22 02:56 PM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
sorry, try again with the edited code, it wasn't putting anything into %bl yet

also, I edited the code a 2nd time because there was a missing parenthesis in the %regsubex definition.

The fact that you didn't get an error message in status window indicates that you don't have 'identifier warning' enabled in options menu of scripts editor. When that's not checked, $no_such_identifier will return $null instead of giving you an error message telling you to fix your code

Last edited by maroon; 14/09/22 03:24 PM.
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
For the same reasons as seen in this thread https://forums.mirc.com/ubbthreads.php/topics/270488/ you need to properly parse the mode and their parameters, currently your code has a lot of logical issue because of that, if it works most of the time (ignoring the speed issue), it will break for a lot of rawmode being set.
Here is an untested attempt:

Code
ON *:RAWMODE:#:{
  var %takepara $remove($gettok($chanmodes,1-3,44),$chr(44)),%i 1,%j 2,%set +
  while ($mid($1,%i,1)) {
    var %t $v1
    if (%t == +) %set = +
    elseif (%t == -) %set = -
    elseif (%t isincs $nickmode) inc %j
    elseif (%t isincs %takepara) {
      if (%t isincs beIq) {
        var %banmask $eval($chr(36) $+ %j,2)
        if (~quiet:?* iswm %banmask) %banmask = $mid(%banmask,8)   
        elseif (~?:?* iswm %banmask) %banmask = $mid(%banmask,4)
        elseif (?:?* iswm %banmask) %banmask = $mid(%banmask,3)
        if ($ialchan(%banmask,$chan,0)) {
          var %n $v1,%m %n,%user user,%is is,%word $replacexcs(%set $+ %t,+b,Banned,-b,UNBanned,+I,Invited,-I,UNInvited,+e,Exempted,-e,UNExempted,+q,MuteBanned,-q,UN-MuteBanned)
          if (%m > 1) {
            %user = users
            %is = are
          }
          while (%n) var %bl %bl $ialchan(%banmask,$chan,%n).nick,%n %n - 1
          var %r $regsubex(%bl,/(\S+)/g,(\n) \t)
          var %k 1
          while ($gettok(%bl,%k,32)) {
            if ($query($v1)) echo -t $v1 *** ( $+ %m %user $+ ) %is %word : %r
            inc %k
          }
          echo -t $chan *** ( $+ %m %user $+ ) %is %word : %r
          unset %bl
        }
      }
      inc %j
    }
    inc %i
  }
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
Thank You wims ive tested it and it seems to work as expected excellent very much apreciated

Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
the code works as expected thanks for that Wims exept for it not stacking the affected nicks for example:
instead of doing
Quote

13:48:48 @Hawk Sets Mode on #test to: +bbbbbb *!*id3757@* *!*@73.173.182.68 *!*@All4masti-48a5vs.DriftHosters.Com *!*@allformasti-g9l.b04.931.242.IP *!*@allformasti-654.e24.013.317.IP *!*@6o9u:x15y:8:zodv::27qa:7w22

13:48:48 (6 users) are Banned (1) Aturisme (2) Estrada (3) wilcat (4) Mikey (5) Riba (6) Talanta


it does

Quote

13:48:48 @Hawk Sets Mode on #test to: +bbbbbb *!*id3757@* *!*@73.173.182.68 *!*@All4masti-48a5vs.DriftHosters.Com *!*@allformasti-g9l.b04.931.242.IP *!*@allformasti-654.e24.013.317.IP *!*@6o9u:x15y:8:zodv::27qa:7w22

13:48:48 (1 user) is Banned (1) Aturisme
13:48:48 (1 user) is Banned (1) Estrada
13:48:48 (1 user) is Banned (1) wildcat
13:48:48 (1 user) is Banned (1) Mikey
13:48:48 (1 user) is Banned (1) Riba
13:48:48 (1 user) is Banned (1) Talanta

Last edited by Simo; 15/09/22 04:26 PM.
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Yeah, my mistake, here is an update

Code
ON *:RAWMODE:#:{
  var %takepara $remove($gettok($chanmodes,1-3,44),$chr(44)),%i 1,%j 2,%set +
  while ($mid($1,%i,1)) {
    var %t $v1
    if (%t == +) %set = +
    elseif (%t == -) %set = -
    elseif (%t isincs $nickmode) inc %j
    elseif (%t isincs %takepara) {
      if (%t isincs beIq) {
        var %banmask $eval($chr(36) $+ %j,2)
        if (~quiet:?* iswm %banmask) %banmask = $mid(%banmask,8)   
        elseif (~?:?* iswm %banmask) %banmask = $mid(%banmask,4)
        elseif (?:?* iswm %banmask) %banmask = $mid(%banmask,3)
        var %n $ialchan(%banmask,$chan,0)
        while (%n) var %bl $+ %set $+ %t $($+(%,bl,%set,%t) $ialchan(%banmask,$chan,%n).nick,%n %n - 1
      }
      inc %j
    }
    inc %i
  }
  var %n $var(bl*,0)
  while (%n) {
    var %v $var(bl*,%n),%p $(%v,2),%mode $right(%v,2),%m $numtok(%p,32),%k 1,%r $regsubex(%p,/(\S+)/g,(\n) \1),%user user,%is is,%word $replacexcs(%mode,+b,Banned,-b,UNBanned,+I,Invited,-I,UNInvited,+e,Exempted,-e,UNExempted,+q,MuteBanned,-q,UN-MuteBanned)
    if (%m > 1) {
       %user = users
       %is = are
    }
    while ($gettok(%p,%k,32)) {
      if ($query($v1)) echo -t $v1 *** ( $+ %m %user $+ ) %is %word : %r
      inc %k
    }
    echo -t $chan *** ( $+ %m %user $+ ) %is %word : %r
    dec %n
  }
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
it only seems to stack the affected nicks if its from the same host/ip

Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
thanks Wims ive loaded it and tested it and seem to outputs odd results :


Quote

* Invalid format: $ (line 3657, script1.mrc)



this line

Quote

while (%n) var %bl $+ %set $+ %t $($+(%,bl,%set,%t) $ialchan(%banmask,$chan,%n).nick,%n %n - 1

Last edited by Simo; 16/09/22 05:35 PM.
Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
this seems to work proper for me from your previous posted code besides the stacking part :

Code

ON ^*:RAWMODE:#:{
  echo -t $chan  12,08 $theme2011($pn2011($nick,$chan)) 1,15 Sets Mode on  5,15 $chan 1,15 to: 12,15  $strip($1-,bcru)  
  var %takepara $remove($gettok($chanmodes,1-3,44),$chr(44)),%i 1,%j 2,%set +
  while ($mid($1,%i,1)) {
    var %t $v1
    if (%t == +) %set = +
    elseif (%t == -) %set = -
    elseif (%t isincs $nickmode) inc %j
    elseif (%t isincs %takepara) {
      if (%t isincs beIq) {
        var %banmask $eval($chr(36) $+ %j,2)
        if (~quiet:?* iswm %banmask) %banmask = $mid(%banmask,8)   
        elseif (~?:?* iswm %banmask) %banmask = $mid(%banmask,4)
        elseif (?:?* iswm %banmask) %banmask = $mid(%banmask,3)
        if ($ialchan(%banmask,$chan,0)) {
          var %n $v1,%m %n,%user user,%is is,%word $replacexcs(%set $+ %t,+b,Banned,-b,UNBanned,+I,Invited,-I,UNInvited,+e,Exempted,-e,UNExempted,+q,MuteBanned,-q,UN-MuteBanned)
          if (%m > 1) {
            %user = users
            %is = are
          }
          while (%n) var %bl %bl $ialchan(%banmask,$chan,%n).nick,%n %n - 1
          var %k 1
          while ($gettok(%bl,%k,32)) {
            if ($query($v1)) echo -t $v1 08,14  ( $+ %m %user $+ ) %is %word 04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t) 
            inc %k
          }
          echo -t $chan 08,14  ( $+ %m %user $+ ) %is %word 04,00 $regsubex(%bl,/(\S+)/g,( $+ \n $+ ) \t) 
          unset %bl
        }
      }
      inc %j
    }
    inc %i
  }
  haltdef
}



Last edited by Simo; 16/09/22 07:24 PM.
Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
If only the stacking part worked as well to limit the output lines

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Oops, the line should be
Code
while (%n) var %bl $+ %set $+ %t $($+(%,bl,%set,%t),2) $ialchan(%banmask,$chan,%n).nick,%n %n - 1


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2021
Posts: 91
Simo Online OP
Babel fish
OP Online
Babel fish
Joined: Nov 2021
Posts: 91
excellent Wims that works flawless much apreciated

Page 1 of 2 1 2

Link Copied to Clipboard