mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#240111 27/12/12 05:16 AM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
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

Code:
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
S
Hoopy frood
Offline
Hoopy frood
S
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.
Code:
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,.) }
sparta #240113 27/12/12 05:34 AM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
doesn't work (your code) frown

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
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,.) }
sparta #240115 27/12/12 05:52 AM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
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
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Remove the ! prefix from the on join event.

5618 #240117 27/12/12 06:13 AM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
no change

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
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,.) }
sparta #240119 27/12/12 06:32 AM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
ah nice
that did the job

thanks

sparta #240125 27/12/12 06:35 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: sparta
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.

Tomao #240126 27/12/12 06:43 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
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.

Tomao #240130 27/12/12 10:27 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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
T
Hoopy frood
Offline
Hoopy frood
T
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.

Tomao #240226 08/01/13 02:27 AM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
so let me ask you this

to separate my opping of users on ulist
from this I added
Code:
&& ($me isop #) {

because setting chan modes go without check if I'm op

so its
Code:
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
Code:
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
Offline
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
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
okay, I tried this then

Code:
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
5
Hoopy frood
Offline
Hoopy frood
5
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.

5618 #240234 08/01/13 03:18 PM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
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
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Give this a shot:
Code:
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
    }
  }
}

Tomao #240253 12/01/13 04:37 AM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
has the same bug
even if mode is set it sends to server for mode +uc

Page 1 of 2 1 2

Link Copied to Clipboard