This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
funniray10's profile picture

Beam stat/chat veiwer

Started by funniray10, 15 February 2016 - 05:26 PM
funniray10 #1
Posted 15 February 2016 - 06:26 PM
The program has now been updated!
Changelog:
  • –=========–
  • –Changelog–
  • –=========–
  • –Version 2.0.0
  • –1. Made a changelog that wasn't took from kd8lvt
  • –2. Added colors to chat
  • –3. Added a ton of funtion
  • –4. Added textwrap to chat
  • –5. Added very bad code
  • –6. Links show properly
  • –===============–
  • –Planed Features–
  • –===============–
  • –1. Multi-Monitor support
  • –==========–
  • –Knowen Bug–
  • –==========–
  • –1. Last follower is just a random follower
note: you cannot type to beam chat

pastebin get wbzRH1ny startup
you need to edit the variable streamer to the streamer's name, also the newest chat messages are at the top
Screenshot:
Screenshot:
Please share this with your streamer friends and help it get known. it took me a long time to make for all of you. if you do find a bug that's not in the known bugs section please reply to this forum telling me what the bug is and a screenshot in a spoiler
Edited on 21 March 2016 - 12:36 AM
NilLogic #2
Posted 16 February 2016 - 06:06 AM
Cool program! While it could be improved with small tweaks and perhaps some visual adjustments it functions great!
Monitor detection

  mon = peripheral.find(monitor)
  if not mon then
	error("Connected a monitor")
  end
  
This will give a more useful error if someone forgets to attach a monitor.

Useless variable

	monitor = peripheral.wrap("top")
  
This line is not needed whatsoever.

Repeated Code?

	streamid = getStreamId(streamname)
	obj = json.decode(str)
  
Both of the above variables have been repeated atleast twice, so you may be able to save a few lines there.

Remember to localize all your variables!!!

Question now is, how will you improve this? Will you add support for multiple channels? Nice work anyhow!
Edited on 16 February 2016 - 05:18 AM
funniray10 #3
Posted 18 February 2016 - 11:53 PM
Cool program! While it could be improved with small tweaks and perhaps some visual adjustments it functions great!
Yes, i know this is Very terrible code, this is VERY new and i made this in about an hour time just to get it working and i know there is a lot of pointless stuff. i will make it better VERY soon with stuff like the ability to have more monitors and text wrap on the chat
Edited on 19 February 2016 - 09:26 PM
funniray10 #4
Posted 19 February 2016 - 10:26 PM
Cool program! While it could be improved with small tweaks and perhaps some visual adjustments it functions great!…
also i cannot remove
 obj = json.decode(str) 
because it turns the API's JSON into a computercraft table
NilLogic #5
Posted 20 February 2016 - 02:15 AM
I understand that you need it, i just dont think you need it several times.
Great news that you'll make improvements!
I'm unaware of the beamstat api but would it be possible to somehow get other stuff too?
funniray10 #6
Posted 24 February 2016 - 02:19 AM
YAY, I just updated the program, and if you are using this i WOULD update to the newest version
river58 #7
Posted 19 March 2016 - 09:59 PM
Can't get it to work after and before replacing username :(/>

Pops up: startup:181: attempt to index ? (a nil value)
funniray10 #8
Posted 21 March 2016 - 01:32 AM
Can't get it to work after and before replacing username :(/>

Pops up: startup:181: attempt to index ? (a nil value)
The streamer currently has no followers, i will be fixing that in the newest update
fixed, please redownload the program
Edited on 21 March 2016 - 12:37 AM
river58 #9
Posted 27 April 2016 - 04:31 AM
I'm getting the same thing after replacing the name with the new version. The person does have followers. :(/>

Pics:
http://i.imgur.com/3AcbVp2.png
http://i.imgur.com/6f0L44F.png
http://i.imgur.com/9JrwiWO.png