on join question
#240111
27/12/12 05:16 AM
|
Joined: Jun 2009
Posts: 96
vinifera
OP
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?
|
|
|
Re: on join question
[Re: vinifera]
#240112
27/12/12 05:25 AM
|
Joined: Feb 2003
Posts: 3,432
sparta
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,.) }
|
|
|
Re: on join question
[Re: sparta]
#240113
27/12/12 05:34 AM
|
Joined: Jun 2009
Posts: 96
vinifera
OP
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
doesn't work (your code) 
|
|
|
Re: on join question
[Re: vinifera]
#240114
27/12/12 05:46 AM
|
Joined: Feb 2003
Posts: 3,432
sparta
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,.) }
|
|
|
Re: on join question
[Re: sparta]
#240115
27/12/12 05:52 AM
|
Joined: Jun 2009
Posts: 96
vinifera
OP
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
|
|
|
Re: on join question
[Re: vinifera]
#240116
27/12/12 06:03 AM
|
Joined: Jun 2007
Posts: 933
5618
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
Remove the ! prefix from the on join event.
|
|
|
Re: on join question
[Re: 5618]
#240117
27/12/12 06:13 AM
|
Joined: Jun 2009
Posts: 96
vinifera
OP
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
|
|
|
Re: on join question
[Re: vinifera]
#240118
27/12/12 06:24 AM
|
Joined: Feb 2003
Posts: 3,432
sparta
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,.) }
|
|
|
Re: on join question
[Re: sparta]
#240119
27/12/12 06:32 AM
|
Joined: Jun 2009
Posts: 96
vinifera
OP
Babel fish
|
OP
Babel fish
Joined: Jun 2009
Posts: 96 |
ah nice that did the job
thanks
|
|
|
Re: on join question
[Re: sparta]
#240125
27/12/12 06:35 PM
|
Joined: Jul 2007
Posts: 1,129
Tomao
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.
|
|
|
Re: on join question
[Re: Tomao]
#240126
27/12/12 06:43 PM
|
Joined: Jun 2007
Posts: 933
5618
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.
|
|
|
Re: on join question
[Re: Tomao]
#240130
27/12/12 10:27 PM
|
Joined: Oct 2004
Posts: 8,330
Riamus2
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
|
|
|
Re: on join question
[Re: Riamus2]
#240131
27/12/12 11:28 PM
|
Joined: Jul 2007
Posts: 1,129
Tomao
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.
|
|
|
Re: on join question
[Re: Tomao]
#240226
08/01/13 02:27 AM
|
Joined: Jun 2009
Posts: 96
vinifera
OP
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
|
|
|
Re: on join question
[Re: vinifera]
#240230
08/01/13 11:12 AM
|
Joined: Oct 2004
Posts: 8,330
Riamus2
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
|
|
|
Re: on join question
[Re: Riamus2]
#240231
08/01/13 01:36 PM
|
Joined: Jun 2009
Posts: 96
vinifera
OP
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 -_-
|
|
|
Re: on join question
[Re: vinifera]
#240232
08/01/13 02:43 PM
|
Joined: Jun 2007
Posts: 933
5618
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.
|
|
|
Re: on join question
[Re: 5618]
#240234
08/01/13 03:18 PM
|
Joined: Jun 2009
Posts: 96
vinifera
OP
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
|
|
|
Re: on join question
[Re: vinifera]
#240238
08/01/13 07:19 PM
|
Joined: Jul 2007
Posts: 1,129
Tomao
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
}
}
}
|
|
|
Re: on join question
[Re: Tomao]
#240253
12/01/13 04:37 AM
|
Joined: Jun 2009
Posts: 96
vinifera
OP
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
|
|
|
|
|