Seen v1.9

By RubixCube on Sep 29, 2007

ABOUT:

A seen script I made. It stores all the data in a hash table, constantly updating the nick's current seen status. Simple code, simple to use. Editing is fine, as long as you give me credit for the work that is mine

Now includes a dialog.

USAGE:

You can use this two different ways:
2) !seen (nick) - for other users
3) /call_seen -> type in nick to search for and click 'search'

; ################################## 
; # Seen v1.3 - RubixCube    #
; ##################################

; ##### MAIN #####

on *:load: if (!$hget(seen)) hmake seen 100 

on *:TEXT:!seen*:#:{ 
  if (!$hget(seen)) hmake seen 100
  if ($2) {
    if ($2 ison $chan) msg $chan $2 is already in the channel.
    else {
      if ($hget(seen,$2)) msg $chan $2 was last seen $hget(seen,$2) 
      else { msg $chan $2 isn't in the seen database. }
    }
  }
}

on *:TEXT:*:#:{ 
  if ($hget(seen,$nick)) hdel seen $nick
  .hadd -m seen $nick $seen.msg(text)
}

on *:KICK:*:#:{ 
  if ($nick != $me) { 
    if ($hget(seen,$nick)) hdel seen $nick
    .hadd -m seen $nick $seen.msg(kick)
  }
}

on *:PART:#:{ 
  if ($nick != $me) { 
    if ($hget(seen,$nick)) hdel seen $nick
    .hadd -m seen $nick $seen.msg(part)
  }
}

on *:JOIN:#:{ 
  if ($nick != $me) { 
    if ($hget(seen,$nick)) hdel seen $nick
    .hadd -m seen $nick $seen.msg(join)
  }
}

on *:QUIT:{ 
  if ($nick != $me) { 
    if ($hget(seen,$nick)) hdel seen $nick
    .hadd -m seen $nick $seen.msg(quit)
  }
}

on *:ACTION:#:{ 
  if ($nick != $me) { 
    if ($hget(seen,$nick)) hdel seen $nick
    .hadd -m seen $nick $seen.msg(act)
  }
}

on *:NICK:{ 
  if ($nick != $me) {  
    if ($hget(seen,$nick)) hdel seen $nick
    .hadd -m seen $newnick $seen.msg(nick)
  }
}
on *:START:{ 
  if (!$hget(seen)) hmake seen 100
  hload seen seen.hsh
}

on *:EXIT:{
  if ($hget(seen)) { 
    hsave -o seen seen.hsh
  }
}

alias seen.msg { 
  if ($1 = text) return Saying $1- in $chan at $time(h:nntt) on $+($date,.)
  if ($1 = part) return Leaving $chan at $time(h:nntt) on $+($date,.)
  if ($1 = join) return Joining $chan at $time(h:nntt) on $+($date,.)
  if ($1 = act) return Describing to $+($chan,:) $1- at $time(h:nntt) on $+($date,.)
  if ($1 = quit) return Quitting $chan with message: $1- at $time(h:nntt) on $+($date,.)
  if ($1 = nick)  return $newnick has changed from original nick $+($chr(40),$nick,$chr(41)) at $time(h:nntt) on $+($date,.)
  if ($1 = kick) return Being kicked by $nick at $time(h:nntt) on $+($date,.)
}

; #### DIALOG ####

dialog seen_dial. {
  title "Seen system: "
  size -1 -1 275 96
  option pixels notheme
  edit "", 2, 5 66 263 27, read autohs 
  edit "", 4, 11 10 161 20
  button "Search", 5, 182 8 65 25
  edit "", 1, 11 37 245 20, read
}

on *:dialog:seen_dial.:sclick:5:{ 
  if ($did($dname,4).text) { 
    did -ra $dname 1 $hget(seen,$v1).item
    did -ra $dname 2 $hget(seen,$did($dname,1).text).data
  }
}

alias call_seen dialog $iif($dialog(seen_dial.),-v,-md) seen_dial. seen_dial.

alias call_seen dialog $iif($dialog(seen_dial.),-v,-md) seen_dial. seen_dial.

Comments

Sign in to comment.
Kentaro Kurosaki   -  Feb 02, 2012

@mountaindew: Its actually /exit -r
An FYI :)

 Respond  
Fuzion   -  Sep 28, 2008

very nice

 Respond  
ermansanidhya   -  Aug 02, 2008

how about seen ip not name ?

 Respond  
RubixCube   -  Jun 04, 2008

Not the greatest one, I still need to make improvements.

Been quite a while since I\'ve been on here, I need to update some of these snippets of mine. :) Thank you everyone for your comments.

 Respond  
Mitchell   -  Apr 20, 2008

very nice !seen script. Probably the best one I have used yet :) great work

 Respond  
tracetraceau   -  Feb 05, 2008

thanks , it works :) is ther any way I can alter it from seen leaving at 624pm on such n such date to how many hours ago since everyones time zones are diffrent .

 Respond  
guest598594   -  Sep 30, 2007

oh ok :P

 Respond  
RubixCube   -  Sep 30, 2007

I made it make the hash table when the script was loaded instead. Thanks for the idea though.

 Respond  
guest598594   -  Sep 30, 2007

SETUP :
/hmake seen 100
Restart mIRC

u can do

on *:load: close -r 

to restart mirc

 Respond  
RubixCube   -  Sep 30, 2007

Ah I see. I fixed that and made a few updates. I decided to get rid of the seen.add and just include it in the actual events. Thanks Akishoot for recognizing my mistake.

 Respond  
Akishoot   -  Sep 30, 2007

Oops. RubixCube posted while I was typing this. D:

 Respond  
Akishoot   -  Sep 30, 2007

The way the script looks to me, even if the user has never been seen by the bot/script, then it will still: msg $chan $2 was last seen $hget(seen,$2). Which would explain why it gives the name, but no time. Not exactly sure on this...

 Respond  
RubixCube   -  Sep 30, 2007

There are two possible reasons why it isn\'t working:

1) You haven\'t seen the nicks already. Also, it doesn\'t work for you it only works for other users. This script doesn\'t just work at first. You have to wait till the user joins a channel or quits or parts etc.

2) There are some servers that support !seen in there botserv. Your server\'s !seen might be interfering with mine.

 Respond  
Sora-   -  Sep 30, 2007

Er, it doesn\'t really work for me
-(10:49)- !Seen Riht
-(10:49)- -AnimeBot- Riht was last seen 1 day, 18 hours ago (28/Sep/07 23:45 GMT).
-(10:49)- :|
-(10:50)- !Seen Riht
-(10:50)- -AnimeBot- Riht was last seen 1 day, 18 hours ago (28/Sep/07 23:45 GMT).
-(10:50)- Riht was last seen
-(10:50)- .
-(10:50)- !Seen Weavile
-(10:50)- -AnimeBot- Weavile is online now, using the nick Aeroku-Namiashi.
-(10:50)- Weavile was last seen
-(10:50)- .
-(10:51)- ...
-(10:51)- :|

 Respond  
RubixCube   -  Sep 30, 2007

A 4.0 huh? If you have any suggestions or criticism, it would be better if you posted your thoughts so I can make improvements instead of posting a score with no reason.

  • RubixCube
 Respond  
RubixCube   -  Sep 30, 2007

Ah thanks guys. xDaeMoN I forgot to get rid of the part saying that was in there when I updated the code and used a dialog instead, thanks for seeing that.

Thanks Olliegod that\'s been fixed.

 Respond  
Olliegod   -  Sep 30, 2007

Just something small, $chan can\'t be used in a quit event.

 Respond  
xDaeMoN   -  Sep 30, 2007

I just noticed something in your update. The /seen alias was not included.

 Respond  
RubixCube   -  Sep 29, 2007

Couple updates:

1) Fixed an error in the exit event that didn\'t save the table correctly due to an invalid form at of hsavw
2) Made a dialog for the script

 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.