Jump to content

Lua: Add activate() on buttons


Mncdk1

Recommended Posts

Feature request for Ligo. :D

 

Please add activate() on manual buttons.

 

There's lots of uses for firing a signal when you sit down in a chair, but where a switch isn't necessarily the way to do it. Like when counters are involved.

Unless I'm just doing it wrong.

 

Anyway, it would be nice to be able to push the button with lua.

 

Thanks.

Link to comment
Share on other sites

Isn't a button with an active state and a de-active state just a switch?

 

as a workaround:

 

attach both a button and a switch to an OR gate.

use the button for manual push.

attach the switch to your control unit and create a little onActivate() function that deactivates the switch again.

Link to comment
Share on other sites

4 hours ago, Tordan said:

Isn't a button with an active state and a de-active state just a switch?

 

as a workaround:

 

attach both a button and a switch to an OR gate.

use the button for manual push.

attach the switch to your control unit and create a little onActivate() function that deactivates the switch again.

 

I'll try playing with that, and see if I can get the behavior

 

3 hours ago, Yoarii said:

They already have it; I'm quite sure that I've used it pre-Mercury too.

 

https://github.com/dual-universe/lua-examples/blob/main/api-mockup/manualswitch.lua#L31

 

You're linking to a switch. :) Here's a button https://github.com/dual-universe/lua-examples/blob/main/api-mockup/manualbutton.lua

 

Oh, before submitting this reply, Ellias suggested on Discord that I just use the counter directly. I did not know about/consider that option, but I found this

Quote
--- Moves the next counter index

function self.nextIndex() end

in counter.lua here https://github.com/dual-universe/lua-examples/blob/main/api-mockup/counter.lua

I guess this request is moot 🤦‍♂️

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...