mIRC Home    About    Download    Register    News    Help

Print Thread
How can I do this? #89354 06/07/04 08:56 AM
Joined: Nov 2003
Posts: 46
D
Dizkonnekted Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2003
Posts: 46
Morning all,

I'll try to explain this as best I can, I have a couple of problems displaying raw 319 info to a custom window.
The 319 info is checked against a list of 'bad' channels, if a bad channel is detected in the list the person is kicked from my channel.

The problems:
1. I'm using a rather lengthy if-then-else routing to check the channels, I'd like to be able to do this another (faster?) way, and add to the list of 'bad' channels dynamically without directly editing the script myself and adding to the long list of if-then-else.

2. I want the 'bad' channel displayed in a different color from the safe channels in the custom window, so I need a method to do this.

I'm looking for as many different solutions to this as possible, any help is greatly appreciated!

Thanks in advance!
Diz


Dizkonnekted from reality....!
Re: How can I do this? #89355 06/07/04 09:57 AM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
make a hash table named badchans with for each bad channel an item with as name the channelname and as data the number 1
Code:
raw 319:*: {
  var %i = 1
  var %chanlist, %chan
  .!echo -q $regsub($gettok($3-,%i,32),^[^#&]*+,,%chan)
  while (%chan) {
    if ($hget(badchans,%chan)) {
      echo $color(whois)  -s bad chan detected: %chan
      var %chanlist = %chanlist $+(4,%chan,)
    }
    else {
      var %chanlist = %chanlist %chan
    }
    inc %i
    .!echo -q $regsub($gettok($3-,%i,32),^[^#&]*+,,%chan)
  }
  echo $color(whois) -s $2 on %chanlist
  halt
}


(now it's tested smile )

Last edited by Kelder; 06/07/04 10:08 AM.