Last Said Skript 2.0

By newklear on Nov 10, 2008

Last Said Skript 2.0

Will Keep record of every channel you are in, of a nick names last message they said in a channel using a text file. The text file shouldn't get to big as it only stores 1 line for each different nickname and overwrites with their last line each time.

Copy the below snippet and go back to mIRC press Alt + R and paste into a new Remote File, save.

Channel Usage:
!ls nickname
!lastsaid nickname

Own Usage:
/ls nickname

I had a look for this type of script and surpisingly only found 2 versions but on another website, one used an ini file and the other used hash tables. I decided to do this snippet this way as it works better for me and I am pretty proud of it as yes I did spend a little time on it with trial and error. It can be written alot better and any advice to improve is welcome and will be changed if needed.
Thanx have a good giggle :-)

on *:LOAD: { 
  echo -a Last Said Skript 2.0 Loaded
  echo -a Public Usage: !ls nick or !lastsaid nick
  echo -a Alias Usage: ls, lines, rand

on *:UNLOAD: {
  echo -a Unloading Last Said Skript 2.0
  ; remove -b LastSaid.txt

alias rand { 
  echo -a $1 Random " $+ $remove($read(LastSaid.txt),1,2,3,4,5,6,7,8,9,0) $+ "

alias lines {
  echo -a There are currently $lines(LastSaid.txt) Nicks in the database.

alias ls {
  if (!$1) { echo -a Syntax: /ls nickname | halt }
  if (!$read(LastSaid.txt,s,$1)) { echo -a Sorry I have not seen $1 say anything yet | halt }
  var %ttemp $right($read(LastSaid.txt,s, $1),10)
  echo -a $1 last said " $+ $remove($read(LastSaid.txt,s, $1),1,2,3,4,5,6,7,8,9,0) $+ " $duration($calc($ctime - %ttemp)) ago

on *:TEXT:*:#: {
  if ($1 == !lastsaid) || ($1 == !ls) {
    if (%lastsaid [ $+ [ $nick ] ] == 1) { halt }
    set -u10 %lastsaid [ $+ [ $nick ] ] 1
    if (!$2) { msg $chan Syntax: !ls nickname or !lastsaid nickname | halt }
    if (!$read(LastSaid.txt,s,$2)) { msg $chan Sorry I have not seen $2 say anything yet | halt }
    var %ttemp $right($read(LastSaid.txt,s, $2),10)
    msg $chan $2 last said " $+ $remove($read(LastSaid.txt,s, $2),1,2,3,4,5,6,7,8,9,0) $+ " $duration($calc($ctime - %ttemp)) ago
  if ($read(LastSaid.txt,s,$nick)) { 
    write -ds $+ $nick LastSaid.txt
    write LastSaid.txt $nick $1- $ctime
  write LastSaid.txt $nick $1- $ctime


Sign in to comment.
jasonh   -  Aug 09, 2011

still works. thanks.

DragonHeart   -  Jul 28, 2009

works great. good script!

inti-garcia   -  Nov 18, 2008

Love it, thanks m8

Anish   -  Nov 11, 2008

nice job buddy

newklear   -  Nov 10, 2008

Ty mountaindew, fixed

.Added Flood control of 10 seconds per nick.
.Added an Alias "/lastsaid nick".
.Fixed an error catcher.

guest598594   -  Nov 10, 2008
    Usage: !ls nick or !lastsaid nick

Should have echo -a before that line.

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.