mIRC Homepage
Posted By: dah Working !uptime command for mIRC (Twitch Bot) - 26/02/20 01:09 AM
Hello, there guys, I've been searching around the forums on the internet and some !uptime commands they don't seem to work or just outdated. I'm looking for a working !uptime command that shows how long I have or/ the person has been following the stream for? The code I've got now when I type "!uptime" it says "username is not online" I was wondering if you could find the working code it will show in the chat when you type !uptime it will say the correct time as it shows for the StreamElements bot. Basically when you type !uptime the StreamElements it displays the time even though if the streamer is online or offline. The code I'm using now;

Quote
ON *:TEXT:!uptime*:#tehrani: {
VAR %stream $IIF($2,$2,$remove(#,$chr(35)))
jsonopen -ud uptime https://api.twitch.tv/kraken/streams/ $+ %stream
IF ($JSONError) MSG $chan Error.
ELSEIF ($regex($JSON(uptime, stream, created_at), /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/)) MSG $chan %stream has been streaming for $duration($calc($ctime - ($ctime($gettok(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec, $regml(2), 32) $regml(3) $regml(1) $regml(4) $+ : $+ $regml(5) $+ : $+ $regml(6)) - 18000)),2) $+ .
ELSE MSG $chan %stream is not online. LuvOops
}
Can you include a debug message to show the string output by: $JSON(uptime, stream, created_at)
so we can see if the string is different than expected by the regex.
also, please use CODE not QUOTE to include the script code.
Please run the following command and report back what it says:
Code
//echo -a $JSONVersion
I'm having trouble at the moment in the "twitch/tv.9nty" tab it's making noises that an application is corrupted or something?
I typed "//echo -a $JSONVersion" and it said this..
[Linked Image from i.imgur.com]

The issue is now fixed now I had to uninstall the program and install and start from fresh.
When I type the !uptime script command in the chat it shows this.
[Linked Image from i.imgur.com]
Originally Posted by FroggieDaFrog
Please run the following command and report back what it says:
Code
//echo -a $JSONVersion


[Linked Image from i.imgur.com]
© mIRC Discussion Forums