!seen Script

By blackvenomm666 on Jun 12, 2011

I know its nothing new but i decided to try my hand at a !seen script i was bored what can i say anyways load into a new remotes file. whenever a nick parts/joins/getskicked/quits it will write the info into an ini then when you do !seen nickhere it will tell you when the nick was last seen. gives time in central standard u.s time meant for a bot

on !*:join:#: {
  remini seen.ini $nick
  writeini seen.ini $nick seen joining $chan
  writeini seen.ini $nick time $time(h:nn:ss:tt)
}
on *:kick:#:{
  remini seen.ini $knick
  writeini seen.ini $knick seen being kicked from $chan
}
on *:PART:#: {
  remini seen.ini $nick
  writeini seen.ini $nick seen parting $chan
  writeini seen.ini $nick time $time(h:nn:ss:tt)
}
on *:QUIT: { 
  remini seen.ini $nick
  writeini seen.ini $nick seen quitting $server
  writeini seen.ini $nick time $time(h:nn:ss:tt)
}
On *:NICK: {
  remini seen.ini $nick
  writeini seen.ini $nick seen Changing_Nicks_to $newnick 
  writeini seen.ini $nick time $time(h:nn:ss:tt)

}
on $*:TEXT:/^(!seen)/Si:#:{
  if ($2) && (!$readini(seen.ini, $2,seen)) {
    msg $chan i have not seen $2
  }
  if (!$2) { msg $chan 4,15:4,1[ $+ $nick you must specify a nick to check4,15]4,1:
  }
  elseif ($2 ison $chan) {
    msg $chan 4,1:12,1[ $+ $2 is on the channel numbnuts12,1]4,1:
  }
  else {
    if ($readini(seen.ini, $2,seen)) {
      msg $chan 4,1:12,1[ $+ $2 was last seen $readini(seen.ini, $2,seen) at $readini(seen.ini, $2,time) central time12,1]4,1:
    }
  }
}

Comments

Sign in to comment.
John Daniels   -  Jan 23, 2013

should make one when there is !seen it shows when they were last online only.

 Respond  
Jethro   -  Jun 13, 2011

I overlooked a couple of little matters when copying and pasting from your original code. Edited.

 Respond  
Jethro   -  Jun 13, 2011

You gotta love the $event identifier:

on !*:quit:seen
on !*:nick:seen
on !*:join:#:seen
on !*:kick:#:seen
on !*:part:#:seen
alias -l seen {
  var %event = $replace($event,join,joining #,kick,$&
    being kicked from #,part,parting #,quit,quiting $server,$&
    nick,Changing_Nicks_to $newnick)
  remini seen.ini $nick
  writeini -n seen.ini $nick seen %event
  writeini -n seen.ini $nick time $time(h:nn:ss:tt)
}
on $*:text:/^!seen( |$)/Si:#:{
  var %2 = $strip($2)
  if (!%2) msg # 4,15:4,1[ $+ $nick you must specify a nick to check4,15]4,1:
  elseif (!$readini(seen.ini,%2,seen)) msg # I have not seen %2
  elseif (%2 ison #) msg # 4,1:12,1[ $+ %2 is on the channel numbnuts12,1]4,1:
  else msg # 4,1:12,1[ $+ %2 was last seen $readini(seen.ini,%2,seen) $&
    at $readini(seen.ini,%2,time) central time12,1]4,1:
}

It's best to include the -n switch so mIRC will attempt to write info to the ini file if it's larger than 64k. You also had a couple of redundancies that I corrected them.

 Respond  
blackvenomm666   -  Jun 13, 2011

yea already did that in my version on my bot just havent uploaded it haha

 Respond  
Jethro   -  Jun 13, 2011

What about an on nick event so you know who has their nicknames changed...

 Respond  
napa182   -  Jun 12, 2011

nice, but it would be better in my opinion to go with hash instead of a ini file for this.
on ur join event instead of this:

on *:join:#: {
  if ($nick != $me) {

you could do this

on !*:join:#: {

so you can get rid of the if line there.

 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.