|
Joined: Jun 2009
Posts: 96
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
hi, i'm using v6.21 and have a problem my script has 2 on join events in this order
on !@*:JOIN:#:{
if ($level($fulladdress) == 1000) { .mode # +o $nick }
if ($level($fulladdress) == 10) { .mode # +v $nick }
}
on $me:JOIN:#:{
if ($chan == #1) { .timerchmode1 1 5 .mode # +rcu }
if ($chan == #2) { .timerchmode2 1 5 .mode # +rcu }
}
problem is that 2nd on join that supposed set chan modes doesn't trigger why?
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
You can not use two like that, place one of them in a new file and it should work. Or put them together.
on !@*:JOIN:#:{
if ($level($fulladdress) == 1000) { .mode # +o $nick }
if ($level($fulladdress) == 10) { .mode # +v $nick }
if ($nick == $me) {
if ($chan == #1) { .timerchmode1 1 5 .mode # +rcu }
if ($chan == #2) { .timerchmode2 1 5 .mode # +rcu }
}
}
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Jun 2009
Posts: 96
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
doesn't work (your code)
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
Did you change the #1 and #2 to your channel? does the timers start?
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Jun 2009
Posts: 96
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
yes channels are properly named timer isn't active (doesn't show) in the list
|
|
|
|
Joined: Jun 2007
Posts: 933
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
Remove the ! prefix from the on join event.
|
|
|
|
Joined: Jun 2009
Posts: 96
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
I was to tired to notice it, but @ tell mirc to only trigger if you are oped, remove that and it will trigger. You cant be oped since it's a on join event and you join, you can add a alternative check. if ($me isop #channel) { }
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Jun 2009
Posts: 96
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
ah nice that did the job
thanks
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
You cant be oped since it's a on join event You, the client that runs the code, CAN be opped with the join event to indicate that you have @ status. You don't need to place ! and @ together. A single @ affixed to the join event will get the job done to keep the join event from being triggered by $me.
|
|
|
|
Joined: Jun 2007
Posts: 933
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
To clarify: that is only because you will never be an operator when you yourself join a channel, only after a (very) short delay.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
As 5618 mentioned, because part of the on JOIN event includes doing something if you are the nick, you would not want the @ prefix as that would never do the part where you are the nick joining the channel. If you weren't doing something when you join, then the @ would make sense, but this does something to other nicks as well as $me.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
Oh yes, I was applying the @ in question to "I wasn't doing something" when a nick joins. Thanks for the further clarification, Riamus2 and 5618.
|
|
|
|
Joined: Jun 2009
Posts: 96
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
so let me ask you this to separate my opping of users on ulist from this I added because setting chan modes go without check if I'm op so its
on *:JOIN:#:{
if ($me isop #) {
if ($level($fulladdress) == 1000) { .mode # +o $nick }
if ($level($fulladdress) == 10) { .mode # +v $nick }
}
if ($nick == $me) && ($me isop #) {
;setting the chan modes
}
}
but didn't work then then I tried as
on *:JOIN:#:{
if ($me isop #) {
if ($level($fulladdress) == 1000) { .mode # +o $nick }
if ($level($fulladdress) == 10) { .mode # +v $nick }
if ($nick == $me) {
;setting the chan modes
}
}
}
and again nothing worked so why? :P
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
When you join a channel, you are not an op. So $nick will never be you in an on JOIN at the same time that you are an op and that part will never trigger. It is possible to use a timer, but that's unreliable because you won't know how quickly you'll be an op. If you need something to happen when you join and the become an op, just put the code in an on OP event where $opnick = you.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jun 2009
Posts: 96
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
okay, I tried this then
on *:OP:#:{
if ($opnick == $me) {
if (uc !isincs $chan(#).mode) {
if ($chan == #chan1) { .mode # +uc }
if ($chan == #chan2) { .mode # +uc }
}
}
}
BUT via debug, I see that even if channel has +uc mode init and even if I used !isincs (with !), the debug shows that on deop, and then op script calls chan mode to be set again -_-
|
|
|
|
Joined: Jun 2007
Posts: 933
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
Note that if you use "(uc !isincs $chan(#).mode)" then it has to be in there in that exact order. So +nrtuc will match but +nrutc will not match.
|
|
|
|
Joined: Jun 2009
Posts: 96
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
corrected the issue (thanks) but the calling of mode change (with modes set) still happens :P
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
Give this a shot: on *:op:#:{
var %c = #chan1 #chan2 #chan3
var %m = $gettok($chan(#).mode,1,32)
if ($opnick == $me) && (u !isincs %m) || (c !isincs %m) {
var %a = 1
while ($gettok(%c,%a,32)) {
mode $v1 +uc
inc %a
}
}
}
|
|
|
|
Joined: Jun 2009
Posts: 96
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
has the same bug even if mode is set it sends to server for mode +uc
|
|
|
|
|