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
/lines
/rand
Note:
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
halt
}
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
halt
}
if ($read(LastSaid.txt,s,$nick)) {
write -ds $+ $nick LastSaid.txt
write LastSaid.txt $nick $1- $ctime
halt
}
write LastSaid.txt $nick $1- $ctime
}