Posted 05 March 2014 - 08:46 PM
I'm struggling with what is pretty much the last part of my program!
All this code is inside a while loop how can i get a function to run when a monitor is pressed in the right place?
Full Code and API
All this code is inside a while loop how can i get a function to run when a monitor is pressed in the right place?
Full Code and API
function FluPrinter(FluDetails)
local Mon = peripheral.wrap("monitor_0")
local name = FluDetails["name"]
local Amount = FluDetails["amount"]
local Cap = FluDetails["capacity"]
local X = FluDetails["XPos"]
local Y = FluDetails["YPos"]
local YBar = FluDetails["YBarPos"]
local XBar = FluDetails["XPos"]
TankSpecs = FluNamePicker(name)
local FormdName = TankSpecs["Name"]
local ActiveColor = TankSpecs["BarColor"]
local TextColor = TankSpecs["TextColor"]
Mon.setCursorPos(X, Y)
Mon.write(FormdName)
local Percent = Percentage(Amount,Cap)
PercentBar(XBar, YBar, 128, ActiveColor, TextColor, Percent, Mon)
Button = {} --
Button["Name"] = FormdName
Button["Amount"] = Amount
Button["Capacity"] = Cap
if os.pullEvent("monitor_touch") then
MonTouch = os.pullEvent("monitor_touch")
if MonTouch[2] >= X and MonTouch[2] <= X + 10 and MonTouch[3] >= Y and MonTouch[3] <= Y + 10 then
OnPushData(Button)
else
end
else
end---
end