OpenPeripheral Box issues.

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Zslash1990

New Member
Jul 29, 2019
18
0
0
so, ive been messing about with open peripherals. but i have a small issue, this might just be my coding. first time ever programming something on computercraft lol.

anyways, the issue is. im running a loop on both the monitor and glasses bridge or whatever. but on the ui the box i added glitches out. its like the box sometimes gets added after the text or the other way im not sure lol. to better understand, check out this picture...

openPeripheral_problem.jpg



Script Source:

Code:
net = peripheral.wrap("left")
bridge = peripheral.wrap("bottom")
 
--methods = net.callRemote("me_access_terminal_2","listMethods")
 
local t = "me_access_terminal_2"
 
while true do
 
  -- variables
  totalbytes = net.callRemote(t,"getTotalBytes")
  usedbytes = net.callRemote(t,"getUsedBytes")
  freebytes = net.callRemote(t,"getFreeBytes")
 
  local m = peripheral.wrap("top")
 
  m.setCursorPos(2,1)
  m.setTextScale(1)
  m.write("ME Storage Status")
 
  m.setCursorPos(4,2)
  m.write(freebytes.." Bytes free of "..totalbytes.." Bytes")
 
  --m.setCursorPos(1,3)
  --m.write("Used Bytes: "..usedbytes)
 
  --x,y,width,height,color,opacity
  bridge.addBox(4,4,100,20,0x000000,0.7)
  fb = bridge.addText(5,5,"LOADING...",0xFFFFFF)
  fb.setText(freebytes.." Bytes free of "..totalbytes.." Bytes")
 
  sleep(0.5)
  m.clear() -- clear monitor
  bridge.clear() -- clear OPglasses
 
end
 

Zslash1990

New Member
Jul 29, 2019
18
0
0
RESOLVED: my friend told me i had to set Z Index, i thought it did it automatically in the order it was scripted but guess not :p

anyways, use var.SetZIndex(value)