Posted 08 January 2014 - 09:41 PM
                Hello everyone. I recently started working on a program to monitor my Applied Energistics system. I managed to get the display functioning correctly. One issue that I was attempting to fix was the auto-update. The issue I am trying to fix is that whenever a value on the display changes, instead of getting rid of the old value the two displays merge, making a very messy jumble fo words. I am completely new to programming, and have absolutely no idea how to fix this. If anyone would be able to help me get back on track, that would be great.
Here is my code:
Also, a side question: is there any way to adjust the position of the display to match the users screen resolution?
Thanks again! :D/>
                
            Here is my code:
bridge = peripheral.wrap("bottom")
sys = peripheral.wrap("back")
--Startup Script
bridge.clear()
--Applied Energistics Module
  while true do
    methods = sys.callRemote("appeng_me_tilecontroller_0","listMethods")
    bytfree = sys.callRemote("appeng_me_tilecontroller_0","getFreeBytes")
    bytmax = sys.callRemote("appeng_me_tilecontroller_0","getTotalBytes")
    outline = bridge.addBox(0,196,84,58,0x1b2344,1)
    outline.setZIndex(1)
    modspace = bridge.addBox(0,200,80,50,0x895ca8,1)
    modspace.setZIndex(2)
    textbyte1 = bridge.addText(modspace.getX() + 2,modspace.getY() + 2,(bytfree.." bytes free"),0xFFFFFF)
    textbyte1.setZIndex(3)
    bytfree2 = tonumber(bytfree)
	  if bytfree2 < 1
	    then textbyte1.setColor(0xFF0000)
	    else textbyte1.setColor(0x28FF00)
	  end
    textbyte2 = bridge.addText(modspace.getX() + 2,textbyte1.getY() + 10,("out of "..bytmax.."."),0xFFFFFF)
    textbyte2.setZIndex(4)
    freespace = sys.callRemote("appeng_me_tilecontroller_0","getRemainingItemCount")
    spaceav = bridge.addText(modspace.getX() + 2,textbyte2.getY() + 10,("Storage space"),0xFFFFFF)
    spaceav.setZIndex(5)
    freespace2 = tonumber(freespace)
    spaceav2 = bridge.addText(modspace.getX() + 2, spaceav.getY() + 10,("is ?"),0xFFFFFF)
	   if freespace2 < 100
		 then
		   spaceav2.setText("is tight.")
		   spaceav2.setColor(0xFFBF00)
		 else
		   spaceav2.setText("is available.")
		   spaceav2.setColor(0x28FF00) 
	   end
    spaceav2.setZIndex(6)
    modname = bridge.addText(modspace.getX() + 2, spaceav2.getY() + 10,("Applied Energistics"),0x00EEFF)
    modname.setZIndex(7)
    modname.setScale(0.7)
  end
Also, a side question: is there any way to adjust the position of the display to match the users screen resolution?
Thanks again! :D/>