sockets problem - 06/04/05 10:08 AM
I am learning to write scripts in sockets.
With the help file I wrote a small script but it have some problems.
someone can see into it and please check whats wrong.
I am getting the following errors are
* /if: invalid format (line 17, script1.nns)
Line 17 is:
if (<td>Attack Specialist</td>
the script is as follows
on *:sockopen:mercs:{
sockwrite -n $sockname GET /mercs.php HTTP/1.1
sockwrite -n mercs User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.40607; .mIRC)
sockwrite -n $sockname Host: kingsofchaos.com $+ $crlf $+ $crlf
}
on *:sockread:mercs:{
if ($sockerr) {
echo -a Error.
halt
}
else {
var %temptext
sockread %temptext
if (<td>Attack Specialist</td>
<td align="right">4,500 Gold</td>
<td align="right">*</td> iswm %temptext) || (<td>Defense Specialist</td>
<td align="right">4,500 Gold</td>
<td align="right">*</td> iswm %temptext) || (<td>Untrained</td>
<td align="right">3,500 Gold</td>
<td align="right">*</td> iswm %temptext) {
echo -a -
/echo -s $htmlfree(%temptext)
}
}
}
With the help file I wrote a small script but it have some problems.
someone can see into it and please check whats wrong.
I am getting the following errors are
* /if: invalid format (line 17, script1.nns)
Line 17 is:
if (<td>Attack Specialist</td>
the script is as follows
on *:sockopen:mercs:{
sockwrite -n $sockname GET /mercs.php HTTP/1.1
sockwrite -n mercs User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.40607; .mIRC)
sockwrite -n $sockname Host: kingsofchaos.com $+ $crlf $+ $crlf
}
on *:sockread:mercs:{
if ($sockerr) {
echo -a Error.
halt
}
else {
var %temptext
sockread %temptext
if (<td>Attack Specialist</td>
<td align="right">4,500 Gold</td>
<td align="right">*</td> iswm %temptext) || (<td>Defense Specialist</td>
<td align="right">4,500 Gold</td>
<td align="right">*</td> iswm %temptext) || (<td>Untrained</td>
<td align="right">3,500 Gold</td>
<td align="right">*</td> iswm %temptext) {
echo -a -
/echo -s $htmlfree(%temptext)
}
}
}