LavishGUI

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
Mysteryman
GamingTools Subscriber
Posts: 33
Joined: Sat Jul 09, 2005 1:21 pm

LavishGUI

Post by Mysteryman » Sun Mar 13, 2011 5:52 pm

I have the need to throw a few buttons on the screen, i've done that no problem.

Now, when i press a button, I want it to execute a few keystroaks etc in game.

While onleftclick works just fine if its a single keystroke, it doesn't seem to allow me to use a semicolon and seperate commands ( like add a wait then another keystroke ).

So i'm assuming i should use the <command> tag for this, but I can't for the life of me figure out the syntax and the wiki is lacking on it. How would i have it execute a script for example? Or even call a proc in a script if that's possible?

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Mar 13, 2011 6:18 pm

The <command> tag predates <onleftclick> and is not needed or recommended for new projects. You can just use a button element instead of a commandbutton (for which the only purpose was the added <command> tag, which is now replaced by <onleftclick> in every element)

<onleftclick> creates a LavishScript atom (a function that executes atomically) out of the code within it. You separate commands with multiple lines, and they are compiled into a script.

You can't add waits in either case. You can use "[[Command:TimedCommand|TimedCommand]]" to asynchronously kick off a command after a minimum amount of time has passed. You use [[Command:RunScript|RunScript]] to run a script. Calling a non-atomic function is not possible outside of a script

Mysteryman
GamingTools Subscriber
Posts: 33
Joined: Sat Jul 09, 2005 1:21 pm

Post by Mysteryman » Sun Mar 13, 2011 9:01 pm

Cool. Thanks Lax. One last thing, could I possibly bind a key stroke to this lavishGUI element to kick it off?

Post Reply