Posted 28 March 2014 - 04:36 AM
So, i'm trying to create a 2 buttons on a monitor. One is for increasing redstone signal strength the other for decreasing. The problem i'm having is compounding the variable x in a function. Basicly all I'm doing is making the x=2 or 3. The only thing i know how to do is possible stack* the buttons like a page turn. Is there another way to do this like logging how many times a function was pulled and using it as a variable?
os.loadAPI("touchpoint")
t = touchpoint.new("right")
local x = 2
t:add("+",
function()
redstone.setAnalogOutput("left",x+1)
end
,40 , 15, 45, 18, math.pow(2,x), colors.lime)
t:draw()
t:run()
os.loadAPI("touchpoint")
t = touchpoint.new("right")
local x = 2
t:add("+",
function()
redstone.setAnalogOutput("left",x+1)
end
,40 , 15, 45, 18, math.pow(2,x), colors.lime)
t:draw()
t:run()