Difference between revisions of "Running Lua Scripts"

From The Powder Toy
Jump to: navigation, search
m (outdated way too much o.o)
(Fixed some typos; Added reference to the Autorun Manager.)
Line 1: Line 1:
 
 
----
 
----
  
Line 7: Line 6:
 
* Download the script to your TPT folder. (The folder with powder.exe and such)
 
* Download the script to your TPT folder. (The folder with powder.exe and such)
 
* Memorize the name of file.
 
* Memorize the name of file.
* Make sure you also know file extension, it is considered a part of name.
+
* Make sure you also know the file extension, it is considered a part of the name.
 
* Open your TPT console
 
* Open your TPT console
* Type in ''dofile"filename"'' of course replacing ''filename'' with one you memorized
+
* Type in ''dofile("filename")'' of course replacing ''filename'' with the one you memorized
  
If it says ''could not find file'' - maybe you did something wrong
+
If it says ''could not find file'' - maybe you entered a wrong filename.
  
 
==== Autorun ====
 
==== Autorun ====
Line 21: Line 20:
  
 
==== Autorun and dofile ====
 
==== Autorun and dofile ====
Ultimate solution, keeps everything in order, allows autorunning multiple scripts (if they are written correctly)
+
This keeps everything in order and allows autorunning multiple scripts (if they are written correctly)
 
* Download script to TPT folder.
 
* Download script to TPT folder.
 
* Memorize the name of file.
 
* Memorize the name of file.
Line 27: Line 26:
 
* Create a file called ''autorun.lua'' in TPT folder
 
* Create a file called ''autorun.lua'' in TPT folder
 
* Make sure you set extension too, so it isn't ''autorun.lua.txt'' or something  
 
* 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
+
* Open the autorun and type in ''dofile("filename")'' of course replacing ''filename'' with one you memorized
 
* Run TPT
 
* Run TPT
 +
 +
==== Using a script manager ====
 +
Ultimate solution, allows you to start and stop multiple scripts from within TPT without having to edit the files each time
 +
* Download cracker64's script from [http://www.tpt.io/:14596 here].
 +
* Follow the instruction inside the forum post
  
  
  
If you get any errors from scripts, you should report them to the script contributor, make sure to copy error from console.
+
If you get any errors from scripts, you should report them to the script contributor. Make sure to copy the error from the console.

Revision as of 21:56, 12 October 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 the file extension, it is considered a part of the name.
  • Open your TPT console
  • Type in dofile("filename") of course replacing filename with the one you memorized

If it says could not find file - maybe you entered a wrong filename.

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

This keeps everything in order and 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

Using a script manager

Ultimate solution, allows you to start and stop multiple scripts from within TPT without having to edit the files each time

  • Download cracker64's script from here.
  • Follow the instruction inside the forum post


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