A Beginner's Guide to TPT Lua

  • FeynmanLogomaker
    October 2013 Member 0 Permalink

    Show me where, maybe?

  • boxmein
    October 2013 Moderator 0 Permalink
    @FeynmanLogomaker (View Post)
    basically everywhere, "local variable name = value" ==> "local local_var = value" or "local cars = 500"
  • FeynmanLogomaker
    October 2013 Member 0 Permalink

    There, all my names are Lua now!

    Edited once by FeynmanLogomaker. Last: October 2013
  • Jamie-Hyneman
    April 2014 Member 0 Permalink

    @FeynmanLogomaker: Carriage return is an old-fashioned way of saying "enter" (the key), from the days when we used typewriters. The carriage (the big thing that moved along the line pressing the letters to the paper) had to be moved back to the left side of the paper when you finished a line, otherwise it would just keep typing letters over one spot.

  • MiningMarsh
    April 2014 Member 0 Permalink

    @Jamie-Hyneman (View Post)

    Carriage return actually does not behave in that way. A carriage return in this sense is simply the carriage of the typewriter returning to its home position, and not actually advancing to the next line.

     

    I.E.

     

    asd\nfg ->

    asd

    fg

     

    asd\rb->

    bsd

     

    Carriage returns can be useful for programming a status line without having to pull in an entire support library like ncurses.

     

    EDIT: It looks like the TPT console doesn't implement \b or \r, which is a shame. Also doesn't look like it implements any escape sequences (big surprise there). Having at least \27[2J and \27[#m would be pretty nice.

    Edited once by MiningMarsh. Last: April 2014
  • FeynmanLogomaker
    October 2014 Member 0 Permalink

    Do you think TPT will ever implement those characters?

     

    Edit: I have realized this is from October 2013, and not 2014, sorry for necroing

    Edited 2 times by FeynmanLogomaker. Last: October 2014
  • jacob1
    October 2014 Developer 0 Permalink
    I'm not sure what those characters even do, but we do have \x0F which can be used to change the color of the string to anything.
  • boxmein
    October 2014 Moderator 0 Permalink
    Those are ANSI control codes, they start with an ESC (2710) + [ + a code:
    http://ascii-table.com/ansi-escape-sequences.php
  • jward212
    October 2014 Member 0 Permalink

    should add boolean values

  • ThyPowderBoy
    July 2015 Member 0 Permalink

    Looks interesting

    Edited once by ThyPowderBoy. Last: July 2015