XeRoNe30
XeRoNe30
SMSatisfactory Modding
Created by XeRoNe30 on 11/13/2024 in #help-using-mods
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
6 replies