acpixel

acpixel

Joined
Aug 25, 2015

Activity Stream

acpixel created a Page  -  Feb 13, 2016
1 284 

So the very first script i ever made was basically a in chat port of livesplit. It was horribly done and hard coded with a max of 10 splits. A friend was asking me about it today and i was like, "i should recode it with my new knowledge and make it way better!". so I did. It is a free bot twitch.tv/twitchsplit you will be able to !join to have it join soonish. but out of the kindness of my heart, i..

 Respond   mIRC  
acpixel commented on a Page, JSON for MIRC  -  Aug 25, 2015

yo so i need a bit of help. so i need to get the value of time and player under each category.

the command would be !wr sm64 120_star. then the script would go to http://www.speedrun.com/api_records.php?game=sm64
then it would parse and find the values for player and time under the category 120 star. but because the game constantly changes i need to be able to read the first value and basely skip over it. but i want the end response to be "the world record for Super Mario 64 is (time) by (player)" but speedrun.com allows for abbreviations such as sm64, but i want the response to have the whole name. and the json does contain the whole name. so in the end i need to get the first value then parse to the time and player and output all 3.

here is my code so far.

on *:TEXT:!wr *:#: { 
  if (!%comwr) {
    set -u1 %comwr 1
    JSONOpen -u wr http://www.speedrun.com/api_records.php?game= $+ $replace($2 , _, $chr(32))
    msg $chan http://www.speedrun.com/api_records.php?game= $+ $replace($2 , _, $chr(32))
    msg $chan test $json(wr, (help needed), $replace($3 , _, $chr(32)))
    JSONClose wr
    else {
      msg $chan Sorry $nick $+ , no one is playing $2-
      JSONClose stream
    }
  }
  else {
    msg $chan Sorry $nick this command is on cooldown.
  }
}
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.