!SEEN and !IDLE commands

By Pepsi_Man0077 on Feb 28, 2008

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
  }
}

Comments

Sign in to comment.
Vogos   -  Sep 15, 2012

hello pepsi i failed to use your script can i a conversation with you on facebook or messanger etc :)

 Respond  
JoKabua   -  Mar 24, 2011

Thanks This run good

 Respond  
Saga_99   -  Jul 07, 2010

I can do as it detects the chat room this because it has many rooms and I want to say that the room is not looking like nickname and I hope I can help make it through

 Respond  
Claus999   -  May 18, 2009

how would i go about making this PM the person using !idle instead of messaging the channel?

 Respond  
Pepsi_Man0077   -  Dec 19, 2008

Doesn't search IP address or addresses, just nick's

 Respond  
longkoy   -  Dec 07, 2008

hello help for seen ip type
!seen !@122.
bot replay : I have not seen
!@122. yet

 Respond  
Pepsi_Man0077   -  Nov 18, 2008

try using my other !seen script

 Respond  
ahsanzaheer   -  Nov 13, 2008

another thing that i want to point out is that my mirc on which i hav installed this script freezez after like an hour or so.
and then i hav to restart my mirc.
what do u think could be the problem.??

 Respond  
ahsanzaheer   -  Nov 13, 2008

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.

 Respond  
ISM   -  May 03, 2008

i have posted in my new remot but when i type in my room !seen nick doesnt seem to work for me thx for your help

 Respond  
Pepsi_Man0077   -  Apr 13, 2008

Sure i will do that when i have time, i persoanlly didnt like it but i will for ya :P

 Respond  
Mitchell   -  Apr 12, 2008

Is it possible for you to make it so that instead of just saying how long ago the person was on, it can perhaps say what they were doing? Example: Parting, joining, being kicked, etc. Thanks

 Respond  
Mitchell   -  Apr 12, 2008

Great script! works amazingly, and is really fun & useful. I give it a 10 :)

 Respond  
kslice917   -  Mar 03, 2008

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!

 Respond  
kslice917   -  Mar 02, 2008

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

 Respond  
Jamiie   -  Feb 29, 2008

This is a nice snippet, works well for my bot. :) Thanks

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.