luacheat-engine

Disable button once clicked Cheatengine Lua


So I've been struggling making a button that on pressed goes to a link and toggles Enabled to false so you cant click it anymore

function CEButton1Click(sender)
shellExecute("https://google.com/search")
CEButton1.Enabled=false
end

The above is what I have so far but it does not seem to be working.


Solution

  • The documentation for cheat engine is severely lacking, but sender in that function is actually the button itself. This means you can simple do

    sender.Enabled = false
    

    and that successfully disables the button.

    It works!