mIRC Home    About    Download    Register    News    Help

Print Thread
#244954 06/04/14 05:57 PM
Joined: Dec 2010
Posts: 89
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
This is a fairly basic problem, but I have been stuck for ages and I literally have no idea why it's not working frown

I have this code

Code:
.timer16 1 5 writeini -n scriptdetails.ini %SCScriptName description $read(descriptionTemp.txt,n,1)


But it carries on giving an error
Quote:
* /writeini: insufficient parameters


It will basically read first line from descriptionTemp.txt and put it into the descriptions value in the ini file.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
The code isn't at fault here.
Make sure you have your variables set in advance, if it's not receiving the variable or the textfile, then it'll show insufficient parameters.

A long-shot error you may have is that the first line in your .txt file might be a number? - If the first line in a textfile is a number it will be treated as the number of lines the textfile has.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
[...] and you can use the 't' switch to prevent mIRC to treat that number as the total number of lines grin


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2010
Posts: 89
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
seems like it's not reading the file correctly. But I don't know why, it's there when I look manually shocked?

----------------------------------------------------
I have it working now, thanks guys! smile

I had to do the writeini in a seperate alias for some reason, no idea why laugh lol

Last edited by dominic_eddy; 07/04/14 08:41 AM.
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Is the first line in the textfile a number? If so, you need to add the T switch like Wims mentioned.
Another not so recommended fix is that you can read the first line in the text file if you read line 0 instead of line 1.

/help $read
Quote:
If the first line in the file is a number, it must represent the total number of lines in the file. If you specify N = 0, mIRC returns the value of the first line if it is a number.



If the t switch is specified then mIRC will treat the first line in the file as plain text, even if it is a number.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard