mIRC Home    About    Download    Register    News    Help

Print Thread
#251716 01/03/15 07:16 AM
Joined: Feb 2015
Posts: 7
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2015
Posts: 7
Firstabble i don't claim that the code(s) are optimized:)
So the problem...
I'm building custom list with nicks that i want to monitor.
I've created dialog for this and creates variables for users.
%monitor_list.nick nick!*ident@*

and i've check nicks that join on a channel
On *:join:blabla...

var %im = 1
while ($var(%monitor_list.*,%im)) {
if ($gettok($var(%monitor_list.*,%im).value,2,33) == $+(*,$remove($gettok($ial($nick,1).addr,1,64),~),@*)) {
echo 4 -t $chan * 7Monitored: $nick ( $+ $gettok($address($nick,5),2,33) $+ ) has joined $chan
cline 13 $chan $nick
halt
}
inc %im
}

So far, so good

now i want to check nicks already on channel whem i'm joining it for monitored nick, but it works only for myself. I know why, i'm asking how to bypass it.
and again On *:join:blabla...

if ($nick == $me) {
.set -u5 %onjoinwho ON
.who $chan
test
return
}

and test from aliases:

test {
var %i = 1
while ($nick($chan,%i,a)) {
echo -a $ord $nick($chan,%i,a)
inc %i
}
}

when call it from editbox in channel - it works, when call it from script it works only for my nick, obviously because i'm the nick who joins... any ideas?

BigLamer #251721 01/03/15 02:10 PM
Joined: Jan 2004
Posts: 1,359
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,359
You join the channel before the nicklist is populated, you need to catch raw numeric 366 (end of /names list):

Code:
raw 366:*:{
  var %chan = $2
  ...
}

Joined: Feb 2015
Posts: 7
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2015
Posts: 7
Well...

-> irc.some.server JOIN #asdasd
<- :SomeNickname!BigLamer@ip/host JOIN :#asdasd
-> irc.some.server MODE #asdasd
-> irc.some.server WHO #asdasd
<- :irc.some.server MODE #asdasd +nt
<- :irc.some.server 353 SomeNickname = #asdasd :@SomeNickname
<- :irc.some.server 366 SomeNickname #asdasd :End of /NAMES list.
<- :irc.some.server 324 SomeNickname #asdasd +nt
<- :irc.some.server 329 SomeNickname #asdasd 1425221143
<- :irc.some.server 352 SomeNickname #asdasd BigLamer ip/host irc.some.server SomeNickname H@ :0 b0rN t0 b3 w1Ld...
<- :irc.some.server 315 SomeNickname #asdasd :End of /WHO list.

366 is after the join command. I'll try to set some variable on join, and to check it on raw 315 (because already perform who on join to update ial) if it's true to go with the rest of commands.

P.S. Thanks for the hint

BigLamer #251746 02/03/15 06:33 AM
Joined: Jul 2006
Posts: 4,157
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,157
The JOIN message is merely telling you that you joined, the nickname on the channel are only sent with the raw 353.
Setting a variable and checking with raw 366 (315 is end of /who, you should in theory use 366, end of /names) is correct, though

Last edited by Wims; 02/03/15 06:33 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard