local gMain = peripheral.wrap(tArgs[1])
if gMain == nil then
term.setCursorPos(term.getSize()-5, 2)
termUtils.cWrite("[Fail]\n", colors.red)
error("\nBad side or name")
else
term.setCursorPos(term.getSize()-3, 2)
termUtils.cWrite("[OK]\n", colors.green)
termUtils.cWrite("[INIT]Clearing glasses", colors.blue)
sleep(0.1)
gMain.clear()
term.setCursorPos(term.getSize()-3, 3)
termUtils.cWrite("[OK]\n", colors.green)
end
If you try to do something like:
local gMain = peripheral.wrap(tArgs[1]) if gMain == nil then term.setCursorPos(term.getSize()-5, 2) termUtils.cWrite("[Fail]\n", colors.red) error("\nBad side or name") else term.setCursorPos(term.getSize()-3, 2) termUtils.cWrite("[OK]\n", colors.green)
termUtils.cWrite("[INIT]Clearing glasses", colors.blue) sleep(0.1) gMain.clear() term.setCursorPos(term.getSize()-3, 3) termUtils.cWrite("[OK]\n", colors.green) end
termUtils.cPrint("[INIT]Testing methods:", colors.blue) termUtils.cWrite("+---+-Boxes", colors.cyan) gMain.addBox(0,0,10,10) gMain.clear() term.setCursorPos(term.getSize()-3, 5) termUtils.cWrite("[OK]\n", colors.green) termUtils.cWrite("| +-------Gradients", colors.cyan) gMain.addGradientBox(0,0,10,10,0x384756,1,0x837465,0.1,0.1) gMain.clear() term.setCursorPos(term.getSize()-3, 6) termUtils.cWrite("+-----Text", colors.cyan) gMain.addText(10, 10, "Text test") gMain.clear() term.setCursorPos(term.getSize()-3, 7) termUtils.cWrite("[OK]\n", colors.green) termUtils.cWrite("+-----Items", colors.cyan) gMain.addIcon(10,10,9514,0) gMain.clear() term.setCursorPos(term.getSize()-3, 8) termUtils.cWrite("[OK]\n", colors.green) termUtils.cWrite("+-----Liquids", colors.cyan) gMain.addLiquid(0,0,10,10,"lava") gMain.clear() term.setCursorPos(term.getSize()-3, 9) termUtils.cWrite("[OK]\n", colors.green) term.setCursorPos(term.getSize()-5, 4) termUtils.cWrite("[DONE]\n", colors.green)
the glasses stop syncing and you must link them again, even if the ID is the same.
you must put a sleep(0.1) between draw calls and clear calls to prevent this from happening