mIRC Home    About    Download    Register    News    Help

Print Thread
#159850 20/09/06 04:57 PM
Joined: Apr 2006
Posts: 43
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Apr 2006
Posts: 43
Well. Im trying to read a txt file. I get the part on how to make it read only. I want it to read line by line. I have another script that sends info to this file. Then I want my bot to read it and msg back.


Code:
 ssaow_ $+ $date(m-d-yyyy) $+ .txt 

#159851 20/09/06 05:04 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
var %handle = file $+ $ticks, %data
.fopen %handle $qt($+(ssaow_,$date(m-d-yyyy),.txt))
if ($fopen(%handle)) {
  while (!$fopen(%handle).eof) {
    %data = $fread(%handle)
    ; Do whatever you like with %data
  }
  .fclose %handle
}

#159852 20/09/06 05:12 PM
Joined: Apr 2006
Posts: 43
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Apr 2006
Posts: 43
It seems to do nothing. I put it into my remote and nothing happened

#159853 20/09/06 05:13 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You have to put it somewhere, like in an alias or event. It doesn't go on its own.

You also have to change the ;comment to a command.

#159854 20/09/06 05:16 PM
Joined: Apr 2006
Posts: 43
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Apr 2006
Posts: 43
Quote:
It seems to do nothing. I put it into my remote and nothing happened


I just put it into alias.
This script looks a bit big for what it does.
All i need it to do is message line by line from thatt file.

#159855 20/09/06 05:19 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
I missed the "msg" part. You can use the /play command. /help /play


Link Copied to Clipboard