mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28
howdy fellaz? i need a hand here regarding on whois all the nicks in the channel. There are 20 nicks present in a certain channel before i joined then, i want to whois all of them by simple typing in main.

!whoisall



Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
why not /who $chan

Quote:
on *:input:#:{
if ($1 == !whois) whoc $chan
}

alias whoc {
var %who = $iif(!$1,$active,$1), %ch = $nick(%who,0) | while (%ch) { whois $nick(%who,%ch) | dec %ch }
}


You could put the alias code into the input event if you want.

Last edited by DJ_Sol; 31/03/07 06:55 PM.
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
That'll flood him straight off the server.

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
works for me.

Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28
it works perfectly fine..

Thank you for the quick response mate =)



Last edited by sner; 31/03/07 07:05 PM.
Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
That's probably the most irresponsible post I have ever seen.

Just because it "works for you" doesn't mean it won't flood me off a server with 100+ people in the channel.


Those who can, cannot. Those who cannot, can.
Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28
yeah Kardafol is right.

I tested on the undernet server and joined #romania it consist more than 100+ people in the channel. Unfortunately, i got disconnected trice albeit, i do have 1mpbs adsl broadband line.

I suspect that the server itself wont allow to have a simultaneous and rapid /whois.

Hope we can sort a remedy for this, it's very interesting.

=)

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Perhaps it would help if you tell us why you need to whois all users in the channel. What information are you trying to view? There is likely another way of obtaining the information besides issuing a mass whois. Try to include all the necessary details when asking a question.

Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
My best guess would be auth names/realnames. However I don't see a real need to do this, unless its for the auth names.

A solution to solve the problem would be to queue the whois, doing only 1, waiting a second, do the second whois, etc.


Those who can, cannot. Those who cannot, can.
Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28
On which line will i add a whois queue timer?
Because this one did not work, i got disconnected..
Quote:
on *:input:#:{
if ($1 == !whois) timer 1 10 whoc $chan
}

alias whoc {
var %who = $iif(!$1,$active,$1), %ch = $nick(%who,0) | while (%ch) { timer 1 10 whois $nick(%who,%ch) | dec %ch }
}

The purpose for this is to detect the bad channel specially the porn bots that always lurks in our channel =)

Sorry for the delay response about the aim for this code.

Last edited by sner; 01/04/07 12:08 AM.
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
I guess we won't know, as the OP doesn't seem interested in saying what he's trying to do.

Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
You could use on *:join:, and whois the joiner then, and take action with a on raw event if its on whatever channel.

I'll fix an alias when I get up, its 1:24 AM. sleep

Last edited by Kardafol; 01/04/07 12:25 AM.

Those who can, cannot. Those who cannot, can.
Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28
@Kardafol: okay mate, copy that and thank you!

I already have an on !*:join:#channel: whois $nick

I need to enhance the whois event queue timer to check the channel every now and then. For instance, the porn bots have already joined before me. So, I have to manually whois all the people in the channel, i was thinking i'll use a masswhois so that it can detect the bad channels.

The codes im using is working perfectly fine on small channels consist of less than 50 people. But, above from that i'll get disconnected from the server (excess flood).

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Yer awfully angry. It works for me what do you want me to do? I cannot predict how other networks will react. If anything at least he see's how he can do it. He can use timers or something. Where is your solution?

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
The code works, given a channel is relatively small, this is practically true across any given network. Secondly, it's hard to give a possible solution when the poster doesn't say what exactly he's trying to do. There's more than likely a better, faster way to go about doing it.

Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
He did edit his post with his exact purpose:
"The purpose for this is to detect the bad channel specially the porn bots that always lurks in our channel =)"

And it's actually quite interesting imo.

So, he already has a script that will whois on join, and kick them if they are on a bad channel, for example #sex. But he wants to add a timed check for this as well. So, once every 10 minutes, whois everyone on the channel, and if they are on a bad channel, kick/ban them.

Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
You can predict how other networks will react. Try this:
Code:
//timer 0 200 whois $me

That will eventually flood you off your server, unless you are an IRCop.
Also, if you would actually read, you would see:
Originally Posted By: Kardafol
...I'll fix an alias when I get up, its 1:24 AM. sleep


I'm currently working on a solution, since I just woke up.


Those who can, cannot. Those who cannot, can.
Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
Here's what I've got so far:
Code:
alias xwhois {
  if ($isid) return
  if (($1 == $null) && (#* !iswm $active)) {
    echo -ac info * /xwhois: insufficient parameters
    return
  }
  if (($1 != $null) && (#* !iswm $1)) {
    echo -ac info * /xwhois: invalid parameters
    return
  }
  if ($hget(xwhois. $+ $iif($1 != $null,$1,$active))) {
    echo -ac info * /xwhois: operation already in progress $+($chr(40),$iif($1,$1,$active),$chr(41))
    echo -ac info * /xwhois: type /xwhoisabort to cancel /xwhois.
    return
  }
  var %chan = $iif($1 != $null,$1,$active), %y = $nick(%chan,0)
  echo -ac info * Performing /whois on all users in %chan $+ . $+($chr(40),%y users total,$chr(41))
  hmake xwhois 1
  while (%y) {
    hadd xwhois $nick(%chan,%y)
    dec %y
  }
  .timerxwhois 0 2 xwhoistimer %chan
}
raw 319:*: {
  if ($2 == %xwhois.nick) {
    echo -ac info * /xwhois: $2 is on channels: $3-
  }
}
alias xwhoistimer {
  if ($hget(xwhois) == $null) {
    .timerxwhois off
    return
  }
  var %x = $hget(xwhois,1).item, %c = $iif($hget(xwhois,2).item == $null,1,0)
  set -u3 %xwhois.nick %x
  whois %x
  hdel xwhois %x
  if (%c) {
    echo -ac info * /xwhois: Done doing /xwhois on $1 $+ .
    hfree xwhois
    .timerxwhois off
    .disable #xwhois
  }
}
alias xwhoisabort {
  var %x = $timer(xwhois).com
  .timerxwhois off
  hfree xwhois
  echo -ac info * /xwhoisabort: /xwhois on $gettok(%x,2,32) has been canceled.
}

/xwhois [#channel]
Performs a /whois on all the users in #channel, with a 2 second delay to each whois, then echos the result in [#channel], or the channel /xwhois was performed in.
/xwhoisabort
Aborts the current /xwhois.


If you want it to echo to a custom window, change
Code:
echo -ac info
;to:
echo -c info @window
;For a custom window.
;or:
echo -c info $1
;For the channel you're doing the /xwhois on.
;NOTE: Only change the echo in the "xwhoisc" alias, or you might not receive feedback.


Those who can, cannot. Those who cannot, can.
Joined: Feb 2007
Posts: 28
S
sner Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28
@Kardafol:

Splendid work man! it works extremely smooth and very well!

Goodbye to the appalling disconnections..

Cheers to you mate!

Many thanks for again..

=)

Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
If you want, you could also filter the results, so they only display the nicknames on certain channels:
Code:
alias xwhois {
  if ($isid) return
  if (($1 == $null) && (#* !iswm $active)) {
    echo -ac info * /xwhois: insufficient parameters
    return
  }
  if (($1 != $null) && (#* !iswm $1)) {
    echo -ac info * /xwhois: invalid parameters
    return
  }
  if ($hget(xwhois)) {
    echo -ac info * /xwhois: operation already in progress $+($chr(40),$gettok($timer(xwhois).com,2,32),$chr(41))
    echo -ac info * /xwhois: type /xwhoisabort to cancel /xwhois.
    return
  }
  var %chan = $iif($1 != $null,$1,$active), %y = $nick(%chan,0)
  echo -ac info * Performing /whois on all users in %chan $+ . $+($chr(40),%y users total,$chr(41))
  hmake xwhois 1
  while (%y) {
    hadd xwhois $nick(%chan,%y)
    dec %y
  }
  .timerxwhois 0 2 xwhoistimer %chan
}
raw 319:*: {
  ;remove line below to do this to anyone you whois
  if ($2 == %xwhois.nick) {
    ; seperate channel names with '|' characters, if a channel has any of the following characters: []\^$.|?*+()
    ; it needs to be preceded with a \: #channel| becomes #channel\| #|^^\ becomes #\|\^\^\\
    if ($regex($3-,/(^|\s)[^#]?(<------- channels -------->)($|\s)/)) {
      echo -ac info * /xwhois: $2 is on channels: $3-
      ; add kick/ban here, however this could potentialy flood you off, or cause lag. Below will kick them and ban after whoising the whole channel
      .timer 1 $calc($hget(xwhois,0) + $timer(0) * 2) echo -a ban -k %xwhois.chan $2 2 <---reason here--->
      ;remove the } here if you removed the "if ($2 == %xwhois.nick) {"
    }
  }
}
alias xwhoistimer {
  if ($1 == halt) return
  if ($hget(xwhois) == $null) {
    .timerxwhois off
    return
  }
  var %x = $hget(xwhois,1).item, %c = $iif($hget(xwhois,2).item == $null,1,0)
  set -u3 %xwhois.nick %x
  whois %x
  hdel xwhois %x
  if (%c) {
    echo -ac info * /xwhois: Done doing /xwhois on $1 $+ .
    hfree xwhois
    .timerxwhois off
    .disable #xwhois
  }
  set -u3 %xwhois.chan $1
}
alias xwhoisabort {
  var %x = $timer(xwhois).com
  .timerxwhois off
  hfree xwhois
  echo -ac info * /xwhoisabort: /xwhois on $gettok(%x,2,32) has been canceled.
}

edit: forgot some info
edit2: forgot even more info: Replace the old "raw 319" with this one, and make apropriate edits ;P
edit3: not working, fixing some things :<
edit4: Added working code, however you should edit the part that says <---.. channels ..>, and add "bad" channels there.

Last edited by Kardafol; 01/04/07 11:46 PM.

Those who can, cannot. Those who cannot, can.
Page 1 of 2 1 2

Link Copied to Clipboard