mIRC Homepage
Posted By: Tears Newbie questions - 19/05/03 10:45 PM
1.

Is there any way to get all the channels a person is in upon a whois.

( $2 on raw 352 )

2.

I have been attempting to creat a kick-ban script.

It is supposed to kick a user 3 times for saying/doing something not allowed, then ban the user for a specified time.

I messed up totally with it as I started out with the idea of writing the nick in a txt file whenever he/she made an abuse...hence where I am going at...

Any pointers on this would be appriciated.

Thanks in advance.
Posted By: Online Re: Newbie questions - 20/05/03 12:30 AM
To know the number of any raw reply, simply type /debug -p @window (-p is for wrapping long lines).

Here's a script that captures the channels information:
Code:
raw 319:*:echo -> $2 is on: $3- | halt

As for a protection script, check out this page, and make sure to read the "reaction levels" part too.

Posted By: Tears Re: Newbie questions - 20/05/03 08:32 AM
Thx alot, I managed to solve it the protection.

/debug -p @window doesn't show the numerics...atleast not for me...

However it seems was more tired then I thought yesterday..

Whois was supposed to be who

Hence the reason I wrote ( $2 on raw 352 )

Bad tendency of playing around with mIRC late at night...
Posted By: Online Re: Newbie questions - 20/05/03 10:21 AM
/debug is meant to monitor any data exchange between mirc and the server you're connected to. You need to open the window, do a /whois (or whatever else) and watch the window to know the order of the parameters, and the numeric belongs to each raw.

Anyhow, only /whois tells what channels the user is on, /who doesn't. If you wanted to make a bad channel kicker, it would be easier (and faster) if the bot sits in the bad channel (so that it can see who joins), and do a simple "if ($nick ison #badchan)" comparison when someone joins your channel.
Posted By: pheonix Re: Newbie questions - 20/05/03 04:37 PM
/who does actually find the channels a user is on just use this as an example:
on blah:TEXT:`find*:#:{ /who $2 }
raw 352:*:{
if (*#* iswm $2) {
msg $comchan($me,1) $2
}
else {
HALT
}
}
Posted By: Tears Re: Newbie questions - 20/05/03 10:49 PM
That makes no sence at all to me...

$comchan($me,1) would search for a the first common channel I am in and I am in...
Posted By: KingTomato Re: Newbie questions - 21/05/03 01:44 AM
If its one thing you should learn quickly on this forum, its to ignore pheonix's responces. 99.9% of the time, they are not helpful.

Secondly to get the channels a user is on with a whois, just use..

raw 319:*: {
/set %channels $3-
/unset %comchannels
/set -u0 %a 1
while (%a <= $numtok(%channels, 32)) {
if ($me ison $gettok(%channels, %a, 32)) /set %comchannels %comchannels $gettok(%channels, %a, 32)
/inc -u0 %a
}
}

Now, you have their channels in %channels, and channels you and they are in saved in %comchannels
Posted By: Tears Re: Newbie questions - 21/05/03 10:38 AM
Ok...

I knew how to get the channels by numeric 319, but to use %channels on /who I need to save it by performing a /whois on the person first.

My question was however just if there was a way to get all the channels a user is on by just doing a /who on him/her.

And I can't see any need to use variables on /whois replys...

I am but a newbie when it comes to mIRC though, so I might have missed something...

And in all honestly...I have no idea how tokens work...

Thanks for the answer though, I feel kinda bad rejecting ppl when they try to help me...

So I take in conclusion that /who can only show the first channel in response, unless you trigger a /whois upon the target to get the channels, then save them as KingTomato just showed...

"I learned something new wink"

If anyone have a good newbie tutorial about tokens I would be very happy to get the link.

And thanks alot those of you who tried to help me, pls bear with this poor newbie for asking stupid questions...
Posted By: pheonix Re: Newbie questions - 21/05/03 07:13 PM
no that wud mean if you typed `find blah
it would find blah and message all the channels he was found on.
because $comchan($me,1) is a replacement for # or $chan or $active in raw.
Posted By: pheonix Re: Newbie questions - 21/05/03 07:16 PM
also you judged me too quickly bcoz i started off posting msn mad
© mIRC Discussion Forums