Difference between revisions of "Running Lua Scripts"

From The Powder Toy
Jump to: navigation, search
(Created page with " ---- This is a guide to successfully run a Lua script published by community. There are several ways of doing that. ==== Dofile ==== * Download the script to your TPT folder...")
 
m (outdated way too much o.o)
Line 32: Line 32:
  
  
If you get any errors from scripts, you should report them to the script contributor, unfortunately you cannot copy error from console, but you can open stdout.txt which can be found in TPT folder, and look for it there.
+
If you get any errors from scripts, you should report them to the script contributor, make sure to copy error from console.

Revision as of 10:06, 13 September 2013


This is a guide to successfully run a Lua script published by community. There are several ways of doing that.

Dofile

  • Download the script to your TPT folder. (The folder with powder.exe and such)
  • Memorize the name of file.
  • Make sure you also know file extension, it is considered a part of name.
  • Open your TPT console
  • Type in dofile"filename" of course replacing filename with one you memorized

If it says could not find file - maybe you did something wrong

Autorun

If you want some script be loaded everytime you run TPT, you can do the following. Although you might not be able to have several scripts on autorun.

  • Download script to TPT folder.
  • Change it's name to autorun.lua
  • Make sure you set extension too, so it isn't autorun.lua.txt or something
  • Run TPT

Autorun and dofile

Ultimate solution, keeps everything in order, allows autorunning multiple scripts (if they are written correctly)

  • Download script to TPT folder.
  • Memorize the name of file.
  • Make sure you also know file extension, it is considered a part of name.
  • Create a file called autorun.lua in TPT folder
  • Make sure you set extension too, so it isn't autorun.lua.txt or something
  • Open the autorun and type in dofile"filename" of course replacing filename with one you memorized
  • Run TPT


If you get any errors from scripts, you should report them to the script contributor, make sure to copy error from console.