mIRC Home    About    Download    Register    News    Help

Print Thread
More Sockets :| #90045 11/07/04 01:35 PM
Joined: Jun 2004
Posts: 8
D
Dominicz Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jun 2004
Posts: 8
Well I'm using a script at the moment to get someone's level in different skills off a Hisore page for a game...This is it so far..

Code:
  On *:text:-stats *:#:{
  if $network == Gamesurge { stat $2 # }
}

alias stat {
  ;
  ; Usage: /stat <character> [nick|#chan]
  ;
  if !$1 || $sock(stat) { return }
  set %RS.statname $1
  ;
  ; %RS.output holds the command through which the information will be returned
  ; if no [nick|#chan] value is specified, the info will be displayed locally (echo)
  ;
  set %RS.output $iif($2,notice $nick,echo 5 -agt *)
  set %RS.collect Overall Attack Defence Strength Hitpoints Ranged Prayer Magic Cooking Woodcutting Firemaking Mining Smithing Fishing Crafting Thieving Fletching Herblore Runecrafting Agility
  %RS.output Collecting stats for %RS.statname $+ ...
  sockopen stat hiscore.runescape.com 80
}

alias -l nohtml var %a | !.echo -q $regsub($1-,/^.*?>|<.*?>|<.*?$/g,,%a) | return %a

On *:sockopen:stat:{
  if $sockerr {
    %RS.output Error contacting website.
    unset %RS.*
    return
  }
  var %a = sockwrite -tn stat
  %a GET /aff/runescape/hiscorepersonal.cgi?username= $+ %RS.statname HTTP/1.0
  %a Host: hiscore.runescape.com
  %a Connection: close
  %a
}

On *:sockread:stat:{
  var %a
  ;
  ; read a CRLF-terminated line into a local variable
  ;
  sockread %a
  while $sockbr {
    ;
    ; first we filter possible attribute lines
    ;
    if <td>*</a></td> iswm %a {
      var %attrib = $nohtml(%a)
      ;
      ; do we want this attribute?
      ;
      if $istok(%RS.collect,%attrib,32) {
        ;
        ; if so, append it to the final information line...
        ;
        set %RS.info %RS.info 12 $+ %attrib
        set %RS.lookForValue 1
      }
    }
    ;
    ; commas are not recognized by the isnum operator
    ; therefore we remove them before validating a numeric value
    ;
    elseif %RS.lookForValue && $remove(%a,$chr(44)) isnum {
      set %RS.info %RS.info =04 %a
      unset %RS.lookForValue
    }
    sockread %a 
  }
}

On *:sockclose:stat:{
  if %RS.info {
    %RS.output Stats for %RS.statname $+ :
    %RS.output %RS.info 
  }
  else {
    notice $nick %RS.output [ZF-Bot] is collecting stats for %RS.statname
  }
  unset %RS.*
}


This,however, only gets their level and i've been trying for a very long time to make it get their Rank and EXP. I've changed everything and my friends have also been trying..

I was wondering if anyone could help me

Many thanks,

Re: More Sockets :| #90046 11/07/04 06:02 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
http://members.lycos.co.uk/onln/files/runescape_all_stat.txt

The old script, which collects level information only, is still available here:
http://members.lycos.co.uk/onln/files/runescape_stat.txt

Re: More Sockets :| #90047 11/07/04 09:05 PM
Joined: Jun 2004
Posts: 8
D
Dominicz Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jun 2004
Posts: 8
Thanks.. except It spams it on different lines.. anyway to make it say everything in one Notice to the user?

Ty,

Re: More Sockets :| #90048 11/07/04 09:13 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
It would be really messy this way. Can you give an example of how the notice should look like?