Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Metalhead33

CCMonitor Wrapper

Recommended Posts

Ever wanted to have a second monitor attached to your computer, but wasn't fond of binding the GPU to two monitors at once?

Do you for some reason miss the horrible-looking font of ComputerCraft's monitor?

Are you a cheater who wants colour badly, even though you can only afford a Tier 1 Computer?

Then wait no longer, the solution is here for you!

 

The CCMonitor Wrapper!

http://pastebin.com/FG9xfh5F

 

With the CCMonitor Wrapper, you attach a secondary monitor - a ComputerCraft Monitor (basic and advanced alike) - to your OpenComputers computer, and feel the nostalgic looks right away! (or colours, if you are cheap)

 

If you are not yet convinced, just listen to these convincing testimonials!

 

"... uh.... why does this thing even exist? I think there is really no need for it..."

 

So what are you waiting for? Order today!

pastebin FG9xfh5F ccmon.lua

And put it into /lib or /usr/lib!

 

Jokes aside, what this does is wraps the CC Monitor, so you only have to invoke require("ccmon"), and you can go right away.

local ccwrapper = { }
local component = require("component")
 
-- We need to check if the user has a CC monitor.
local monitor = { }
if component.isAvailable("computercraft_advanced_monitor") == true then
    monitor = component.computercraft_advanced_monitor
elseif component.isAvailable("computercraft_monitor") == true then
    monitor = component.computercraft_monitor
else
    print("No ComputerCraft monitor was detected!")
    return nil
end
return component.proxy(monitor.address)

See?

To use it, you simply go...

local ccwrapper = require("ccmon")
ccmon.write("Hello world!")

Usage is basically covered here. Requires both OpenComputers and ComputerCraft.

 

Not sure what could this be used for, but I felt tempted to write this short program, and felt like sharing it for no reason.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.