mIRC Home    About    Download    Register    News    Help

Print Thread
#101856 30/10/04 01:07 AM
Joined: Sep 2004
Posts: 200
I
IR_n00b Offline OP
Fjord artisan
OP Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
is there any way to make my bot search for stuff onlie on the site
123spill.no
so if someone says !gameseartch <gamename>
it will seartch on 123spill.no
for the game?
and return the first 10 results, and the site has its own seartch grin.

#101857 01/11/04 09:01 PM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
Code:
[color:orange]on *:text:!Search*:#channel: {
if ($2) {[/color]
[color:blue];if theres a game set a variable
;with space as a + for later in the script[/color]
[color:orange]set %game = $replace($2-,$chr(32),+)[/color]
[color:blue];open socket with the site[/color]
[color:orange]sockopen 123spill 123spill.no 80[/color]
[color:blue];syntax = sockopen name site port[/color]
[color:orange]}
}
on *:sockopen:123spill: {
sockwrite -n $sockname GET $+(/cgi-bin/finn.cgi?s=,%game,&amp;x=0&amp;y=0) HTTP/1.1
sockwrite -n $sockname $+(123spill.no,$crlf,$crlf)[/color]
[color:blue];get to the page with the info we want[/color]
[color:orange]}
on *:sockread:123spill: {[/color]
[color:blue];when we get the info....[/color]
[color:orange]if ($sockerr) {[/color]
[color:blue];if theres an error stop[/color]
[color:orange]halt
}
else {[/color]
[color:blue];if all is good read line by line into a variable[/color]
[color:orange]var %i
sockread %i
if (&lt;table width="472" border="0" cellspacing="0" cellpadding="1" class="ramme"&gt;&lt;tr class="svart"&gt;&lt;td&gt;&lt;table width="100%" class="boks" border="0" cellspacing="1" cellpadding="3"&gt;&lt;tr&gt;&lt;td class="marg" rowspan="1"&gt;&amp;nbsp;&lt;/td&gt;&lt;td class="senter"&gt;&lt;h3&gt;&lt;a href=" isin %i) {[/color]
[color:blue];Match html to var the results[/color]   
[color:orange]var %link = $gettok(%i,30,34)[/color]
[color:blue];get the link using charecters between ""
;use a different method of storing the info for multiple 
;results. play around till u get what u want[/color]
[color:orange]msg #channel Found: %link
}
}
}[/color]

this might not work but just to show you what it should be like
sorry if i got some parts wrong :P

play around with matching the html in the variable
and varing the results and you should be ok

good luck
smile


Link Copied to Clipboard