mIRC Home    About    Download    Register    News    Help

Print Thread
#26601 28/05/03 11:38 AM
Joined: Feb 2003
Posts: 29
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2003
Posts: 29
Have a property for $nick() to show online time simular to the idle time, but instead show the time the nick have been in the channel, and not just idle time.

Also can come in handy if $uptime could show the time since you joined a specific channel.

Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
For what purpose would you use these? Those are easy to script if needed...


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Feb 2003
Posts: 29
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2003
Posts: 29
Then show me the easy scripts please.

To see the online time for all users in all channels.

Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
Code:
on *:start: {
  hmake nickonline 500
}
on *:join:#: {
  if ( $nick == $me ) {
    enable #nickraws
  }
  hadd nickonline $+($cid,.,$chan,.,$nick) $ctime
}

#nickraws off
raw 366:*: {
  var %i = 1 , %j = $nick($2,0) , %ctime = $ctime
  while ( %i <= %j ) {
    hadd nickonline $+($cid,.,$2,.,$nick($2,%i)) %ctime
    inc %i
  }
  disable #nickraws
}
#nickraws end

on *:part: {
  if ( $nick == $me ) {
    hdel -w nickonline $+($cid,.,$chan,.,*)
  }
  else {
    hdel nickonline $+($cid,.,$chan,.,$nick)
  }
}
on *:nick: {
  ;was it $nick or $newnick you had to loop trough w/ $comchan???
  var %i = 1 , %j = $comchan($nick,0)
  while ( %i <= %j ) {
    hadd nickonline $+($cid,.,$comchan($nick,%i),.,$newnick) $hget(nickonline,$+($cid,.,$comchan($nick,%i),.,$nick)
    hdel nickonline $+($cid,.,$comchan($nick,%i),.,$nick)
    inc %i
  }
}
on *:quit: {
  var %i = 1 , %j = $comchan($nick,0)
  while ( %i <= %j ) {
    hdel nickonline $+($cid,.,$comchan($nick,%i),.,$nick)
    inc %i
  }
}
on *:disconnect: {
  hdel -w nickonline $cid $+ .*
}
;Aliases
alias nickonline {
  ;$1 = #channel
  ;$2 = nick
  ;$3 = cid, if omitted current $cid used
  if ( $isid ) {
    return $calc($ctime - $hget(nickonline,$+($iif($3,$3,$cid),.,$1,.,$2))
  }
}


something... not tested... but should give you idea what to do?


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Feb 2003
Posts: 29
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2003
Posts: 29
Thanks, will try it out. Will take a bit time for me to understand it full but I think I will eventually.

But still a new property would be nice to have in $nick() don't you think?

Last edited by StriderGU; 28/05/03 01:43 PM.
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
alias nick {
if ( $prop == online ) {
return $nickonline($1,$2)
}
else {
return [ $nick($1,$2,$3,$4) [ $+ $prop ] ]
}
}

or smthng smile


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Dec 2002
Posts: 117
R
Vogon poet
Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
Nice try, but (unfortunately) you can't overwrite mIRC identifiers, only commands.
(I found that out the time-consuming way myself)


$input(Me like stars, You too?)
Joined: Feb 2003
Posts: 29
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2003
Posts: 29
Ok it works now, thanks a bunch theRat.

I just had to use $newnick instead of $nick in $comchan like you maybe thought.


Edit: Hm doesn't seam to reset the time if someone rejoins (parts and join).

Last edited by StriderGU; 29/05/03 04:06 PM.

Link Copied to Clipboard