Execute a Cmd on Plugin Load

  • I've noticed that something like

    Echo('hello world')


    Can be placed outside of the function so that it will execute as soon as a plugin is loaded (or the showfile for that matter). Which is great for lua functions that need happen at runtime.

    However it seems that

    Cmd('go+ macro "mymacro"')

    or

    CmdIndirect('go+ macro "mymacro"')


    Do not execute. So does anyone know a sneaky way to get the plugin to actually call some sort of console function when it loads? Thinking of it like a Startup Macro...


    Thanks

    Edited once, last by Clintos ().

  • Do not execute. Do does anyone know a sneaky way to get the plugin to actually call some sort of console function when it loads?

    This is not possible, you cannot start the engine, while it is being assembled.

    Any sneaky way to try to bypass the safeguards, will only give you a big kaboom.

  • I did not want to start the engine whilst it was being assembled, merely turn on the radio once the ignition is turned on :p


    So we are without a way to have the console execute a command (or macro) upon startup still then?

    That's unfortunate, I was hoping this was a way around that.

  • I did not want to start the engine whilst it was being assembled, merely turn on the radio once the ignition is turned on

    pairing a remote-control with the radio, and gluing down the remote's on-button, seems to do the job ...




















    Store Macro "MyStartup"

    CD Remote "DmxRemotes"

    Store "MyStartupHack"

    Set "MyStartupHack" Property "Address" "99.512" "TriggerOn" 0 "TriggerOff" 0 "Key" "Go+"

    Assign Macro "MyStartup" At "MyStartupHack"

    CD Root


    Set Remote "DMXRemotes" "Enabled" "Yes"

    Edited once, last by Andreas: see Ringen's post below ().

  • I do have another requirement now.

    This got the radio playing great. But it only turns the radio on in this car. What happens when my friend pulls up in his car next to me and winds the window down. His radio doesn’t turn on :(


    How could we get a console to execute a command or plugin when it joins a session and downloads the showfile?

    In MA2 the station executes the startup macro locally when downloading the show…

  • Workarounds typically targets specific scenarios.

    If it worked perfectly for every scenario, it would be called a feature and not be a workaround.... ;)


    On gma2, joining a session is more or less just a filetransfer, with a following showload.

    To my understanding this is not the case on gma3, which is sort-of more like a database sync/update.


    to possibly solve this you need to be more specific, and describe exactly what your "join-macro" is suppose to target and achieve on the connecting station.

  • I think one of the most common scenarios I’ve been asked for is to set stations up with the appropriate user.

    So the master has one user and all others have a ‘backup user’.

    Easiest way to do this before was have a Startup Macro that logged in as ‘backup’ and then triggered a cue that logged in as ‘master’.

    As the cue macros only run on the master that works quite well.


    Another use case I’ve been asked for is to have a station instantly login as a ‘none’ access rights user when it joins. Forcing someone to login with a user/password to use the station.


    Just a couple of specific case examples.