Ranking
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.
Such as you cannot stop a script from running and other bugs if there are some.
~knight zero~
Originally Posted by KZero07 View Post
Such as you cannot stop a script from running and other bugs if there are some.

I looked into it again and thought a bit but there's no way I can stop a single script while letting the others run.
I don't know of any other bugs.

Originally Posted by Flunked View Post
how do you download a mod or script

Please refer to the Lua Scripts FAQ.
Also, next time try searching the forum first.
Signature temporarily out of order.
The atmosphere, script doesn't work with this.
When i type in /atmo and this script is on, nothing shows up
3DS FC :4038-6911-2047
Pokemon Player. LoZ and other Nintendo shit. =]
Originally Posted by cj2men View Post
The atmosphere, script doesn't work with this.
When i type in /atmo and this script is on, nothing shows up

I'll look into it.

e: Problem fixed. It should run fine now (for Toribash version >= 3.91).
Last edited by psycore; Feb 24, 2013 at 07:08 PM.
Signature temporarily out of order.
Scripts can now be stopped. No idea why I thought this would be impossible, it's actually quite easy. However, you can't run the same script twice at the same time. I might add this feature if it is requested.
Last edited by psycore; May 31, 2014 at 02:49 PM.
Signature temporarily out of order.