mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 27
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2003
Posts: 27
I'm wondering if anyone can help me with my very sloppy seen script? I'm really new to scripting, and could use all the help I can get. I know that there are some seen scripts out there to download and use...but to be honest, I don't know how to make them work, so would rather have written my own.

Anyway, this script works only about half the time. the other half of the time, it gives the wrong answer. Also, i would like it to say how long ago they were seen, instead of when they were last seen. I want it to be something like this:

"seen shy_and_quiet"
"shy_and_quiet was last seen 3 hours, 24 minutes, 35 seconds ago saying: goodnight everyone"

Here is my very sloppy script, if anyone can help me out with it I would REALLY appreciate it. Thank you in advance!!

on 1:TEXT:*:#Free_Women:{
/write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen talking on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
if seen isin $1 {
if $2 = $me {
msg $chan That's me silly!
halt
}
if $2 = $nick {
msg $chan $nick $+ , why are you asking about yourself?
halt
}
if $2 ison $chan {
msg $chan $2 is right here!
halt
}


%seen = $read -s $+ $2 $mircdirlogs\seen.txt
if ( $len(%seen) < 1 ) {
msg $chan Sorry, I have not seen $2
halt
}
msg $chan $2 %seen
}
}
on 1:ACTION:*:#Free_Women:{
/write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen doing an action on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on 1:JOIN:#Free_Women:{
.write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen joining $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on 1:PART:#Free_Women:{
.write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen parting $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on 1:NICK:#Free_Women:{
.write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen changing her nick to $newnick on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
.write $mircdirlogs\seen.txt $newnick was last seen on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on 1:QUIT:#Free_Women:{
.write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen quiting mIRC on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on 1:TOPIC:#Free_Women:{
.write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen changing the topic on $chan at $atime $adate to $1- saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on 1:VOICE:#Free_Women:{
.write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen being voiced on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on >=1:DEVOICE:#Free_Women:{
.write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen being devoiced on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on 1:OP:#Free_Women:{
.write -ds $+ $opnick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen being opped on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
.write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen opping $opnick on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on >=1:DEOP:#Free_Women:{
.write -ds $+ $opnick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen being de-opped on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
.write -ds $+ $nick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen de-opping $opnick on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on 1:SERVEROP:#Free_Women:{
.write -ds $+ $opnick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen being opped by the server on $chan at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}
on 1:CTCPREPLY:{
.write -ds $+ $opnick $mircdirlogs\seen.txt
.write $mircdirlogs\seen.txt $nick was last seen doing a $1 on me at $atime $adate saying $parms (Subtract 1 hour for EST, 2 hours for Central, 3 hours for Mountain, 4 hours for Pacific)
}


~~~

I'm a Scripting Newbie, please forgive my questions, and have patience with me. Thanks!
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
For starters, there's no $parms, so you can't use that (use $1- instead).
Then, scripts like these are what hashtables are ideally suited for.
Also, you're storing info based on a nick. Since many people tend to change nicks from time to time, I'd suggest storing info based on type 3 masks.
Last: I really do suggest you download a seen script that actually works and study the code. There's no better way to learn than that way.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius

Link Copied to Clipboard