Completely new concept to a seen script. Not only does this seen script tell what the last user did. But if a user is not in a channel that the bot is in, it will do a raw whois and if the target is on the server, the bot will give a list of channels the target is on and the bot will contact the target for the user if the user wishes.
Syntex:
!seen - Will first check if user is on the server, if not it will deliver what the target was last seen doing, and how long ago
!idle - Delivers the nicks idle time (not channel idle time, server idle time)
!search - If the target of the !seen command is on the server, the bot will locate the target for the user if the user wishes.
note: you only have 2 minutes to use the !search command after you perform the !seen command and the target is on the server :P
I am pretty sure all bugs are worked out, it you find any please let me know.
Special Thanks to OliMaylen for the raw 319 portion
:) Enjoy
;=======================
;== !Seen Script v2.0 ||
;=======================
;== By PePSiMaN ||
;=======================
;== Raw ==
raw 402:*: {
if (%xseen) {
if (!$hget(xSeen,%xseen.target)) { msg %xseen.chan Sorry, %xseen.target was not found in my database. }
if ($hget(xSeen,%xseen.target)) {
var %xseen.data $left($hget(xSeen,$2),1)
tokenize 32 $hget(xSeen,%xseen.target)
if ($1 = Q) { msg %xseen.chan $2 was last seen Quitting $duration($calc($ctime - $3)) ago. | msg %xseen.chan (Quit Message: $4- $+ ) }
if ($1 = S) { msg %xseen.chan $2 was last seen by me on the server $duration($calc($ctime - $3)) ago. }
if ($1 = K) { msg %xseen.chan $2 was last seen being kicked from $4 $duration($calc($ctime - $3)) ago. | msg %xseen.chan (Kick Reason: $5- $+ ) }
if ($1 = P) { msg %xseen.chan $2 was last seen parting $4 $duration($calc($ctime - $3)) ago. | if ($5) { msg %xseen.chan (Part Reason: $5- $+ ) } }
if ($1 = N) { msg %xseen.chan $2 was last seen changing his/her nick to $4 $duration($calc($ctime - $3)) ago. }
if ($1 = J) { msg %xseen.chan $2 was last seen joining $4 $duration($calc($ctime - $3)) ago. }
if ($1 = T) { msg %xseen.chan $2 was last seen talking in $4 $duration($calc($ctime - $3)) | msg %xseen.chan (Text said: $5- $+ ) }
}
xdefclear
}
if (%idle.time.get = on) {
msg %idle.chan Sorry %idle.x $+ , %idle.nick was not found on this server. Try !seen %idle.nick
unset %idle.nick
unset %idle.chan
unset %idle.time.get
unset %idle.x
halt
}
}
raw 319:*:{
if (%xseen) {
msg %xseen.chan User $2 is currently in: $remove($3-,$chr(94),$chr(64),$chr(43),$chr(37),$chr(42))
notice %xseen.nick Click a room(s) to join them, or type !search & I'll tell them you're looking for them.
set -u60 %xfind. [ $+ [ %xseen.nick ] ] %xseen.target
hadd -m xSeen %xseen.target S $nick $ctime
xdefclear
;halt
}
}
raw 317:*:{
if (%xseen) {
msg %xseen.chan $2 was found on the server but not in any channel.
notice %xseen.nick If you would like me to inform $2 you are looking for them, type !search
set -u60 %xfind. [ $+ [ %xseen.nick ] ] %xseen.target
hadd -m xSeen %xseen.target S $nick $ctime
xdefclear
}
if (%idle.time.get = on) {
set %temp.idle.time $3
msg %idle.chan $2 has been idle for $duration(%temp.idle.time)
unset %temp.idle.time
unset %idle.nick
unset %idle.chan
unset %idle.time.get
halt
}
}
;== Aliases ==
alias xseen.save {
hsave xSeen xSeen.hsh
.timerxseensave 0 300 xseen.save
}
alias xdefclear {
unset %xseen
unset %xseen.chan
unset %xseen.nick
unset %xseen.target
}
alias xtimedclear {
if (%xseen) { xdefclear }
if (%idle.time.get) { unset %idle.time.get }
.timer 0 300 xtimedclear
}
;== Remotes ==
on *:TEXT:*:*: {
hadd -m xSeen $nick T $nick $ctime $chan $1-
if (%spam [ $+ [ $nick ] ] >= 3) {
if ($1 = !seen) || ($1 = !idle) {
msg $chan Do not abuse the !seen or !idle commands
halt
}
}
if ($1 = !seen) {
inc -u300 %spam [ $+ [ $nick ] ]
if (!$2) { msg $chan are you looking for someone? | halt }
elseif ($2 = $nick) { msg $chan Are you trying to find yourself $nick $+ ? I know of some great Counselors that might be able to help you :-\ | halt }
elseif ($2 = $me) { msg $chan Find my yet, $nick $+ ? | halt }
elseif ($2 ison $chan) { msg $chan $2 is currently on the channel. | halt }
elseif (%xseen = $null) {
raw whois $2 $2
set %xseen ON
set %xseen.chan $chan
set %xseen.nick $nick
set %xseen.target $2
}
elseif (%xseen != $null) {
msg $chan There is currently already a !seen check in progress $nick $+ , please wait a second and try again.
}
}
if ($1 = !search) && (%xfind. [ $+ [ $nick ] ]) {
msg %xfind. [ $+ [ $nick ] ] Hello there, I am an automated bot, please do not reply.
msg %xfind. [ $+ [ $nick ] ] $nick performed a !seen command on you and wanted me to let you know he was looking for you.
msg $chan Message has been send.
unset %xfind*
}
if ($1 = !idle) {
inc -u300 %spam [ $+ [ $nick ] ]
if (!$2) { msg $chan I need a nick to idle :P | halt }
if ($2 = $nick) { msg $chan Idle'n youself, $nick $+ ? | halt }
if ($2 = $me) { msg $chan I never idle $nick $+ . :) | halt }
else {
if (%idle.time.get) { msg $chan I am sorry $nick $+ , but there is already an idle check in progress, please try in a second. | halt }
raw whois $2 $2
set %idle.time.get on
set %idle.chan $chan
set %idle.nick $2
set %idle.x $nick
}
}
}
on *:START: {
if (!$hget(xSeen)) { hmake xSeen 10000 }
if ($isfile(xSeen.hsh)) { hload xSeen xSeen.hsh }
xseen.save
xtimedclear
}
on *:UNLOAD: {
timerxseensave off
}
on *:EXIT: {
hsave xSeen xSeen.hsh
}
on *:QUIT: {
hadd -m xSeen $nick Q $nick $ctime $1-
}
on *:KICK:#: {
hadd -m xSeen $knick K $nick $ctime $chan $1-
}
on *:JOIN:#: {
hadd -m xSeen $nick J $nick $ctime $chan
}
on *:NICK: {
hadd -m xSeen $nick N $nick $ctime $newnick
}
on *:PART:#: {
hadd -m xSeen $nick P $nick $ctime $chan $1-
}
Well i spoke to soon :) Now each time i do a !seen I get this.....
Trivbot: I have not seen luvme4me Do not abuse the !seen or !idle commands did i just not notice the second line or is there an error. I don't want that going to my users and them think i am trying to accuse them of something loool. let me know if it is suppose to be there please. thanks Also the !search doesn't seem to work anymore and i came back and grabed the code again and it still does the same thingNice script. I think, if my pc got hang and I reboot, why the saved data all disappear? Is it only happening to me? Like for example, nickA joined today at 4pm lets say. I had to reboot my pc cause it got hang. After reboot if someone use !seen nickA , bot would say not today's 4pm, may be yesterdays log. How to save the log permanently?
the same thing thats happening to jenny happens to me :/
my bot client will become unresponsive when i try to open it from the taskbar. and it starts using about 50% of my processor resources. i totally redid my bot. then tried it for a day without your script and it was fine. then i added your script to it and it crashed an hour later. it seems to crash about an hour after i boot my bot. and if reboot my bot, it still happens crashes after an hour :/ i really like this script. and im hoping this bug can be fixed :D
yeah i get that OliMaylen, sorry i wasnt quite clear..having set this in a bot of mine
i asked the bot !seen vexx it returned \"vexx is currently on the channel.\"
then asked the bot !seen bot it returned \"bot is currently on the channel.\"
this piece of coding doesnt even come into use
if ($2 = $nick) { Are you trying to find yourself $nick $+ ? I know of some great Counselors that might be able to help you :- | halt }
if ($2 = $me) { Find my yet, $nick $+ ? | halt }
unless you remove this line
if ($2 ison $chan) { msg $chan $2 is currently on the channel. | halt }
after removing that 1 line the replies now are
!seen vexx returns Are you trying to find yourself vexx ? I know of some great Counselors that might be able to help you :-\
!seen bot returns Find me yet, vexx ?
but of course removing that line when asked if !seen in the channel and that person is in the same room,it returns the list of rooms they are currently in, rather than say is currently in the channel..
hope thats a bit more clearer
way to solve this ?
unless its just me =/
then in which case may brimstone and fire rain down on my home
thanks
Vexx,
if ($2 = $nick) is if the person using the !seen command types in their own name.
if ($2 = $me) is if the person tries to perform the !seen command on the bot/user running the script. It\'s just a bit of fun. It could be left so it just says they are on the channel, but it just adds a bit extra to the script to give a humerous answer if a user \"!seen\'s\" themselves or the bot/user running the script. :)
Hi ,love the snippet,im no scripter and yes im a noob but just im just a wondering the point of these lines
if ($2 = $nick) { Are you trying to find yourself $nick $+ ? I know of some great Counselors that might be able to help you :-\\ | halt }
if ($2 = $me) { Find my yet, $nick $+ ? | halt }
because of this line
if ($2 ison $chan) { msg $chan $2 is currently on the channel. | halt }
Thought this might be useful, I have progressed a lot since my last comment, which I am unable to delete. I think I had other errors which accounted for the error I had before. Anyway I edited part of the script & added bits to handle the 319 code from the raw whois. Now instead of just saying if the user is on the server, it now returns a list of channels the user you \"!seen\" is on. It now also handles if users are on the server but not in any rooms and tells you this info also.
The bits I added may be a little crude, but it works. Changed the
msg $chan\"
to
.notice %xseen.nick
in a lot of places for my own use so as not to spam the room with people going mad with the script. It puts a nice touch to an already great script I think. :-)
Here is the bit i edited:
raw 402:*: {
if (%xseen) {
if (!$hget(xSeen,%xseen.target)) { .notice %xseen.nick 12Sorry,4 %xseen.target 12was not found in my database, or on the server. }
if ($hget(xSeen,%xseen.target)) {
var %xseen.data $left($hget(xSeen,$2),1)
tokenize 32 $hget(xSeen,%xseen.target)
if ($1 = Q) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen Quitting 4(Quit Message: $4- $+ ) $duration($calc($ctime - $3)) ago. }
if ($1 = S) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen by me on the server4 $duration($calc($ctime - $3)) ago. }
if ($1 = K) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen being kicked from4 $4 (Kick Reason: $5- $+ ) $duration($calc($ctime - $3)) ago. }
if ($1 = P) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen parting4 $4 (Part Reason: $5- $+ ) $duration($calc($ctime - $3)) ago. }
if ($1 = N) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen changing his/her nick to4 $4 $duration($calc($ctime - $3)) ago. }
}
xdefclear
}
if (%idle.time.get = on) {
.notice %idle.x 12Sorry4 %idle.x $+ 12,4 %idle.nick 12was not found on this server. Try 4!seen12 %idle.nick
unset %idle.nick
unset %idle.chan
unset %idle.time.get
unset %idle.x
halt
}
}
raw 319:*:{
if (%xseen) {
.notice %xseen.nick 12User4 $2 12is currently in:9 $3-
.notice %xseen.nick 12Click a room(s) to join them, or type 4!search 12& I\'ll tell them you\'re looking for them.
set -u60 %xfind. [ $+ [ %xseen.nick ] ] %xseen.target
hadd -m xSeen %xseen.target S $nick $ctime
xdefclear
;halt
}
}
raw 317:*:{
if (%xseen) {
.notice %xseen.nick 4 $+ $2 12was found on the server but not in any channel.
.notice %xseen.nick 12If you would like me to inform4 $2 12you are looking for them, type 4!search
set -u60 %xfind. [ $+ [ %xseen.nick ] ] %xseen.target
hadd -m xSeen %xseen.target S $nick $ctime
xdefclear
}
if (%idle.time.get = on) {
set %temp.idle.time $3
.notice %idle.x 4 $+ $2 12has been idle for4 $duration(%temp.idle.time)
unset %temp.idle.time
unset %idle.nick
unset %idle.chan
unset %idle.time.get
halt
}
}
Hi there, I\'m new to the site & new to IRC scripting. This is the first time I have studied it & the first time editing it, (learning as I go) so go easy on me if there are glaringly obvious errors.
I really liked this script as it was the only one I could find that used WHOIS to find a user that was not in the channel. I added it to a mIRC bot, (Yourbot IRC Bot 4.5.2) which was intergrated into mIRC v6.2, but the last user action (ie: Kick, Quit, Part etc) database wouldnt function properly & the script would freeze giving the bot client the error message: * Invalid format: $left (line 17, seen.mrc).
After some playing with the code & changing the v6.2 mIRC exe for the new v6.31 exe, the script works exactly as it should for my bot.
Like I said, it worked for me, there may have been a much easier way to sort the problem, but I didn\'t know it. :-) Thought I would share this in case other people had the same problem, or to see if there was an easier way of fixing the problem.
The code I changed was:
raw 402:*: {
if (%xseen) {
if (!$hget(xSeen,%xseen.target)) { msg %xseen.chan 12Sorry,4 %xseen.target 12was not found in my database, or on the server. }
if ($hget(xSeen,%xseen.target)) {
var %xseen.data $left($hget(xSeen,%xseen.target),1)
tokenize 32 $hget(xSeen,%xseen.target)
if ($1 = Q) { msg %xseen.chan %xseen.target was last seen Quitting (Quit Message: $4- $+ ) $duration($calc($ctime - $3)) ago. }
if ($1 = S) { msg %xseen.chan %xseen.target was last seen by me on the server $duration($calc($ctime - $3)) ago. }
if ($1 = K) { msg %xseen.chan %xseen.target was last seen being kicked from $4 (Kick Reason: $5- $+ ) $duration($calc($ctime - $3)) ago. }
if ($1 = P) { msg %xseen.chan %xseen.target was last seen parting $4 (Part Reason: $5- $+ ) $duration($calc($ctime - $3)) ago. }
if ($1 = N) { msg %xseen.chan %xseen.target was last seen changing his/her nick to $4 $duration($calc($ctime - $3)) ago. }
}
xdefclear
}