Posted 23 February 2014 - 10:25 AM
So yeah i was creating a program so i can see how much energy i have in my 2 Mfsu's via terminal glasses from open peripheral addons!
I recieved the error:
Untitled:32: No such method getCapacity
http://pastebin.com/Yf3yYybU
OR
I recieved the error:
Untitled:32: No such method getCapacity
http://pastebin.com/Yf3yYybU
OR
- local bridge = peripheral.wrap("right")
- local net = peripheral.wrap("back")
- bridge.clear()
- local width = 200
- local storageUnits = {
- {
- ["id"] = "mfsu_0",
- ["name"] = "Mfsu #1"
- },
- {
- ["id"] = "mfsu_1",
- ["name"] = "Mfsu #2"
- }
- }
- local offset = 0
- for key, storageUnit in pairs(storageUnits) do
- pxOffset = offset * 20
- storageUnit["label"] = bridge.addText(4, 4 + pxOffset, storageUnit["name"], 0xFF0000)
- storageUnit["bar"] = bridge.addBox(4, 14 + pxOffset, 0, 5, 0x00CC00, 0.9)
- storageUnit["bg"] = bridge.addBox(4, 14 + pxOffset, width, 5, 0x0033CC, 0.5)
- offset = offset + 1
- end
- while true do
- for i=#storageUnits,1,-1 do
- storageUnit = storageUnits[i]
- if net.isPresentRemote(storageUnit["id"]) then
- capacity = net.callRemote(storageUnit["id"], "getCapacity")
- amount = net.callRemote(storageUnit["id"], "getStored")
- storageUnit["bar"].setWidth(width / capacity * amount)
- end
- end
- sleep(0.5)
- end