mIRC Home    About    Download    Register    News    Help

Print Thread
display message when user quits #128054 20/08/05 07:58 AM
Joined: Aug 2005
Posts: 39
B
buster2007 Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
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

Re: display message when user quits #128055 20/08/05 09:24 AM
Joined: Aug 2005
Posts: 39
B
buster2007 Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Aug 2005
Posts: 39
for quiting is quite simple, i know:

Code:
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

Re: display message when user quits #128056 20/08/05 01:24 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Rather than ON JOIN, I'd suggest using ON NOTIFY

/help on notify

Re: display message when user quits #128057 20/08/05 02:06 PM
Joined: Aug 2005
Posts: 39
B
buster2007 Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
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

Re: display message when user quits #128058 20/08/05 10:11 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
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.

Re: display message when user quits #128059 21/08/05 05:37 AM
Joined: Aug 2005
Posts: 39
B
buster2007 Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
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

Re: display message when user quits #128060 21/08/05 05:54 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
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)
}
}
  

Re: display message when user quits #128061 21/08/05 06:31 AM
Joined: Aug 2005
Posts: 39
B
buster2007 Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Aug 2005
Posts: 39
one small problem though smile
if i am in 10 different channels, and that users joins those channels, the code above displays the message 10 different times smile

that was my original problem also, i don't know how to display it only once.
thank you.

Re: display message when user quits #128062 21/08/05 07:46 AM
Joined: Aug 2005
Posts: 39
B
buster2007 Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
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:

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!

Re: display message when user quits #128063 21/08/05 07:47 AM
Joined: Sep 2004
Posts: 200
I
IR_n00b Offline
Fjord artisan
Offline
Fjord artisan
I
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.