I'd like to trigger buildiconsfirst (the action triggered by the page number button) through Lua and I have no idea if it's possible and if it is how I would do it.
My best guess is that it has to be given as an order to a unit but since it doesn't have a command ID I don't know how.
I hope I'm just dumb and it's really easy.
I could also bind it to a key with lua, select a unit, simulate that key, unselect and unbind but I didn't find a way to simulate keystrokes either and this wouldn't be exactly the cleanest solution.
Trigger "buildiconsfirst"
Moderator: Moderators
Re: Trigger "buildiconsfirst"
This worked in 0.76, I haven't tried it in 77 but I don't see any reason why it'd have changed:
Spring.SendCommands({"buildiconsfirst"})
I don't know if it takes a param though, never tried it. It should be easy to bind it however.
Spring.SendCommands({"buildiconsfirst"})
I don't know if it takes a param though, never tried it. It should be easy to bind it however.
Re: Trigger "buildiconsfirst"
Omg, I feel stupid... I just never tried the obvious because I thought SendCommands("foobar") only works if /foobar works, but I guess I was wrong.
Thanks, it works like a charm.
Thanks, it works like a charm.