mIRC Home    About    Download    Register    News    Help

Print Thread
Question about how to write a fairly simple script #214251 26/07/09 06:34 PM
Joined: Jul 2009
Posts: 2
F
FredJohnson Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
F
Joined: Jul 2009
Posts: 2
Hey, I'm new here and don't know much at all about scripting. Basically I'm looking to make a bot that idles in a channel, and at random intervals will say a random quote (picked from a list of maybe 100 or so quotes). How do I go about doing this?

Re: Question about how to write a fairly simple script [Re: FredJohnson] #214253 26/07/09 06:53 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Put the following in your remotes (Alt+R)

Code:
alias quotes {
  msg #mychannel $read(quotes.txt)
  .timer 1 $rand(60,360) quotes
}


Every 60-360 seconds it reads from quotes.txt (create the file in your $mircdir) and msgs it to #mychannel

Type /quotes to start it.

* edit: renamed to /quotes

Last edited by argv0; 26/07/09 09:05 PM.

- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Question about how to write a fairly simple script [Re: argv0] #214254 26/07/09 07:14 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
Just a little note since "quote" is already a mIRC command, could be a good idea to change your alias to "quotes"


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Question about how to write a fairly simple script [Re: Wims] #214256 26/07/09 08:07 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Please provide the source for your statement of
Quote:
"quote" is already a mIRC command
since I am unable to find the command in any of my reference material.

Could you be confusing quote with $qt(), which puts quotes around text so that it includes spaces, namely in file and directory names?

Re: Question about how to write a fairly simple script [Re: RusselB] #214259 26/07/09 08:46 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
I don't have any source, just my knowledge.
It's not because you don't know the command/don't have it referenced somewhere that it doesn't exists, especially in mIRC.
A simple /quote in mirc or /quote bla would provide you a proof.
You might want to try /help /raw as well smile

Edit : and of course I'm not confusing with $qt

Last edited by Wims; 26/07/09 08:46 PM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Question about how to write a fairly simple script [Re: Wims] #214261 26/07/09 09:05 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You're right.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Question about how to write a fairly simple script [Re: RusselB] #214270 27/07/09 02:32 PM
Joined: Mar 2007
Posts: 218
V
vexed2 Offline
Fjord artisan
Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
/quote sends commands directly to the server i think.

Re: Question about how to write a fairly simple script [Re: vexed2] #214282 27/07/09 11:27 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It appears to do so, like /raw

I have appended my resource materials to include this command.

Re: Question about how to write a fairly simple script [Re: vexed2] #214326 28/07/09 11:26 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Originally Posted By: vexed2
/quote sends commands directly to the server i think.


No, QUOTES Unknown command

Re: Question about how to write a fairly simple script [Re: westor] #214328 28/07/09 11:52 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The command being referenced is /quote not /quotes
Note the s on the end of the command that gave you the error message.

Re: Question about how to write a fairly simple script [Re: RusselB] #214338 29/07/09 04:16 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Yes but the argv[0] gives that code with s

check here

Re: Question about how to write a fairly simple script [Re: westor] #214342 29/07/09 04:59 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
You're missing something.
argv0 named is alias 'quote' and since /quote is a mirc command, I've told him it could be nice to change it to 'quotes'.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Question about how to write a fairly simple script [Re: Wims] #214346 29/07/09 08:38 PM
Joined: Mar 2007
Posts: 218
V
vexed2 Offline
Fjord artisan
Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
At least you understand lol

Last edited by vexed2; 29/07/09 08:39 PM.
Re: Question about how to write a fairly simple script [Re: vexed2] #214347 29/07/09 09:31 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
At least ? Do you mean I have another problem ?


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Question about how to write a fairly simple sc [Re: argv0] #214365 30/07/09 11:09 PM
Joined: Jul 2009
Posts: 2
F
FredJohnson Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
F
Joined: Jul 2009
Posts: 2
Testing it out, it doesn't seem to work. I get the message * /msg: insufficient parameters (line 2, remote.ini) when I try to activate it. I have my quotes.txt file saved in C:\Program Files\mIRC. Is that the right spot, or no?

Re: Question about how to write a fairly simple sc [Re: FredJohnson] #214366 30/07/09 11:25 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You can include the exact location of the file, in this case replace quotes.txt in the script with "C:\Program Files\mIRC\quotes.txt"

Note: The "" around the directory and filename are required, due to the space in the directory name Program Files

Another alternative is to place the file in the location returned from the command //echo -a $mircdir