Command Signs!

  • ncom86
    3rd Dec 2013 Member 7 Permalink

    I have an idea for a new type of sign: Command signs.

    These signs would, when clicked, hypothetically run console commands, so you do not have to tell a user to type something into the console whose effect cannot be saved. This can be useful for extremely high-level values, and tpt.etc... effects that would normally be impossible.

    Implementation: 

    In sign, type

    {d:!set whatever whatever whatever|I hope this gets into TPT!}

    Command sign text would be green.

    Before the | would be the command to run on click, after would be the text displayed.

    I also have another idea so that tpt.etc... effects could be cleared easily from console or command sign:

    !clear

    This would reset all the values in the tpt superclass to defaults without having to restart.

    Due to hacking possibilities, Lua scripts run from signs would run a popup, asking to confirm.

    Edited 2 times by ncom86. Last: 3rd Dec 2013
  • johnpears
    3rd Dec 2013 Member 0 Permalink

    that would be nice

  • Schneumer
    3rd Dec 2013 Member 1 Permalink

    @ncom86 (View Post)

     This has been suggested MANY times on the forum before, and it came to the conclusion "no" because then people could hack each other....don't ask my how.

  • Jallibad
    3rd Dec 2013 Member 3 Permalink

    @Schneumer (View Post)

     It would be quite easy to "hack" someone if you were allowed to run Lua commands at will, however if you are only allowed to use the old "!" commands I don't see any way to do anything more than mildly annoying, especially if the user had to click the sign first so it couldn't be automatically repeated.

  • xetalim
    3rd Dec 2013 Member 0 Permalink

    @Schneumer (View Post)

     This is different.

    This problem of "hacking" could be easily fixed by adding a popup when clicking a command sign, it will ask if you really want to do that. You could add a new option in the settings that disables the popup.

    Problem solved.

  • ncom86
    3rd Dec 2013 Member 0 Permalink

    Yes, running Lua scripts would require a popup.

  • FeynmanLogomaker
    3rd Dec 2013 Member 1 Permalink

    It could still be a problem, even with a pop up; what happens when you run a malignant script that you think you can trust? Better would be to run it in a sandbox, with no os.execute and no modification of files. Creation (but not running) of new files could be allowed, though.

    It would also be a good idea to display the source code before running.

    Other than that, I've always love this idea.

  • ncom86
    3rd Dec 2013 Member 0 Permalink

    Why not just disable scripting, and only use tpt.etc.. and ! commands

  • FeynmanLogomaker
    3rd Dec 2013 Member 0 Permalink

    tpt.[etc] is scripting, it's part of the Lua global env.

  • jrbc1
    11th Dec 2013 Member 1 Permalink
    I think he means one command per sign, and just commands like tpt.etc, !set, !load, etc. And not things like file edting, if, while, etc. Etc. Etc.
Locked by jacob1: rejected