BOT ATTEMPT 3 ELECTRIC BOOGALOO IM LOSING MY PATIENCE HELP

This commit is contained in:
AnonymousHybi
2018-03-21 15:14:48 +00:00
parent 5853881603
commit c45971bd00
3 changed files with 15 additions and 18 deletions
+10 -11
View File
@@ -1,5 +1,8 @@
var/list/gamemode_cache = list()
// Also global to prevent easy edits
var/global/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
/datum/configuration
var/server_name = null // server name (for world name / status)
var/server_suffix = 0 // generate numeric suffix based on server port
@@ -186,7 +189,6 @@ var/list/gamemode_cache = list()
var/irc_bot_export = 0 // whether the IRC bot in use is a Bot32 (or similar) instance; Bot32 uses world.Export() instead of nudge.py/libnudge
var/main_irc = ""
var/admin_irc = ""
var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
var/use_lib_nudge = 0 //Use the C library nudge instead of the python nudge.
var/use_overmap = 0
@@ -640,7 +642,12 @@ var/list/gamemode_cache = list()
if("python_path")
if(value)
config.python_path = value
python_path = value
else
if(world.system_type == UNIX)
python_path = "/usr/bin/env python2"
else //probably windows, if not this should work anyway
python_path = "pythonw"
if("use_lib_nudge")
config.use_lib_nudge = 1
@@ -907,12 +914,4 @@ var/list/gamemode_cache = list()
var/datum/game_mode/M = gamemode_cache[game_mode]
if(M && M.can_start() && !isnull(config.probabilities[M.config_tag]) && config.probabilities[M.config_tag] > 0)
runnable_modes |= M
return runnable_modes
/datum/configuration/proc/post_load()
//apply a default value to config.python_path, if needed
if (!config.python_path)
if(world.system_type == UNIX)
config.python_path = "/usr/bin/env python2"
else //probably windows, if not this should work anyway
config.python_path = "python"
return runnable_modes
+3 -3
View File
@@ -4,6 +4,6 @@
if(world.system_type == MS_WINDOWS)
script = replacetext(script, "/", "\\")
var/command = config.python_path + " " + script + " " + args
return shell(command)
var/command = python_path + " " + script + " " + args
shell("[command]")
return
+2 -4
View File
@@ -38,7 +38,7 @@ var/global/datum/global_init/init = new ()
#define RECOMMENDED_VERSION 501
#define RECOMMENDED_VERSION 512
/world/New()
world.log << "Map Loading Complete"
//logs
@@ -53,8 +53,6 @@ var/global/datum/global_init/init = new ()
if(byond_version < RECOMMENDED_VERSION)
world.log << "Your server's byond version does not meet the recommended requirements for this server. Please update BYOND"
config.post_load()
if(config && config.server_name != null && config.server_suffix && world.port > 0)
// dumb and hardcoded but I don't care~
config.server_name += " #[(world.port % 1000) / 100]"
@@ -121,7 +119,7 @@ var/global/datum/global_init/init = new ()
//Must be done now, otherwise ZAS zones and lighting overlays need to be recreated.
createRandomZlevel()
processScheduler = new
master_controller = new /datum/controller/game_controller()