Satisfactory Network Mod problem mit einem Pushbutton Modul

Good morning Which command would I need to read the state of a push button? For a switch, I use .state, and for a push button, I use .enabled. According to the description, you can use the enabled function to disable the button by setting it to false. I also tried using :trigger(), but I didn't get any value printed. At this point, I'm not sure how to read the state of this single button. I've gone through the entire Pushbutton module documentation. I'm grateful for any help.
local panel = component.proxy("C326FC17407B16BDC69295A052BC5CA3")
local panelbutton = panel:getModule(0,10,0)
local panelschalter = panel:getModule(1,10,0)

local enabled = false


function togglerun()
enabled = not enabled
end


while true do

print(panelbutton.enabled) -- der print "true" Taster nicht gedrückt auf false kann ich den Taster nicht drücken
print(panelschalter.state) -- der print "false" schalter aus
print(panelbutton:Trigger()) -- der print " "

if panelbutton:Trigger() then
togglerun()
end

if enabled then
panelbutton:setcolor(0,1,0,5)
else
panelbutton:setcolor(1,0,0,5)
end

event.pull(1)
end
local panel = component.proxy("C326FC17407B16BDC69295A052BC5CA3")
local panelbutton = panel:getModule(0,10,0)
local panelschalter = panel:getModule(1,10,0)

local enabled = false


function togglerun()
enabled = not enabled
end


while true do

print(panelbutton.enabled) -- der print "true" Taster nicht gedrückt auf false kann ich den Taster nicht drücken
print(panelschalter.state) -- der print "false" schalter aus
print(panelbutton:Trigger()) -- der print " "

if panelbutton:Trigger() then
togglerun()
end

if enabled then
panelbutton:setcolor(0,1,0,5)
else
panelbutton:setcolor(1,0,0,5)
end

event.pull(1)
end
Solution:
If you have any questions about Ficsit-Networks (or Ficsit-Cam), want to know more info about it or share/yoink some scripts, Join the discord! https://discord.gg/agwBPv6
Jump to solution
3 Replies
sjhoward
sjhoward2w ago
>fin
Solution
FICSIT-Fred
FICSIT-Fred2w ago
If you have any questions about Ficsit-Networks (or Ficsit-Cam), want to know more info about it or share/yoink some scripts, Join the discord! https://discord.gg/agwBPv6
XeRoNe30
XeRoNe30OP2w ago
thx 😉
Want results from more Discord servers?
Add your server