mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2004
Posts: 5
I
infamy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2004
Posts: 5
hey
i dont want joins, parts and quits to show up on specific channels (not all of them, only the ones i choose)
I figured out how to get rid of the join and parts..but the QUITS has been giving me problems..i tried many ways..but nothing perfect

here's what i have for the join and part

on ^1:JOIN:#channel:haltdef
on ^1:PART:#cahnnel:haltdef

on ^1:quit.... does not work that well, i still see some quits in the channel, and in the server window i see some error msg.

help is appreciated

infamy


Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
on ^*:quit: haltdef will not show any quits in any channels. For specific channel(s), try this:
Code:
on ^*:quit: {
 var %x = $comchan($nick,0)
 while ($comchan($nick,%x)) {
  var %a = $v1
   if ($istok(%quit.chans,%a,44)) { haltdef }
  dec %x
 }
}
This should hide the quits on the channels that are in the %quit.chans variable. This var should be separated by commas (,) --> #home,#office,#bar

Hope this helps smile
Zyzzyx.


"All we are saying is give peace a chance" -- John Lennon
Joined: Sep 2004
Posts: 5
I
infamy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2004
Posts: 5
Thanks for the code, it works but i'm confused bout something.

this line,
if ($istok(%quit.chans,%a,44)) { haltdef }

it works if i take out the %quit.chans and replace it with for example, #bar, #mirc, #channel, %a, 44

but what did u mean by

"This should hide the quits on the channels that are in the %quit.chans variable. This var should be separated by commas (,) --> #home,#office,#bar"

how would i put them in the %quit.chans variable?
(sorry for noob questions, its been a looooong time since i did any mirc scripting..i can follow it pretty easily, but not code as easily)



Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
A %variable is a kind of "shortcut" to a value. It holds texts, numbers or whatever you need that, as the name suggest, can vary from time to time. Variables can be easier to use because, instead of writing the whole value, you just put the var's name there smile

The variable %quit.chans, in this case, would hold the channels you want to hide the Quits from. Having the %quit.chans variable there or simply puting #bar,#mirc,#channel is the same thing, as long as you separate the channel name with a comma (,).

To create a variable you use the command /set. Here's what the help file says about it:

/set [-snzuN] <%var> [value]
This sets the value of %var to the specified value.

If you specify the -uN switch, %var is unset after N seconds, assuming it is not set again by another script. If you specify a zero for N, the variable is unset when the script finishes.

The -z switch decreases %var until it reaches zero and then unsets it.
The -n switch makes it treat value as plain text.


So, the set the variable %quit.chans you can use: /set %quit.chans #channel1,#channel2,#channel3 and so on.. You can modify the var by either doing a new /set command or going to the Variables editor (Alt + R and clicking on the tab Variables).

There are also temporary variables which exist only while the script which set them is running. Those are made with the command /var (Syntax is: /var %var_name = <value>)

In the script above you can either put #home,#office,#bar or create the %quit.chans variable with that value. It will work either way as long as they are separated by a comma.

For further help you can type, in your mIRC, /help variables.

I hope this could help smile
Zyzzyx.


"All we are saying is give peace a chance" -- John Lennon
Joined: Sep 2004
Posts: 5
I
infamy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2004
Posts: 5
ahh, thanks
thats what i needed to know smile
but you really didn't need to explain what a variable is smile

Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
yw wink

Sorry, I guess I was inspired of something :P


"All we are saying is give peace a chance" -- John Lennon

Link Copied to Clipboard