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

BlackBoard 0.1.2 ALPHA for Monitors

Started by Gutawer, 16 December 2012 - 05:21 AM
Gutawer #1
Posted 16 December 2012 - 06:21 AM
BlackBoard is a program that lets you display stuff on a blackboard (monitor)!
It's not very advanced, but it works. To write stuff on the monitor, you type it into the computer. By the way, the monitor has to be on the right of the computer. You can change this by editing this line of code. Just change "right" to the direction you want the monitor to be in:
mon = peripheral.wrap("right")
FEATURES:
Spoiler-You can enter (most) things into the blackboard.
-Has commands using the prefix '(:' (which means command) such as:
(:clearline - clears the previous line and lets you type over it.
(:clearscreen - clears the whole screen.
(:exit - exits BlackBoard.
(:scroll - scrolls the screen down once. Will do autoscroll someday.
-And the command 'help' which DOESN'T use '(:'.
-*NEW* COLOURS! Just type in colours or colors to see how it works. Only red and blue at the moment, but hang on for more!
-More to be added.
DOWNLOAD:
SpoilerDownload from: http://pastebin.com/gfLEKV2w
Or type into your computer:
pastebin get gfLEKV2w blackboard
OLD VERSIONS:
Spoiler0.1 (No help or (:exit: http://pastebin.com/nxKedjGE or
pastebin get nxKedjGE blackboard
0.1.1 (No colours: http://pastebin.com/9DJBdRWM or
pastebin get 9DJBdRWM blackboard
SCREENSHOTS:
Spoiler
Hope you like it! And post any suggestions as a reply. I look forward to seeing them!
Thanks for reading!
Dlcruz129 #2
Posted 16 December 2012 - 11:30 AM

for k,v in pairs(rs.getSides()) do
  if peripheral.isPresent(v) and peripheral.getType(v) == "monitor" then
    mon = peripheral.wrap(v)
  else
    print("No monitor found!")
  end
end

This will wrap the monitor automatically, no matter what side it is on.
Gutawer #3
Posted 16 December 2012 - 08:10 PM
Thanks for replying, updating blackboard to include that line of code.
GravityScore #4
Posted 17 December 2012 - 04:48 AM

for k,v in pairs(rs.getSides()) do
  if peripheral.isPresent(v) and peripheral.getType(v) == "monitor" then
	mon = peripheral.wrap(v)
  else
	print("No monitor found!")
  end
end

This will wrap the monitor automatically, no matter what side it is on.

Just a note on that, the "No monitor found" message will appear every time a monitor is not found on the side the loop is checking.

If you want a message to appear only if no monitor is found on any side of the computer, use this:

local found = false
for k,v in pairs(rs.getSides()) do
  if peripheral.isPresent(v) and peripheral.getType(v) == "monitor" then
    mon = peripheral.wrap(v)
    found = true
  end
end
if not(found) then
  print("Seriously? This is a blackboard application designed for use with monitors.")
  print("Why would you run it without attaching a monitor!? Crazy person... :P/>")
end
Dlcruz129 #5
Posted 17 December 2012 - 05:13 AM

for k,v in pairs(rs.getSides()) do
  if peripheral.isPresent(v) and peripheral.getType(v) == "monitor" then
	mon = peripheral.wrap(v)
  else
	print("No monitor found!")
  end
end

This will wrap the monitor automatically, no matter what side it is on.

Just a note on that, the "No monitor found" message will appear every time a monitor is not found on the side the loop is checking.

If you want a message to appear only if no monitor is found on any side of the computer, use this:

local found = false
for k,v in pairs(rs.getSides()) do
  if peripheral.isPresent(v) and peripheral.getType(v) == "monitor" then
	mon = peripheral.wrap(v)
	found = true
  end
end
if not(found) then
  print("Seriously? This is a blackboard application designed for use with monitors.")
  print("Why would you run it without attaching a monitor!? Crazy person... :P/>/>")
end

Oops. I pretty much modify my rednet opening code for everything, and just noticed it doesn't work with anything except modems :P/>
Gutawer #6
Posted 17 December 2012 - 05:18 AM
Haha, I like your little 'No monitor found' message GravityScore.