mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2007
Posts: 13
7
Pikka bird
OP Offline
Pikka bird
7
Joined: Nov 2007
Posts: 13
Hi,

I want to run a script, but -only- if a channel has an invite-only flag.

Something like:

if (#chanX mode == invite-only) {
on *:TEXT:*: etc...
on *:JOIN:*: etc...
}

Can't figure out how to do that...

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Code:
if (i isincs $chan($chan).mode) { }
But you can't use a /if and after put your event, simply use something like that :
Code:
on *:text:*:#:{
if (i !isincs $chan($chan).mode) return
;rest of your script here
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2007
Posts: 13
7
Pikka bird
OP Offline
Pikka bird
7
Joined: Nov 2007
Posts: 13
ah... thanx for the very quick reply!

I'll try that out.

But... I have a on text, on input, on kick, on action, etc... meaning I have to duplicate it a dozen times?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
That or use groups and check when changing the active window if it's an invite-only channel to enable/disable the groups.


Invision Support
#Invision on irc.irchighway.net
Joined: Nov 2007
Posts: 13
7
Pikka bird
OP Offline
Pikka bird
7
Joined: Nov 2007
Posts: 13
Thanx again for the help.

The if (i isincs $chan($chan).mode) { } works perfectly,
only problem is now: I have to test the mode of another channel...

Lets assume chanX and chanY. If someone says someting on chanX, it must be
displayed on chanY. But only if chanY is still invite-only.

Is it possible to test the mode of another channel?

I now have some workaround:

on *:mode:#chanY: {
if (i isincs $chan($chan).mode) {
%i = 1
}
else %i = 0
}

on *:TEXT:*:#chanX: {
if %i = 1 {
/msg #chanY $nick says on chanX: $1-
}
}

...but I want to have something like this:

on *:TEXT:*:#chanX: {
if (i isincs $chan($chan).mode) {<---that must be the chanY test
/msg #chanY $nick says on chanX: $1-
}
}

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Quote:
if (i isincs $chan($chan).mode) {<---that must be the chanY test

becomes
Quote:
if (i isincs $chan(#chanY).mode) {<---that must be the chanY test


You must be on #chanY in order to know what modes it has set though.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Nov 2007
Posts: 1
U
Mostly harmless
Offline
Mostly harmless
U
Joined: Nov 2007
Posts: 1
Just a note - instead of $chan(#CHAN).mode you should use

Code:
$gettok($chan(#chan).mode,1,32)


Otherwise it will trigger if the chanel happens to keyed, and the key has an i in it.

It's not very likely in this case i know - but its something you should keep in mind

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

Why is it not very likely? It was a good point.


Link Copied to Clipboard