Toribash
Original Post
[REL] Run multiple scripts without conflict!
Since quite some people asked how to run multiple scripts at the same time and DeScript is down, I wrote my own script that is capable of doing so.

Instructions:
/run yourFile.lua
runs yourFile.lua (just like /ls, only that previously loaded scripts keep running)

/stop yourFile.lua
stops yourFile.lua

/autorun yourFile.lua
This will run yourFile.lua and start it everytime you start Toribash.

/remove_autorun yourFile.lua
This will remove yourFile.lua from the autorun list.

The first time you run multipleScripts.lua it will detect if there are already any automatically started script and add them to the autorun list. These scripts will be restarted when this happens.
Also multipleScripts.lua will add itself to the autorun list so you only have to start it once. After that it will be loaded when Toribash starts.

As far as I have tested it, it prevents conflicts. This includes:
  • Global variables
  • Adding hooks
  • Removing single hooks/sets of hooks
  • dofile()
  • Crashing of one script doesn't affect others.

Note:
If you rename the script or move it to a different folder, you have to change the first line of the script.
Examples:
Original:
SCRIPT_PATH = "multipleScripts.lua"
If you now rename the file to "awesome.lua" you have to change it like this:
SCRIPT_PATH = "awesome.lua"
If you now move awesome.lua to "toribash/data/script/fking" you have to change it like this:
SCRIPT_PATH = "fking/awesome.lua"
Changelog:
  • 31.05.2014: Scripts can now be stopped
  • 24.02.13:
    • Added Autorun support for Toribash >= 3.91 (I think)
    • Removed little black square in top left corner which I forgot to remove for the initial release (oops )
  • 30.04.12: Initial release


If you encounter errors or I've missed something, post it here.
Attached Files
multipleScripts.lua (4.9 KB, 345 views)
Last edited by psycore; May 31, 2014 at 02:43 PM.
Signature temporarily out of order.