Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----CONFIG-----
- streamer = "choobtastic" --This variable is REQUIRED!
- --streamer2 = "wolftaz" --Uncomment this line to add a second streamer! Requires a 2 high monitor!
- -----CONFIG-----
- -----MAIN CODE! DO NOT EDIT!-----
- --Checking for my twitch api
- if fs.exists("twitchapi") == false then
- shell.run("pastebin get vh4Jd1B6 twitchapi")
- end
- --Loading my twitch api
- os.loadAPI("twitchapi")
- --Is there a monitor?
- if peripheral.find("monitor") then
- mon = peripheral.find("monitor")
- monitor = true
- end
- --Is there a second streamer specified? If so, is the monitor large enough to support it?
- if streamer2 then
- if monitor then
- x, y = mon.getSize()
- if y > 5 then
- --Good to go!
- else
- error("You need a two tall monitor to allow two streamers!")
- end
- end
- end
- --Main loop. Does all the visible stuff!
- while true do
- if monitor then --Do we have a monitor?
- if twitchapi.checkLive(streamer) then --Is the main streamer live?
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("LATEST FOLLOWER: "..twitchapi.lastFollower(streamer))
- mon.setCursorPos(1,2)
- mon.write("FOLLOWER COUNT: "..twitchapi.followerCount(streamer))
- mon.setCursorPos(1,3)
- mon.write("LIVE VIEWERS: "..twitchapi.viewerCount(streamer))
- else --The main streamer isn't live.
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write(streamer.." is not live!")
- mon.setCursorPos(1,2)
- mon.write("Written by Kd8lvt for his streamer friends in the Minecraft Twitch Community!")
- mon.setCursorPos(1,3)
- mon.write("-----------------")
- end
- if streamer2 then --Is the secondary streamer specified?
- mon.setCursorPos(1,5)
- mon.write("-----------------")
- if twitchapi.checkLive(streamer2) then --Is the secondary streamer live?
- term.setCursorPos(1,6)
- term.write("LATEST FOLLOWER: "..twitchapi.lastFollower(streamer2))
- term.setCursorPos(1,7)
- term.write("FOLLOWER COUNT: "..twitchapi.followerCount(streamer2))
- term.setCursorPos(1,8)
- term.write("LIVE VIEWERS: "..twitchapi.viewerCount(streamer2))
- else --The secondary streamer isn't live.
- if twitchapi.checkLive(streamer) then
- term.setCursorPos(1,6)
- term.write(streamer2.." is not live!")
- else
- term.setCursorPos(1,4)
- term.write(streamer2.." is not live!")
- end
- end --For some reason all this code got derped up when I put it on pastebin... just looks messy. Still works!
- else
- mon.setCursorPos(1,5)
- mon.write("Written by Kd8lvt for his streamer friends in the Minecraft Twitch community!")
- end
- end
- if monitor == null then --There isn't a monitor!
- if twitchapi.checkLive(streamer) then --Is the main streamer live?
- shell.run("clear")
- print("LATEST FOLLOWER: "..twitchapi.lastFollower(streamer))
- print("FOLLOWER COUNT: "..twitchapi.followerCount(streamer))
- print("LIVE VIEWERS: "..twitchapi.viewerCount(streamer))
- else
- shell.run("clear")
- print(streamer.." is not live!")
- print("Written by Kd8lvt for his streamer friends in the Minecraft Twitch community!")
- end
- if streamer2 then --Is the secondary streamer specified?
- print("-----------------")
- if twitchapi.checkLive(streamer2) then --Is the secondary streamer live?
- print("LATEST FOLLOWER: "..twitchapi.lastFollower(streamer2))
- print("FOLLOWER COUNT: "..twitchapi.followerCount(streamer2))
- print("LIVE VIEWERS: "..twitchapi.viewerCount(streamer2))
- else --Thye secondary streamer isn't live... :(
- print(streamer2.." is not live!")
- end
- else --There is no secondary streamer specified!
- print("Written by Kd8lvt for his streamer friends in the Minecraft Twitch community!")
- end
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement