Closed Tarkz closed 10 months ago
It appears that basalt.debug
is a bit broken. However, the code below works on my machine:
local basalt = require("basalt")
local main = basalt.createFrame()
local btnGate = main
:addButton()
:setPosition(2,2)
:setText("[ Shutdown ]")
:setBackground(colors.yellow)
:onClick(function(self, event, button, x, y)
os.shutdown()
end)
basalt.autoUpdate()
Be sure to update os.shutdown()
with something more useful, like your function open("gate")
It appears that
basalt.debug
is a bit broken. However, the code below works on my machine:local basalt = require("basalt") local main = basalt.createFrame() local btnGate = main :addButton() :setPosition(2,2) :setText("[ Shutdown ]") :setBackground(colors.yellow) :onClick(function(self, event, button, x, y) os.shutdown() end) basalt.autoUpdate()
Be sure to update
os.shutdown()
with something more useful, like your functionopen("gate")
I took out the debugs and tried it with the os.shutdown() and confirmed that worked. I put back in my open("gate") function and it seems to run the function, but skips over the rednet broadcast call.
rednet.broadcast("open","Gatekeeper")
is there something else I have to do to have basalt broadcast rednet commands?
It appears that
basalt.debug
is a bit broken. However, the code below works on my machine:local basalt = require("basalt") local main = basalt.createFrame() local btnGate = main :addButton() :setPosition(2,2) :setText("[ Shutdown ]") :setBackground(colors.yellow) :onClick(function(self, event, button, x, y) os.shutdown() end) basalt.autoUpdate()
Be sure to update
os.shutdown()
with something more useful, like your functionopen("gate")
I took out the debugs and tried it with the os.shutdown() and confirmed that worked. I put back in my open("gate") function and it seems to run the function, but skips over the rednet broadcast call.
rednet.broadcast("open","Gatekeeper")
is there something else I have to do to have basalt broadcast rednet commands?
In case it helps the open("gate") function is:
function open(sTarget) if sTarget == "gate" then rednet.broadcast("open", "Gatekeeper") end end
A really simple function for now. And I have the rednet.broadcast() call working when I use a pocket computer with the basic lua terminal as well as other CC based programs.
I did get a redstone command to work from my Advanced Pocket Computer using the Basalt UI. So I just have to assume the issue is with my program on the Advanced Computer controlling the gate. Thank you for the help with the basalt.debug() earlier.
I've installed basalt and set up my first program following the tutorial. I've set up a button by using
I originally had the onclick set up as part of the call chain, but have movied it to be it's own section
after this I have the basalt.autoUpdate() call. The program starts up, and I can drag the movableframe around like it's supposed to, but clicking a button never does anything. And the debug events are never called. I'm not sure why.
Checklist
[ X] I am running the latest version.