mIRC Home    About    Download    Register    News    Help

Print Thread
#74516 09/03/04 04:17 AM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
I seem to have stumped myself in a simple coding of hiding the whois for onjoins. What I am trying to do is whois people when they join a channel I am on so the script checks for "bad channels" and so it can kick/ban the visitor if he/she is on one of the set channels. I got everything to work but I own/run a busy channel and seeing all the whois's is not an option. I would make it show whois info to the status screen but I perfer when I whois someone manually it show in the channel. Can someone please help. I either want the onjoin whois to goto Status screen or be hidden totally.

#74517 09/03/04 05:11 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
I hope this will be a good starting point for you:
  • alias silent_whois {
    hadd -mu20 whois $1 1
    whois $1
    }

    raw *:*:{
    if $numeric isnum 310-320 && $hget(whois,$2) {
    haltdef
    if $numeric == 318 {
    ; 318 = End of /WHOIS
    hdel whois $2
    }
    elseif $numeric == 319 {
    ; 319 = Channels list
    ; Here you can add the kick command...
    echo -s $2 is on: $3-
    }
    }
    }
As you can see, when you type /silent_whois the nickname ($1) is temporarily stored in a hash table, and as long as it's there mIRC knows it should parse his whois replies.

To catch other numerics, type /debug @window

#74518 09/03/04 05:18 AM
Joined: Mar 2004
Posts: 6
W
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
W
Joined: Mar 2004
Posts: 6
this should do the trick:

raw 310:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | halt } }
raw 379:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | halt } }
raw 307:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | halt } }
raw 319:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | halt } }
raw 312:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | halt } }
raw 317:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | halt } }
raw 318:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | set %hidewhois On | halt } }
raw 378:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | halt } }
raw 311:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | halt } }
raw 313:*:{ if (%hidewhois != off) { halt } | else { echo 1 -a $2- | halt } }

menu Nicklist {
-
$chr(171) Show Whois $chr(187):set %hidewhois Off | /whois $$1
}


#74519 09/03/04 05:21 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
You would need a way for the raw events to know whether or not they should halt or not. One easy way is to $addtok the nicks to a /set %variable name, such as: set %OnJoin.#channel nick1 nick3 nick154 .. in this way, your raw events for the whois on your network can check to see if $istok(%OnJoin.#YourChannel, $2, 32) and halt if so, then removing the nick in the 318 End of Whois.
Code:
on @*:JOIN:#YourChannel: set -u600 %OnJoin.#YourChannel $addtok(%OnJoin.#YourChannel, $nick, 32) | .raw WHOIS $nick
raw 311:*: if $istok(%OnJoin.#YourChannel, $2, 32) { halt }
raw 319:*:{
  if $regex($3-, /#badchan1|#badchan2|#badchan3|#badchan4/) && $istok(%OnJoin.#YourChannel, $2, 32) {
    ban -ku600 #YourChannel $2 2 Ewww. You're in $regml(1) and therefore not in here.
  }
  if $istok(%OnJoin.#YourChannel, $2, 32) { halt }
}
raw 312:*: if $istok(%OnJoin.#YourChannel, $2, 32) { halt }
raw 307:*: if $istok(%OnJoin.#YourChannel, $2, 32) { halt }
raw 301:*: if $istok(%OnJoin.#YourChannel, $2, 32) { halt }
raw 317:*: if $istok(%OnJoin.#YourChannel, $2, 32) { halt }
raw 318:*:{
  if $istok(%OnJoin.#YourChannel, $2, 32) {
    set -u600 %OnJoin.#YourChannel $remtok(%OnJoin.#YourChannel, $2, 1, 32)
    if $numtok(%OnJoin.#YourChannel, 32) == 0 { unset %OnJoin.#YourChannel }
    halt 
  }
}



DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#74520 09/03/04 11:08 AM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
Thanks alot for the suggestions. All were great and worked perfectly for what i was trying to accomplish. I decided to work with Online's suggestion because it was the most simple and least confusing for me personally being quite new to mIRC script.


Link Copied to Clipboard