Nicer signs with CC monitors

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

casilleroatr

New Member
Jul 29, 2019
1,360
0
0
Signs are all well and good. They get the job done. But sometimes, you have built a nice futuristic looking room and they look totally out of place. I was motivated to make this computercraft program to solve 2 problems.

1. Make nice looking signs that can be customised
2. Sooth my sorrow for having no nuclear control mod

I call the program multisign, you can find it here:

http://pastebin.com/ZxFQd9b4

(This is a new pastebin link to the one I originally posted. It is functionally the same though except I commented out the program at the bottom. It will still work as an API of course).

I have never written a public API before, so I may not have written it how an API is meant to be written but that is essentially what it is.

I also wrote a small demo program at the end that I forgot to comment out on the upload. I ran that program to make these signs.

2014-05-03_19.11.28.png

There are instructions on how to use the API in the pastebin file.

Edit: I should have included this from the start, but Arkandos has reminded me. If you want to load this as an API to use in your own programs you need to write the following code at the top of your program

Code:
os.loadAPI("multiSignAPI") -- assuming you save this file to multiSignAPI

This loads all of the functions from the API into the instance of CraftOS (computercraft operating system) that runs on that particular CC computer or turtle.

The way it works is you create a table and fill it with new signs. The sign contains data about which monitor to draw the sign on (by monitor side) and a function a long with its arguments which instruct the program how to draw the sign.

You can call another function called drawSigns(table) which will attempt to draw all the signs in side the table. You can have multiple tables of signs. The function I wrote requires advanced monitors. You can customize the text on the button (you need a title, and optionally a subtitle). You can also customize text colour, text size, background colour, and optionally you can have a border of any colour too using the function I wrote.

You can write your own functions though and make it so that the drawSigns function will use those to draw your signs instead, allowing for greater customization.

If anyone finds any bugs please let me know. I have only just finished it after a full rewrite that took about an hour and a half (I wrote the original while drunk!).

If anyone has any suggestions of added functionality or wishes to share a sign drawing function of their own I would really like to hear it.

Thanks for reading and enjoy!
 
Last edited:

Arkandos

New Member
Jul 29, 2019
349
0
0
Seems like a very nice API, might use it myself on 1.7 when that kicks in.
Although, I couldn't find any documentation on how to load the API itself. I personally know how to load APIs as I use them all the time, but other people might not.
Got me thinking though, maybe I should release my APILoader api/program.
 

casilleroatr

New Member
Jul 29, 2019
1,360
0
0
Seems like a very nice API, might use it myself on 1.7 when that kicks in.
Although, I couldn't find any documentation on how to load the API itself. I personally know how to load APIs as I use them all the time, but other people might not.
Got me thinking though, maybe I should release my APILoader api/program.
Thats a good idea though, I will amend the OP. I'm glad you like it. I had wanted to do something like this a lot earlier, but I got too busy and distracted to focus on computercraft stuff. Getting back into it though.