A Beginner's Guide to TPT Lua

  • FeynmanLogomaker
    13th Oct 2013 Member 0 Permalink

    Show me where, maybe?

  • boxmein
    13th Oct 2013 Former Staff 0 Permalink
    @FeynmanLogomaker (View Post)
    basically everywhere, "local variable name = value" ==> "local local_var = value" or "local cars = 500"
  • FeynmanLogomaker
    13th Oct 2013 Member 0 Permalink

    There, all my names are Lua now!

    Edited once by FeynmanLogomaker. Last: 13th Oct 2013
  • Rea-Bans
    12th Apr 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
    12th Apr 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: 12th Apr 2014
  • FeynmanLogomaker
    21st Oct 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: 21st Oct 2014
  • jacob1
    21st Oct 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
    21st Oct 2014 Former Staff 0 Permalink
    Those are ANSI control codes, they start with an ESC (2710) + [ + a code:
    http://ascii-table.com/ansi-escape-sequences.php
  • jward212
    21st Oct 2014 Member 0 Permalink

    should add boolean values

  • ThyPowderBoy
    21st Jul 2015 Member 0 Permalink

    Looks interesting

    Edited once by ThyPowderBoy. Last: 21st Jul 2015