Simple, user types !seen to display when was last seen
and !idle to see how long a nick has been idle for
if you see any mistakes please let me know
thanks :D
PePSiMaN
credits for the idle portion go to kslice
thx
on *:TEXT:*!idle*:*: {
if ($1 = !idle) && (%idle.time.get = $null) {
raw whois $2 $2
set %idle.time.get on
set %idle.chan $chan
set %idle.nick $2
}
elseif ($1 = !idle) && (%idle.time.get != $null) {
msg $chan There is currently already an !idle check in progress $nick $+ , please try again in a second!
}
}
raw 317:*:{
if (%idle.time.get = on) {
set %temp.idle.time $3
msg %idle.chan %idle.nick has been idle for $duration(%temp.idle.time)
unset %temp.idle.time
unset %idle.nick
unset %idle.chan
unset %idle.time.get
halt
}
}
on *:join:#: {
hadd -m Seendata $nick J $nick $right($address($nick,0),-2) $ctime $chan
}
on *:PART:#: {
hadd -m Seendata $nick P $nick $right($address($nick,0),-2) $ctime $chan $1-
}
on *:QUIT: {
hadd -m Seendata $nick Q $nick $right($address($nick,0),-2) $ctime $1-
}
on *:NICK: {
hadd -m Seendata $nick N $nick $right($address($newnick,0),-2) $ctime $newnick $chan
hadd -m Seendata $newnick N $newnick $right($address($newnick,0),-2) $ctime $nick $chan
}
on *:KICK:#: {
hadd -m Seendata $knick K $knick $right($address($knick,0),-2) $ctime $chan $1-
}
on *:START: {
hmake Seendata 200
hload -bi Seendata Seendata.hsh
seen.save
}
alias seen.save {
hsave -bio Seendata Seendata.hsh
.timerseensave 0 300 seen.save
}
on *:text:*!seen*:#: {
if ($1 == !seen) && ($2 != $null) {
if ($3 != $null) { halt }
if ($2 == $nick) {
msg $chan Look a little harder and you might find yourself $nick
halt
}
if ($2 == $me) {
msg $chan Find me yet $nick $+ ?
halt
}
if ($2 ison $chan) {
msg $chan $2 is currently on the channel.
halt
}
if ($hfind(Seendata,$2) == $null) {
msg $chan $2 was not found in the database.
halt
}
else {
set %seenres $hget(Seendata,$hfind(Seendata,$2))
if ($left(%seenres,1) == J) {
msg $chan $2 was last seen $duration($calc($ctime - $gettok(%seenres,4,32))) ago.
halt
}
if ($left(%seenres,1) == P) {
msg $chan $2 was last seen $duration($calc($ctime - $gettok(%seenres,4,32))) ago.
halt
}
if ($left(%seenres,1) == Q) {
msg $chan $2 was last seen $duration($calc($ctime - $gettok(%seenres,4,32))) ago.
halt
}
if ($left(%seenres,1) == K) {
msg $chan $2 was last seen $duration($calc($ctime - $gettok(%seenres,4,32))) ago.
halt
}
if ($left(%seenres,1) == N) {
msg $chan $2 was last seen changing nickname to $gettok(%seenres,5,32) $duration($calc($ctime - $gettok(%seenres,4,32))) ago.
set %seenres2 $hget(Seendata,$hfind(Seendata,$gettok(%seenres,5,32)))
if ($gettok(%seenres,5,32)) !ison $chan) { msg $chan $gettok(%seenres,5,32)) was last seen $duration($calc($ctime - $gettok(%seenres2,4,32))) ago. }
if ($gettok(%seenres,5,32)) ison $chan) { msg $chan $gettok(%seenres,5,32)) is currently on the channel. Looks like your in luck $nick $+ !! }
halt
}
}
}
if ($1 == !seen) && ($2 == $null) {
msg $chan are you looking for someone?
return
}
else {
return
}
}
pepsi dude i realllly like ur script, but u knw its missing one thing which prevents it from being the ultimate seen script, that is ip tracker .
i use mirc for the local lan in my university and here we have ip's too search for some one .
cuz we not always remember the nicks.
so if u guys find anything abt my request. plz do
add it to the script.
Heh, found a problem...that I blame on myself.
You guys will also want to add the following code:
raw 402:*:{
if (%idle.time.get = on) {
msg %idle.chan 9 $+ %idle.nick $+ 4 is not online!
unset %idle.nick
unset %idle.chan
unset %idle.time.get
halt
}
}
If you don\'t, and somebody does an !idle on somebody not on the server, the script will no longer work and just freeze up.
If you ran into the problem already and can\'t figure how to fix it, just type:
/unset %idle.time.get
Cheers!
Heh, I\'ve never posted on Hawkee before; yet, you mention my name?
I\'m pretty sure some people are like, \"who is that?\" or \"why do we care?\"
Anyways, glad to know I helped ;-)
Now, some recommendations on the idle part:
I would recommend that you change
on *:TEXT:*!idle*:*: {
to
on *:TEXT:!idle:*: {
Then, since you did that, you might also want to exclude the
($1 = !idle) &&
on both lines.
But I guess it will work either way :-/
As for the !seen part, looks good...just not as good as mine :P