What I want to do is to get rid of Nightbot as it isn't fast enough due to certain limitations it has.

So... I have a mini-game in a channel I admin, a PvP mini-game. You'd input "!pvp b" and then retrieve what's in http://agussdg.ga/verificar.php?user1=a&user2=b where "a" is the user who triggered the command and "b" is the target user.

(NOTE: it won't work at this moment if it's not from Nightbot's IP)

I have problems retrieving the text it generates and I don't know if I'm doing it right. Here's the script I got at this moment:

Code:
on 1:text:!pvp*:#: {
  var %sock = pvp
  sockopen %sock agussdg.ga 80
  sockread %sock
}

on 1:sockopen:pvp*: {
  sockwrite -n $sockname GET /verificar.php?user1= $+ $nick $+ &user2= $+ $2 HTTP/1.1
  sockwrite -n $sockname Host: www.agussdg.ga
  sockwrite -n $sockname $crlf
}

on 1:sockread:pvp*: {
  var %t
  sockread %t
  while ($sockbr) {
    echo %t
    sockread %t
  }
  sockclose $sockname
}

Last edited by AntuV; 09/06/15 03:36 AM.