The last autorun you'll ever need

  • cracker64
    3rd Aug 2012 Developer 11 Permalink

    So since I said I would make one... here it is.

    I'm still going to do a lot more work on it, but it it very usable right now.

    This is a script/autorun manager, So you can organize your scripts with useful names and not have to type them out all the time (or rename them to autorun).

    Save this as autorun.lua http://pastebin.com/DpKTCywE (always updated)

    Keep all your scripts in a folder named 'scripts' in the TPT directory.  Start the ui by clicking the Lua button on the right side menu.

    Now you can just click to load scripts.  It also saves the last scripts you had running (in autorunsettings.txt right now).

    When you uncheck a running script, TPT will need to restart, since that is the only way to clear EVERYTHING the script could have possibly done.  Hitting DONE will then restart (if it has the right exe name) with only selected scripts.  Any script loaded can print to the console.

    Please test and let me know what you think.

     

    Changes:

    v2.21 (May 16, 2013)

       -Scans all sub-directories for scripts! Yay organizing.

    v2.2

       -Remove step fix, was fixed in v87

    v2.1 (March 16, 2013)

       -Handles up to 50 extra step functions, up from the default 5(not including the manager's step, 6 total).

    v2.0 (March 13, 2013)

       -New API functions other scripts can use to store/retrieve settings.

    v1.92

        -Graphical changes

        -Supports spaces in executable name

    v1.7

        -Looks better on new tpt

    v1.5

        -Bigger window, with columns in the file list

        -Some organization

        -Version 1.4 self update was broken for a bit, if yours isn't updating, just download new.

    v1.4

        -Auto-update for OTHER scripts now works, is a bit messy, will fix later, but nothing should change for users to use this
        Place a line '--VER num UPDATE link' in one of the first four lines of the file, see my script for example
        The link at top downloads a file that contains ONLY version,full link,and prints the rest(changelog).
        -Manages long text, click and hold to scroll through, console and file list
        -Lots of ui changes, buttons trigger on release, prettier

    v1.2

        -Uses full links for updating so it can use other sites later(NO HTTPS)

        -When updating, may be a 0 at bottom of script, just delete it

    v1.0

        -Self updating! (requires lua sockets)

        -Default directory changed to 'scripts'.  A button to change directory, and saves directory to settings.

    v0.9

        -Fix small errors

        -Console history(200 lines) with a scroll bar and clear button.

    v0.8

        -Scroll bar

        -Console is more fancy, colored messages

    v0.7

        -Scrolling for lots of scripts

        -MANAGER_PRINT to print to console, instead of replacing print

        -Autorun files with any name (with spaces or symbols)

    v0.6

        -Looks a little better

        -More helpful output in the console

    v0.5

        -Minor fixes (block mouse on menu)

    v0.4

        -Fix Linux compatibility

        -Fix loading scripts with errors, error displayed on menu.

     

    --Pictures here

     

  • Poorsoft
    3rd Aug 2012 Member 0 Permalink

    So is this basically, where you open up all your scripts, and can run them here?

     

    Also, really off-topic, what is the "C" in the tab, with Decorations, Newtonian Gravity, and Ambient Heat?

  • devast8a
    3rd Aug 2012 Former Staff 0 Permalink
  • mniip
    3rd Aug 2012 Developer 0 Permalink
    i see a problem,
    most lua libraries include a ./lua/?.lua into package.path (check it)
    therefore the ./lua/ directory is what i'd not recommend to use for this
    why not scan for lua files in ./ ?
  • devast8a
    3rd Aug 2012 Former Staff 0 Permalink
    could always load from a scripts directory.
  • nmd
    3rd Aug 2012 Member 0 Permalink

    @mniip (View Post)

     I was going to point that out

    @cracker64 (View Post)

     This is going to be a problem if you installed some sockets :/

     

    whoa, wait, is that a control tron script I see O.O

  • ThunderSt
    3rd Aug 2012 Member 0 Permalink

    I tried to toggle ON my 'awsm' script, and after I clicked ''done'' it didn't toggle ON, or even after reloading or even exiting tpt and re-opening! After re-opening it appears toggled OFF. Also, when I try to toggle it ON and click done, I can't click the 'LUA' button again.

     

    Btw, if I toggle the script ON manually with the autorun settings file, when I open tpt it is still off and 'LUA' button doesn't appear.

  • boxmein
    3rd Aug 2012 Former Staff 0 Permalink
    @Poorsoft (View Post)
    In the newest version, a console button was added by my suggestion.
  • Veldin
    3rd Aug 2012 Banned 0 Permalink
    This post is hidden because the user is banned
  • cracker64
    3rd Aug 2012 Developer 0 Permalink

    @mniip (View Post)

    You can change the directory it looks in pretty easily in the script, and I might switch it to scripts or both anyway.

    @nmd (View Post)

    Yes I made a control tron script, but I never made a new topic for it, but was posted in a tron thread.

    @ThunderSt (View Post)

    It sounds like it can't save the settings, which would mean nothing starts on load, but just turning a script on should work fine, are you sure it didn't get started?  There could also be errors in your script, does it run without the manager?

    EDIT: yes, if a script with an error is loaded, the ui won't start, I'm sure I can fix and display a message.

    EDIT2: Fixed loading scripts with errors.

Locked by jacob1: new thread: https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=19400