|
|
Joined: Aug 2005
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2005
Posts: 39 |
hi. i'd like a script that shows when a user has quit irc if i have a query opened with him, and i'd like the message to be displayed in the query. also if he rejoins irc and my query with him is still opened, i'd like it to show me a message in the query that he rejoined irc.
can you pls help me with this? give me some suggestions at least. thanks
|
|
|
|
Joined: Aug 2005
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2005
Posts: 39 |
for quiting is quite simple, i know:
on 1:QUIT: {
if ($query($nick)==$true)
echo $nick $nick has quit IRC ($1- )
}
but how do i test this on join??? if i put on join, i don't want the message displayed every thime that user joins a channel that i'm in also thanks
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Rather than ON JOIN, I'd suggest using ON NOTIFY
/help on notify
|
|
|
|
Joined: Aug 2005
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2005
Posts: 39 |
yes but im not interrested in a specific user, but in all users, and i cannot add all users to my notify list. if i have a query with someone and he quits and then rejoins irc i want to have some message in my query telling me that.
when quitting irc.. the solution is above, but i don;t know or joining irc.
please help. thanks
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
the ON JOIN event will only recognize a person when they join a room, not when they sign onto the network. If you are an IRCop on the network, then you can detect when a person signs onto the network.
|
|
|
|
Joined: Aug 2005
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2005
Posts: 39 |
yes i knew that.
however i need to somehow use ON JOIN to detect when they first join a channel (that i'm in also, of course) after they just quit irc and consider that to be "joining irc" (i don't see another way). but i don't know how to do it... i'm not so good at scripting.
please suggestions? thanks
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
on *:quit:{
if $query($nick) { .hadd -m Query $nick $ctime }
}
on *:join:#:{
if $hget(Query,$nick) {
echo -a $nick has joined $chan and you had an open query with them when they quit at $asctime($hget(Query,$nick),mmm dd yyyy hh:nn:ss tt)
}
}
|
|
|
|
Joined: Aug 2005
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2005
Posts: 39 |
one small problem though if i am in 10 different channels, and that users joins those channels, the code above displays the message 10 different times that was my original problem also, i don't know how to display it only once. thank you.
|
|
|
|
Joined: Aug 2005
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2005
Posts: 39 |
ok after looking through the help file, i did it. thanks for the help RusselB (i didn't knew about the hash tables) here's the final code:
on 1:QUIT: {
if ($query($nick)) {
.hadd -m QuitJoin $nick $ctime
echo -l $nick $nick ( $+ $right($address($nick,0),-2) $+ ) has quit IRC ( $+ $1- $+ )
}
}
on 1:JOIN:#: {
if ($hget(QuitJoin,$nick) && $query($nick)) {
.echo -l $nick $nick ( $+ $right($address($nick,0),-2) $+ ) has rejoined IRC (had quit4 $duration($calc($ctime - $hget(QuitJoin,$nick))) ago)
.hdel QuitJoin $nick
}
}
on *:NICK: {
if (($query($nick) || $query($newnick)) && $newnick != $me && $nick != $me) {
.echo -l $newnick $nick is now known as $+ $newnick
if ($hget(QuitJoin,$nick)) .hdel QuitJoin $nick
}
}
simple enough, i think. bye!
|
|
|
|
Joined: Sep 2004
Posts: 200
Fjord artisan
|
Fjord artisan
Joined: Sep 2004
Posts: 200 |
do somthing with a /whois, i.e make it /whois them every minute or so, this is the best way if the server dosent have a autojoin channel.
|
|
|
|
|
|