Originally Posted By: OrFeAsGr
Hey.. i didn't reloaded to see that westor replied so i made this script which echos all the items and values. SReject's must work better but here's mine too..
Code:
ON *:SOCKOPEN:maxima: { if ($sockerr) { echo -at Error while retrieving maxima info... | sockclose $sockname } | sockwrite -nt $sockname GET /apiCitizenByName.html?name=dazzler HTTP/1.1 | sockwrite -nt $sockname Connection: close | sockwrite -nt $sockname Host: maxima.e-sim.org | sockwrite $sockname $crlf }


ON *:SOCKREAD:maxima: {
  var %m | sockread -f %m 
  if ({"* iswm %M) {
    var %x = 2
    while (%x <= $numtok(%m,34)) {
      var %t = $gettok(%m,%x,34)
      var %t2 = $gettok(%m,$calc(%x + 1),34)
      var %t3 = $gettok(%m,$calc(%x + 2),34)
      if (%t2 == :) {
        var %item = %t
        var %value = $remove(%t3,:,$chr(44))
        echo -at %item > %value
        inc %x 4
      }
      elseif (%t2 != :) {
        var %item = %t
        var %value = $remove(%t2,:,$chr(44))
        echo -at %item > %value
        inc %x 2
      }
      ;;;You can place your if here
      ;;; example if (%item == eqCriticalHit) { echo -at %value } ;;;
    }
    sockclose $sockname
  }
}

Do
/sockopen maxima maxima.e-sim.org 80
to test it



Thanks but I already found a simple without opening socket smile