mIRC Home    About    Download    Register    News    Help

Print Thread
#238057 27/06/12 04:02 AM
Joined: Apr 2012
Posts: 16
M
medoit Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Apr 2012
Posts: 16
is there a command to make the bot read an entire text file from top to bottom?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Depends what you want to do with it. Some options include /play, $read, $fread, /loadbuf, /filter. Take a look in the help file for each of them and you should have a good idea of what you need for whatever you're doing as well as the syntax to use it.


Invision Support
#Invision on irc.irchighway.net
Joined: Apr 2012
Posts: 16
M
medoit Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Apr 2012
Posts: 16
i want it to read a .txt file and relay it to the channel. /play worked great if i manually type it into the box, but when i make a command in remote tab i get "cannot play in this window" error

Code:
on *:TEXT:!howto:#trommoc: { play moccomands.txt }



Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Currently you're telling it to /play to whatever window is active at the time. You need to tell it to /play to the channel from which the incoming text came.

Code:
on *:TEXT:!howto:#trommoc: { play # moccomands.txt }


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You might want to add a check using $play() to prevent it from being abused, such as text scrolling or flooding:
Code:
on *:TEXT:!howto:#trommoc: { 
  if (!$play(#)) {
    .play # moccomands.txt 
  }
}
This way the code can only be triggered one channel per person at a time until it's finished...so you don't have the client running the code to play the text file over and over due to abuse.

Joined: Apr 2012
Posts: 16
M
medoit Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Apr 2012
Posts: 16
now im getting this error
* /play: unable to open 'C:\Documents and Settings\Marc DeWitt\Desktop\mIRC\moccomands.txt' (line 419, remote.ini)

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Does the moccomands.txt exist in mIRC directory? That error tells mIRC that it cannot find the text file to play. double check the spelling to make sure you haven't misspelled the file name.

Last edited by Tomao; 28/06/12 04:53 AM.
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Maybe just missing quotas? $qt(path to text here) ?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
It's not a quotes problem. The error shows that the entire path and filename is being looked at. The file just isn't there.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard