Nice.

Now you need to either use a json parser, or parse in a crude way manually with either $mid/$gettok stuff or with regex

You can find a json parser for mIRC here https://github.com/SReject/JSON-For-Mirc but you need to be familiar with the json format to use it, this will guarantee correct data all the time.
As far as making assumptions, regex can be terribly good when you know them:

//var %string {"id":215,"url":"https://www.tvmaze.com/shows/215/american-dad","name":"American Dad!","type":"Animation","language":"English","genres":["Comedy","Family"],"status":"Running","runtime":30,"averageRuntime":30,"premiered":"2005-02-06","ended":null,"officialSite":"http://www.tbs.com/shows/american-dad.html","schedule":{"time":"22:00","days":["Monday"]},"rating":{"average":7.4},"weight":98,"network":{"id":32,"name":"TBS","country":{"name":"United States","code":"US","timezone":"America/New_York"},"officialSite":"https://www.tbs.com/"},"webChannel":null,"dvdCountry":{"name":"United States","code":"US","timezone":"America/New_York"},"externals":{"tvrage":2594,"thetvdb":73141,"imdb":"tt0397306"},"image":{"medium":"https://static.tvmaze.com/uploads/images/medium_portrait/476/1191222.jpg","original":"https://static.tvmaze.com/uploads/images/original_untouched/476/1191222.jpg"},"summary":"<p>In <b>American Dad!</b>, Stan Smith leads the all-American family in this animated sitcom filled with wild and crazy extremes. Everyday life is taken to the limit as Stan applies the same drastic measures used in his job at the CIA to his home life. Driven by machismo and the American dream, he often is blind to how horribly he fails at his attempts. This father might not know best, but he never stops trying.</p>","updated":1705592851,"_links":{"self":{"href":"https://api.tvmaze.com/shows/215"},"previousepisode":{"href":"https://api.tvmaze.com/episodes/2674312"}}},%p {"id":(\d+),"url":"([^"]+)","name":"([^"]+)","type":"([^"]+)","language":"([^"]+)","genres":\[([^\]]+)\],"status":"([^"]+)","runtime":(\d+),"averageRuntime":(\d+),"premiered":"([^"]+)","ended"([^,]+),"officialSite":"([^"]+)","schedule":{([^}]+)},"rating":{([^}]+)},"weight":(\d+),"network":{"id":(\d+),"name":"([^"]+)","country":{"name":"([^"]+)","code":"([^"]+)" | noop $regex(%string,%p) | echo -sg Name: $regml(3) $(|) Type: $regml(4) $(|) Language: $regml(5) $(|) Genres: $regml(6) $(|) Status: $regml(7) $(|) Url: $regml(2) | echo -sg Network: $regml(17) $(|) Country: $regml(18) $regml(19)You can execute that in mIRC's status window But note that if the json changes, the regex could fail as it matches quite precisely.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel