mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 15
Pikka bird
OP Offline
Pikka bird
Joined: Dec 2002
Posts: 15
I'm using Sockets to retrieve info from a web dite. I use the following script to diplay the data on my status window:

on *:sockread:getfile: {
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
if (%temp) {
echo -a %temp
}
goto nextread
}

but I keep getting this error: * /echo: line too long (line 102, script4.ini)

can anybody give me a hand to solve this please?

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
What does %temp hold? My guess is that %temp is too long to echo


Those who fail history are doomed to repeat it
Joined: Dec 2002
Posts: 15
Pikka bird
OP Offline
Pikka bird
Joined: Dec 2002
Posts: 15
/me nodnods

exactly, so, how can I echo it?

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
If the var is too long, you cant. Shorten the variable or break it up OR use another method for data storage


Those who fail history are doomed to repeat it
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
var %var
sockread %var
echo -a * $mid(%var,1,900)
if $mid(%var,901) { echo -a * $ifmatch }

-or-

sockread 900 &var
echo -a * $bvar(&var,1-).text

(&var is a binary variable - see /help /sockread and /help binary files)


Link Copied to Clipboard