mIRC Home    About    Download    Register    News    Help

Print Thread
#253449 15/06/15 04:11 AM
Joined: Jun 2015
Posts: 2
U
ulea Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
U
Joined: Jun 2015
Posts: 2
good afternoon I'm trying to make a bot command and make the news News randomly from a website that would be the web of this page http://www.powerfriends.es take some things such /news.php containing news and bot you can access them by giving a brief explanation of the news
example:

!News
the bot reply
@BotX: .:News Random:. Tommy Ramone dies, the last member of the Ramones... link to continue reading http://www.powerfriends.es/news.php?readmore=1

I would appreciate your help in advance a hug


Code:
ON *:TEXT:!PFWeb:#: {   sockopen PFWeb www.powerfriends.es 80 }
ON *:SOCKOPEN:PFWeb: {
  if ($sockerr > 0) { $iif(%ichan,msg %ichan,echo -a) [4Error]: Connection problem. | sockclose $sockname | return }
  sockwrite -n $sockname GET /inicio.php HTTP/1.1
  sockwrite -n $sockname Host: www.powerfriends.es
  sockwrite -n $sockname User-Agent: */* 
  sockwrite -n $sockname Connection: Close
  sockwrite -n $sockname $crlf
}
ON *:SOCKp-f:PFWeb: {
  if ($sockerr > 0) { $iif(%ichan,msg %ichan,echo -a) [4Error]: Connection problem. | sockclose $sockname | return }
  var %p-f
  sockp-f %p-f
  if (*news.php?readmore=* iswm %p-f) { set -e %news $gettok($remove(%p-f,<br),9,32) }
}
ON *:SOCKCLOSE:PFWeb: {
  $iif(%ichan,msg %ichan,echo -a) [ $+ $iif(%inick,$v1,WARNING) $+ ] PowerFriends: Nuevos Miembros  %news $+ 
  unset %insane_*
}


not found

Last edited by ulea; 15/06/15 04:14 AM.
ulea #253451 15/06/15 04:52 AM
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Not sure if you need to use /sockclose in $sockerr, and you changed all READ to p-f in your script.
Code:
ON *:SOCKp-f:PFWeb: {


Dont give a fish - teach to fish!
ulea #253452 15/06/15 08:25 AM
Joined: Jun 2015
Posts: 2
U
ulea Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
U
Joined: Jun 2015
Posts: 2
yes edit for socket not found smirk ON *:SOCKp-f:PFWeb: {
ON *:SOCKREAD:PFWEB: {
is not found code.


Link Copied to Clipboard