mIRC Home    About    Download    Register    News    Help

Print Thread
#61361 21/11/03 10:52 PM
Y
yuveth
yuveth
Y
hi ok see if i can explain this correctly.
I have a message center in my room. People can leave messages ect. the msg write to a txt file. Everytime a person reads the messages .. the txt file will copy their nick and the time and date that message was read.
Can i script into the remote that if the same person is reading the same message.. to NOT re-write their names down .
This is my script .

On 30:Text:*!opread*:#Roomname: {
//play $nick D:\bot\opnote.txt
/msg $nick 5Welcome to the Ops message center. Please check regularly. Type !opnote <message> to add your message.
/write -as $1 opnote.txt 12********** $nick has viewed all above *********** $fulldate

}
On 1:Text:*!opread*:#RoomName:/msg $nick 6 shakes her head ...12 You do not have permission to access this board
On 30:Text:*!opnote*:?: {
blushpnote {
/write -il 1 opnote.txt From: $nick $2- $fulldate
/msg $nick 5 your message has been saved .. thank you and remember to check back periodically to keep caught up!
halt
}


any help would sure be appreiciated

#61362 22/11/03 09:08 AM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
You would have to do a search of the text file. If the file becomes large, this will take a lot of time and start playing havoc on your mirc. If you want to incorporate that, you need to start looking for alternative ways to store. In this case, a window might be easiest. Or a hashtable. In either case, a textfile is still possible provided you change the way the information is stored. I'd start off every line written to it with a word consisting of nick and ctime >> $+($nick,$ctime) << to make for easy searching. The way you store stuff now is gonna make that extremely tedious and time consuming, especially if ythe file gets bigger.

You could make something similar for text files

#61363 22/11/03 06:25 PM
T
TomM
TomM
T
Code:
on 30:TEXT:!opread*:*:{
//play $nick D:\opnick\opnick.txt
/msg $nick To leave a new message for yourself, type !opnick &lt;message&gt;
}
on 1:TEXT:!op*:*:{
/msg $nick Sorry, you do not have any access to this command.
}
on 30:TEXT:!opnick*:*:{
if ($read(D:\opnick\opnick.txt,s,$2-) == $2-) /msg $nick Your message has already been recorded.
else {
//write D:\opnick\opnick.txt $nick $+ ) $2-
/msg $nick Message recorded.
}
}

#61364 01/12/03 11:19 PM
Y
yuveth
yuveth
Y
Thank you !!!!!!!


Link Copied to Clipboard