mIRC Home    About    Download    Register    News    Help

Print Thread
#208113 13/01/09 05:56 PM
Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
I am planning on making a script, that will record what everyone says, and write it all to a txt file...
I know I wouldn't like it if I said something I didn't like, for it to come back to bite me another time... so, I am wondering if it is possible to delete everything in a file...

if the file was: $nick $+ $network $+ randomentmsg.txt (seanturner70#seanturner70randomentmsg.txt)... and when the person types !clear entlogs then all the text is deleted.

Joined: Jul 2006
Posts: 4,183
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,183
You can remove a file with /remove and clear it's contents with /write -c.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
ok...
I currently have:
Code:
on 1:join:#: {
  if ($me == no-nick) && ($read( $nick $+ $chan $+ rndmsg.txt )} {
    goto $rand(1,2)
    :1 | msg $chan Hey $nick $+ ! Remember the time you said: " $+ $read( $nick $+ $chan $+ rndmsg.txt ) $+ "? | return
    :2 | msg $chan $nick $+ , Just remember, that things come back to haunt you... I even remember the time you said: " $+ $read( $nick $+ $chan $+ rndmsg.txt ) $+ " | return
  }
}


(I am planning on making more... just starting it.)

However, when someone joins... it says:
Quote:
* /if: invalid format (line 7, rnd msg on join)


How can I make it so, if the file exists, to carry on?

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Nothing is wrong, except you have a } at the end of your if-statement that is supposed to be a ).

rndmsg.txt )} {
needs to be
rndmsg.txt )) {

Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
oh! oops


Link Copied to Clipboard