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

Problems with OpenPeripherals

Started by Writer, 31 March 2015 - 12:40 PM
Writer #1
Posted 31 March 2015 - 02:40 PM
I made a modpack where I included openPeripherals (and necessary parent mods) and peripherals++. I tried to make a program using the bridge and the terminal glasses, but before I went to the lua prompt and tested the addBox method. First I placed the bridge on the right side of the computer and clicked with the terminal glasses on the bridge and equiped them. Then I connected the peripheral to the computer using "p = peripheral.wrap("right")". Up until here, everything went great. But then I typed "p.addBox(10, 10, 50, 50, 0xFFFFFF, 0.5)" and it returned a table, but it didn't appeared anything in my screen. I don't know if there is something wrong with the mod or if it is just me derpin or if the peripherals++ is messing with openPeripherals. BTW, I'm using ComputerCraft V 1.65, OpenMods V 0.6, OpenPeripherals V 0.5 and peripherals++ V 1.2.0-beta4. Please help me!
Bomb Bloke #2
Posted 31 March 2015 - 03:01 PM
I haven't used the bridge, but find myself wondering if the addBox command is supposed to draw anything to the screen, or whether the table it returns is supposed to hold functions for drawing things to the area you defined. What's in the table?

You may get some useful info if you type this into the shell:

openp/docs right addBox
Writer #3
Posted 31 March 2015 - 03:31 PM
I haven't tried to print the table. Will try that in a bit.
Writer #4
Posted 31 March 2015 - 03:47 PM
The table is blank and according to "openp/docs right addBox", I'm doing everything right! So, I really don't know what I'm doing wrong.
Writer #5
Posted 31 March 2015 - 05:51 PM
Figured it out: the newest version of the openPeripherals is kinda broken. Don't know if it is the integration part or anything else. I downgraded to the previous version and it worked. Anyway, thanks for your help Bomb Bloke. :)/>
theoriginalbit #6
Posted 01 April 2015 - 01:36 AM
the latest versions you actually need to call the `sync` function (iirc) which is in charge of actually rendering the changes to the screen.
Writer #7
Posted 01 April 2015 - 06:09 PM
Really? So, I would have to do something like this, right?:

b = peripherals.wrap("right")
b.addBox(10, 10, 50, 50, 0xFFFFFF, 1)
b.sync()

If so, can you explain a bit more about the "sync" function?