Free2Code
 
Time: 2008-11-21, 10:03pm
$read problem
Subject: $read problem  ·  Posted: 2006-11-22, 10:11am
Rank: ? (1)
Member #: 29171
I've made this trying to get it to read just one line of the document, randomly, like it is supposed to.
Now every time I have someone test it, it might work once or twice, then I begin to get this message in my status: * /msg: insufficient parameters

The code I'm using looks like this:

><-----------
Code:
  1. on *:TEXT:!quote:#: {
  2. /msg $chan $read(quote.txt)
  3. }

><-----------

 
  Reply to this ·  Post link ·  Top
Subject: Re: $read problem  ·  Posted: 2006-12-07, 01:08am
Rank: ? (48)
Member #: 20714
either the file doesnt exists, or it does but since $read reads randomly a line in the file, maybe it read a line without text

on *:TEXT:!quote:#:{
var %text = $read(quote.txt)
if (%text == $null) { msg $chan i did not find a quote! }
else { msg $chan %text }
}

or you could use your way, but instead of just 'msg $chan $read(quote.txt)' use 'msg $chan Quote: $read(quote.txt)' ...

Behold the power of cheese!
 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons