Execute console command on event

  • Merbo
    12th Mar 2011 Member 1 Permalink
    You place a sign.
    You select the sign, and type {cmd=} e.g. {cmd=set.ctype.ice.lava}
    You get a spark to the sign, somehow, using a wall or conductor.
    The sign executes (runs) the command.
  • Neospector
    12th Mar 2011 Member 0 Permalink
    I get it...
    Instead of having the player go to the console and going through the trouble of explaining it, just spark and it's done!
    Let me have a look at the console coding for a sec...
    Edit: Seems somewhat possible...but signs don't count as elements or walls so I don't know how it'd detect it.
    Double edit: Maybe just make it like the sign links?
  • pegosh2
    12th Mar 2011 Member 0 Permalink
    @gamerboy8864
    If this is possible. +Infinity
    (I predict massive RPGs ^_^)
  • Pilihp64
    12th Mar 2011 Developer 0 Permalink
    running commands in signs is very makable (i already did, and theres a few other posts about it as well), but it has some issues of not fitting the command. but with the python console coming soon, it will be easier to just use real scripts to execute commands.
  • Cr15py
    12th Mar 2011 Member 0 Permalink
    cracker64
    OR just use onRun and onSPRK or something like that. Basically, you can specify code to run on runtime from a file, and you can set onSPRK event like onSPRK [particle#] "[code]" or something along those lines.
  • Merbo
    12th Mar 2011 Member 0 Permalink
    @cracker64
    That's what I was saying. The whole "python console" is what'll stop me. I could do it myself, but I only have minor experience in Python. So, I was hoping someone like you or @doxin would have an idea on how to get this working. If python console isnt going to come official, let me know, I'll make this :D
  • RadioActiveLua
    11th Nov 2013 Member 0 Permalink

    @Neospector (View Post)


    Would it be possible to just make your own console commands in lua/C++(tpt++). like as in.. the person types "test" into the console the function then does "print("Test")"

  • Schneumer
    11th Nov 2013 Member 1 Permalink

    @RadioActiveLua (View Post)

     necroposting, but this is a good thread.....however, there have been previous threads on this like a command block....i say its too op.....but it would be great to have! Infinite ammo energy particle fray guns, rejections, oh the glory it would be!

  • MiningMarsh
    11th Nov 2013 Member 0 Permalink

    @RadioActiveLua (View Post)

    The console already allows you to define lua functions.

  • FeynmanLogomaker
    15th Nov 2013 Member 0 Permalink

    Then you could mess up someone's computer with that...

    For example, "set.ctype.ice.(io.open(important file name, 'w'))"

Locked by jacob1: Rejected, also necro