need help with lua

  • fireball5000
    26th Feb 2013 Member 0 Permalink

    Hey, tpt users!  I was playing with tpt.el things and I made something i really liked, but when i went to run it, it didn't work. Here's the code.

                                               

    tpt.el.coal.menusection=6,
    tpt.el.coal.diffusion=3,
    tpt.el.coal.explosive=1,
    tpt.el.coal.description=\"long burning, slightly explosive gas\",
    tpt.el.coal.name=\"lbex\",
    tpt.el.bcol.explosive=2,
    tpt.el.bcol.name=\"lbpe\",
    tpt.el.bcol.description=\"long burning, pressure activated explosive powder.\"",
    tpt.el.dmnd.description=\"Diamond. Indestructable Solid.\"

     

    It doesn't work when you try to run it. :(

     Can someone help me?                                                                                               

  • boxmein
    26th Feb 2013 Former Staff 1 Permalink
    @fireball5000 (View Post)
    Umm..
    \"
    is useful only when you want to put quote marks inside a real string, otherwise they just don't work! :D
    What you needed to do was remove les backslashes.
    tpt.el.coal.menusection=6
    tpt.el.coal.diffusion=3
    tpt.el.coal.explosive=1
    tpt.el.coal.description="long burning, slightly explosive gas"
    tpt.el.coal.name="lbex"
    tpt.el.bcol.explosive=2
    tpt.el.bcol.name="lbpe"
    tpt.el.bcol.description="long burning, pressure activated explosive powder."
    tpt.el.dmnd.description="Diamond. Indestructable Solid."


    If you used something like Sublime Text 2 while coding (if you plan on doing more coding I totally recommend ST2 it's awesome), then it would've done syntax highlighting for you!
    CORRECT:
    image
    INCORRECT:
    image
  • fireball5000
    26th Feb 2013 Member 0 Permalink

    i still get some kind of error, " mycode.lua.txt:2: unexpected symbol near '=' "

  • jacob1
    26th Feb 2013 Developer 0 Permalink
    you also don't need the commas
  • fireball5000
    26th Feb 2013 Member 0 Permalink

    Thank you guys so much!!! here's the final code

     

    tpt.el.coal.menusection=6
    tpt.el.coal.diffusion=3
    tpt.el.coal.explosive=1
    tpt.el.coal.description="long burning, slightly explosive gas"
    tpt.el.coal.name="lbex"
    tpt.el.bcol.explosive=2
    tpt.el.bcol.name="lbpe"
    tpt.el.bcol.description="long burning, pressure activated explosive powder."
    tpt.el.dmnd.description="Diamond. Indestructable Solid."

     

    try it if you want :P

    can somone lock please?

  • lapuminator
    26th Feb 2013 Member 0 Permalink

    AWSOME:)

  • fireball5000
    26th Feb 2013 Member 0 Permalink