mIRC Homepage
Posted By: slowpace socket script for a bot - 29/12/12 02:08 PM
Hi, can some help me make a script for my bot to pull info from a website to channel on cmd.

heres the page ide like the bot to post info from http://muse.erpk.org/unit/2162

what i would like it to do is something like this

!summary
bot > summary for Tank Nation
bot> || Member 9 || Avg. strength - 9 241 ||Avg. experience - 47 457 || Average rank - World Class Force** || Damage today - 1 227 850 || Damage yesterday - 16 602 420 ||

If any 1 can help that would be great smile
Posted By: slowpace Re: socket script for a bot - 29/12/12 08:04 PM
I made a start but its returning anything,

on $*:text:/^!summary$/iS:#: {
if ($sock(summary)) sockclose summary
sockopen summary muse.erpk.org 80
sockmark summary msg #
msg # Tank Nation - http://muse.erpk.org/unit/2162
}
on *:sockopen:summary: {
sockwrite -nt summary GET /unit/2162 HTTP/1.1
sockwrite -nt summary Host: $+($sock(summary).addr,$str($crlf,2))
}
on *:sockread:summary: {
var %summary | sockread %summary
if ($regex(%summary,/\<div class="well bottom">9 253"<\/div>/)) {
$sock(summary).mark $remove($regml(1), )
sockclose summary
}
}
Posted By: slowpace Re: socket script for a bot - 31/12/12 07:48 PM
Never mind, got a workin code now!
Posted By: Maelish Re: socket script for a bot - 07/01/13 11:08 PM
Originally Posted By: slowpace
Never mind, got a workin code now!


Can you show us how you did it?
© mIRC Discussion Forums