diff --git a/_maps/map_files/MetaStation/MetaStation.v41A.II.dmm b/_maps/map_files/MetaStation/MetaStation.v41A.II.dmm
index dcf4c217e94..0c86bf9f9ee 100644
--- a/_maps/map_files/MetaStation/MetaStation.v41A.II.dmm
+++ b/_maps/map_files/MetaStation/MetaStation.v41A.II.dmm
@@ -4321,7 +4321,7 @@
"bFe" = (/obj/item/radio/intercom{frequency = 1459; name = "Station Intercom (General)"; pixel_y = -25},/obj/machinery/camera{c_tag = "Arrivals - Middle Arm - Far"; dir = 1; network = list("SS13")},/obj/effect/decal/warning_stripes/south,/turf/simulated/floor/plasteel,/area/hallway/secondary/entry{name = "Arrivals"})
"bFf" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4; level = 1},/obj/machinery/computer/monitor{name = "Grid Power Monitoring Computer"},/obj/item/radio/intercom{frequency = 1459; name = "Station Intercom (General)"; pixel_x = 5; pixel_y = -26},/turf/simulated/floor/plasteel{icon_state = "dark"},/area/turret_protected/tcomeast{name = "\improper MiniSat East Wing"})
"bFg" = (/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 4},/turf/space,/area/construction/hallway{name = "\improper MiniSat Exterior"})
-"bFh" = (/obj/machinery/computer/telecomms/traffic{network = "tcommsat"},/turf/simulated/floor/plasteel{icon_state = "grimy"},/area/tcommsat/computer{name = "\improper Telecoms Control Room"})
+"bFh" = (/obj/machinery/computer/telecomms/traffic,/turf/simulated/floor/plasteel{icon_state = "grimy"},/area/tcommsat/computer{name = "\improper Telecoms Control Room"})
"bFi" = (/obj/machinery/atmospherics/unary/vent_pump{dir = 4; on = 1},/obj/structure/chair/office/dark{dir = 1},/turf/simulated/floor/plasteel{icon_state = "grimy"},/area/tcommsat/computer{name = "\improper Telecoms Control Room"})
"bFj" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/turf/simulated/floor/plasteel{icon_state = "grimy"},/area/tcommsat/computer{name = "\improper Telecoms Control Room"})
"bFk" = (/obj/structure/transit_tube{icon_state = "E-W-Pass"},/obj/structure/lattice,/turf/space,/area/space)
@@ -8504,7 +8504,7 @@
"dhF" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/obj/machinery/door/airlock/maintenance{name = "storage room"; req_access = "12"},/turf/simulated/floor/plating,/area/maintenance/aft{name = "Aft Maintenance"})
"dhG" = (/obj/item/seeds/watermelon,/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/obj/effect/decal/cleanable/dirt,/turf/simulated/floor/plating,/area/maintenance/aft{name = "Aft Maintenance"})
"dhI" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 9},/mob/living/simple_animal/bot/cleanbot{name = "Mopfficer Sweepsky"; on = 0},/turf/simulated/floor/plating,/area/maintenance/fore)
-
+
(1,1,1) = {"
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
diff --git a/code/game/machinery/telecomms/ntsl2.dm b/code/game/machinery/telecomms/ntsl2.dm
new file mode 100644
index 00000000000..fefd1ba1aee
--- /dev/null
+++ b/code/game/machinery/telecomms/ntsl2.dm
@@ -0,0 +1,315 @@
+GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new())
+// Custom Implementations for NTSL2
+/* NTSL2 Configuration Datum
+ * This is an abstract handler for the configuration loadout. It's set up like this both for ease of transfering in and out of the UI
+ * as well as allowing users to save and load configurations.
+ */
+/datum/ntsl2_configuration
+ /* Simple Toggles */
+ var/toggle_activated = TRUE
+ var/toggle_jobs = FALSE
+ var/toggle_timecode = FALSE
+ // Hack section
+ var/toggle_gibberish = FALSE
+ var/toggle_honk = FALSE
+
+ /* Strings */
+ var/setting_language = null
+
+ /* Tables */
+ var/list/regex = list()
+
+ /* Arrays */
+ var/list/firewall = list()
+
+ /* Meta stuff */
+ // These variables requires the source computer to be hacked in order to change
+ var/list/requires_unlock = list(
+ "firewall" = TRUE,
+ "toggle_gibberish" = TRUE,
+ "toggle_honk" = TRUE,
+ )
+
+ // This is used to sanitize topic data
+ var/list/tables = list("regex")
+ var/list/arrays = list("firewall")
+
+ // This tells the datum what is safe to serialize and what's not. It also applies to deserialization.
+ var/list/to_serialize = list(
+ "toggle_activated",
+ "toggle_jobs",
+ "toggle_timecode",
+ "toggle_gibberish",
+ "toggle_honk",
+ "setting_language",
+ "regex",
+ "firewall"
+ )
+
+ // This is used for sanitization.
+ var/list/serialize_sanitize = list(
+ "toggle_activated" = "bool",
+ "toggle_jobs" = "bool",
+ "toggle_timecode" = "bool",
+ "toggle_gibberish" = "bool",
+ "toggle_honk" = "bool",
+ "setting_language" = "string",
+ "regex" = "table",
+ "firewall" = "array"
+ )
+
+ // Used to determine what languages are allowable for conversion. Generated during runtime.
+ var/list/valid_languages = list("--DISABLE--")
+
+/datum/ntsl2_configuration/proc/reset()
+ /* Simple Toggles */
+ toggle_activated = initial(toggle_activated)
+ toggle_jobs = initial(toggle_jobs)
+ toggle_timecode = initial(toggle_timecode)
+ // Hack section
+ toggle_gibberish = initial(toggle_gibberish)
+ toggle_honk = initial(toggle_honk)
+
+ /* Strings */
+ setting_language = initial(setting_language)
+
+ /* Tables */
+ regex = list()
+
+ /* Arrays */
+ firewall = list()
+
+
+/datum/ntsl2_configuration/proc/update_languages()
+ for(var/language in GLOB.all_languages)
+ var/datum/language/L = GLOB.all_languages[language]
+ if(L.flags & HIVEMIND)
+ continue
+ valid_languages[language] = TRUE
+
+// I'd use serialize() but it's used by another system. This converts the configuration into a JSON string.
+/datum/ntsl2_configuration/proc/ntsl_serialize()
+ . = list()
+ for(var/variable in to_serialize)
+ .[variable] = vars[variable]
+ . = json_encode(.)
+
+// This loads a configuration from a JSON string.
+// Fucking broken as shit, someone help me fix this.
+/datum/ntsl2_configuration/proc/ntsl_deserialize(text, obj/machinery/computer/telecomms/traffic/source)
+ var/list/var_list = json_decode(text)
+ for(var/variable in var_list)
+ if(variable in to_serialize) // Don't just accept any random vars jesus christ!
+ if(requires_unlock[variable] && (source && !source.unlocked))
+ continue
+ var/sanitize_method = serialize_sanitize[variable]
+ var/variable_value = var_list[variable]
+ variable_value = sanitize(variable_value, sanitize_method)
+ if(variable_value)
+ vars[variable] = variable_value
+
+// Sanitizing user input. Don't blindly trust the JSON.
+/datum/ntsl2_configuration/proc/sanitize(variable, sanitize_method)
+ if(!sanitize_method)
+ return null
+
+ switch(sanitize_method)
+ if("bool")
+ return variable ? TRUE : FALSE
+ if("table", "array")
+ if(!islist(variable))
+ return list()
+ // Insert html filtering for the regexes here if you're boring
+ return sanitize(variable)
+ if("string")
+ return "[variable]"
+
+ return variable
+
+// Primary signal modification. This is where all of the variables behavior are actually implemented.
+/datum/ntsl2_configuration/proc/modify_signal(datum/signal/signal)
+ // Servers are deliberately turned off. Mark every signal as rejected.
+ if(!toggle_activated)
+ signal.data["reject"] = TRUE
+ return
+
+ // Firewall
+ // This must happen before anything else modifies the signal ["name"].
+ if(islist(firewall) && firewall.len > 0)
+ if(firewall.Find(signal.data["name"]))
+ signal.data["reject"] = 1
+
+ // These two stack properly.
+ // Simple job indicator switch.
+ if(toggle_jobs)
+ var/new_name = signal.data["name"] + " ([signal.data["job"]]) "
+ signal.data["name"] = new_name
+ signal.data["realname"] = new_name // this is required because the broadcaster uses this directly if the speaker doesn't have a voice changer on
+
+ // Add the current station time like a time code.
+ if(toggle_timecode)
+ var/new_name = "\[[station_time_timestamp()]] " + signal.data["name"]
+ signal.data["name"] = new_name
+ signal.data["realname"] = new_name // this is required because the broadcaster uses this directly if the speaker doesn't have a voice changer on
+
+ // Hacks!
+ // Censor dat shit like nobody's business
+ if(toggle_gibberish)
+ signal.data["message"] = Gibberish(signal.data["message"], 80)
+
+ // Replace everything with HONK!
+ if(toggle_honk)
+ var/list/split = splittext(signal.data["message"], " ")
+ var/honklength = split.len
+ var/new_message = ""
+ for(var/i in 1 to honklength)
+ new_message += pick("HoNK!", "HONK", "HOOOoONK", "HONKHONK!", "HoNnnkKK!!!", "HOOOOOOOOOOONK!!!!11!", "henk!")
+ signal.data["message"] = new_message
+
+
+ // Language Conversion
+ if(setting_language && valid_languages[setting_language])
+ if(setting_language == "--DISABLE--")
+ setting_language = null
+ else
+ signal.data["language"] = GLOB.all_languages[setting_language]
+
+ // Regex replacements
+ if(islist(regex) && regex.len > 0)
+ var/original = signal.data["message"]
+ var/new_message = original
+ for(var/reg in regex)
+ var/replacePattern = pencode_to_html(regex[reg])
+ var/regex/start = new(reg, "gi")
+ new_message = start.Replace(original, replacePattern)
+ signal.data["message"] = new_message
+
+ // Make sure the message is valid after we tinkered with it, otherwise reject it
+ if(signal.data["message"] == "" || !signal.data["message"])
+ signal.data["reject"] = 1
+
+/datum/ntsl2_configuration/Topic(mob/user, href_list, window_id, obj/machinery/computer/telecomms/traffic/source)
+ // Toggles
+ if(href_list["toggle"])
+ var/var_to_toggle = href_list["toggle"]
+ if(requires_unlock[var_to_toggle] && !source.unlocked)
+ return
+ if(!(var_to_toggle in to_serialize))
+ return
+ vars[var_to_toggle] = !vars[var_to_toggle]
+ log_action(user, "toggled NTSL2 variable [var_to_toggle] [vars[var_to_toggle] ? "on" : "off"]")
+
+ // Strings
+ if(href_list["setting_language"])
+ var/new_language = input(user, "Pick a language to convert messages to.", "Language Conversion") as null|anything in valid_languages
+ if(!new_language)
+ return
+ if(new_language == "--DISABLE--")
+ setting_language = null
+ to_chat(user, "Language conversion disabled.")
+ else
+ setting_language = new_language
+ to_chat(user, "Messages will now be converted to [new_language].")
+
+ log_action(user, new_language == "--DISABLE--" ? "disabled NTSL2 language conversion" : "set NTSL2 language conversion to [new_language]", TRUE)
+
+ // Tables
+ if(href_list["create_row"])
+ if(href_list["table"] && href_list["table"] in tables)
+ if(requires_unlock[href_list["table"]] && !source.unlocked)
+ return
+ var/new_key = input(user, "Provide a key for the new row.", "New Row") as text|null
+ if(!new_key)
+ return
+ var/new_value = input(user, "Provide a new value for the key [new_key]", "New Row") as text|null
+ if(new_value == null)
+ return
+ var/list/table = vars[href_list["table"]]
+ table[new_key] = new_value
+ to_chat(user, "Added row [new_key] -> [new_value].")
+ log_action(user, "updated [href_list["table"]] - new row [new_key] -> [new_value]")
+
+ if(href_list["delete_row"])
+ if(href_list["table"] && href_list["table"] in tables)
+ if(requires_unlock[href_list["table"]] && !source.unlocked)
+ return
+ var/list/table = vars[href_list["table"]]
+ table.Remove(href_list["delete_row"])
+ to_chat(user, "Removed row [href_list["delete_row"]] from [href_list["table"]]")
+ log_action(user, "updated [href_list["table"]] - removed row [href_list["delete_row"]]")
+
+ // Arrays
+ if(href_list["create_item"])
+ if(href_list["array"] && href_list["array"] in arrays)
+ if(requires_unlock[href_list["array"]] && !source.unlocked)
+ return
+ var/new_value = input(user, "Provide a value for the new index.", "New Index") as text|null
+ if(new_value == null)
+ return
+ var/list/array = vars[href_list["array"]]
+ array.Add(new_value)
+ to_chat(user, "Added row [new_value].")
+ log_action(user, "updated [href_list["array"]] - new value [new_value]")
+
+ if(href_list["delete_item"])
+ if(href_list["array"] && href_list["array"] in arrays)
+ if(requires_unlock[href_list["array"]] && !source.unlocked)
+ return
+ var/list/array = vars[href_list["array"]]
+ array.Remove(href_list["delete_item"])
+ to_chat(user, "Removed [href_list["delete_item"]] from [href_list["array"]]")
+ log_action(user, "updated [href_list["array"]] - removed [href_list["delete_item"]]")
+
+ // Spit out the serialized config to the user
+ if(href_list["save_config"])
+ user << browse(ntsl_serialize(), "window=save_ntsl2")
+
+ if(href_list["load_config"])
+ var/json = input(user, "Provide configuration JSON below.", "Load Config", ntsl_serialize()) as message
+ ntsl_deserialize(json, source)
+ log_action(user, "has uploaded a NTSL2 JSON configuration: [json]", TRUE)
+
+ user << output(list2params(list(ntsl_serialize())), "[window_id].browser:updateConfig")
+
+/datum/ntsl2_configuration/proc/log_action(user, msg, adminmsg = FALSE)
+ log_game("NTSL2: [key_name(user)] [msg]")
+ log_investigate("[key_name(user)] [msg]", "ntsl")
+ if(adminmsg)
+ message_admins("[key_name_admin(user)] [msg]")
+
+/* Asset datum for the UI */
+/datum/asset/simple/ntsl2
+ assets = list(
+ "bundle.css" = 'html/ntsl2/dist/bundle.css',
+ "bundle.js" = 'html/ntsl2/dist/bundle.js',
+ "tab_home.html" = 'html/ntsl2/dist/tab_home.html',
+ "tab_hack.html" = 'html/ntsl2/dist/tab_hack.html',
+ "tab_filtering.html" = 'html/ntsl2/dist/tab_filtering.html',
+ "tab_firewall.html" = 'html/ntsl2/dist/tab_firewall.html',
+ "tab_regex.html" = 'html/ntsl2/dist/tab_regex.html',
+ "uiTitleFluff.png" = 'html/ntsl2/dist/uiTitleFluff.png'
+ )
+
+/* Custom subtype of /datum/browser that behaves as we want for our project */
+/datum/browser/ntsl2
+ var/initial_config // Initial NTSL2 configuration
+
+/datum/browser/ntsl2/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, ntsl2_config)
+ . = ..()
+ initial_config = ntsl2_config
+// Prevent all stylesheets from being added, we have our own CSS that's bundled with gulp
+/datum/browser/ntsl2/add_stylesheet()
+ return
+// No header, we're running a fully complete .html file
+/datum/browser/ntsl2/get_header()
+ return
+// We inject a little code at the bottom of the file, similar to NanoUI, but more limited.
+// This code is used for delivering live updates of config changes & allowing the UI to provide Topic data.
+/datum/browser/ntsl2/get_footer()
+ var/byondSrc = "byond://?src=[ref.UID()];"
+ var/dat = ""
+ return dat
diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm
index c74d5364919..42d557c604c 100644
--- a/code/game/machinery/telecomms/telecomunications.dm
+++ b/code/game/machinery/telecomms/telecomunications.dm
@@ -435,37 +435,25 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/logs = 0 // number of logs
var/totaltraffic = 0 // gigabytes (if > 1024, divide by 1024 -> terrabytes)
- var/list/memory = list() // stored memory
- var/list/rawcode = list() // the code to compile (list of characters)
- var/datum/TCS_Compiler/Compiler // the compiler that compiles and runs the code
- var/autoruncode = 0 // 1 if the code is set to run every time a signal is picked up
-
var/encryption = "null" // encryption key: ie "password"
var/salt = "null" // encryption salt: ie "123comsat"
// would add up to md5("password123comsat")
var/language = "human"
var/obj/item/radio/headset/server_radio = null
-/obj/machinery/telecomms/server/New()
+/obj/machinery/telecomms/server/Initialize()
..()
- Compiler = new()
- Compiler.Holder = src
server_radio = new()
/obj/machinery/telecomms/server/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
-
if(signal.data["message"])
-
if(is_freq_listening(signal))
-
if(traffic > 0)
totaltraffic += traffic // add current traffic to total traffic
//Is this a test signal? Bypass logging
if(signal.data["type"] != 4)
-
// If signal has a message and appropriate frequency
-
update_logs()
var/datum/comm_log_entry/log = new
@@ -508,23 +496,14 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/identifier = num2text( rand(-1000,1000) + world.time )
log.name = "data packet ([md5(identifier)])"
- if(Compiler && autoruncode)
- Compiler.Run(signal) // execute the code
+ // Run NTSL2 against the signal
+ if(GLOB.ntsl2_config)
+ GLOB.ntsl2_config.modify_signal(signal)
var/can_send = relay_information(signal, "/obj/machinery/telecomms/hub")
if(!can_send)
relay_information(signal, "/obj/machinery/telecomms/broadcaster")
-
-/obj/machinery/telecomms/server/proc/setcode(var/list/code)
- if(istype(code))
- rawcode = code
-
-/obj/machinery/telecomms/server/proc/compile(mob/user as mob)
- if(Compiler)
- admin_log(user)
- return Compiler.Compile(rawcode)
-
/obj/machinery/telecomms/server/proc/update_logs()
// start deleting the very first log entry
if(logs >= 400)
@@ -544,16 +523,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
log_entries.Add(log)
update_logs()
-/obj/machinery/telecomms/server/proc/admin_log(var/mob/mob)
- var/msg="[key_name(mob)] has compiled a script to server [src]:"
- log_game("NTSL: [msg]")
- log_game("NTSL: [rawcode.Join("")]")
- src.investigate_log("[msg]
[rawcode.Join("")]", "ntsl")
- if(length(rawcode)) // Let's not bother the admins for empty code.
- message_admins("[key_name_admin(mob)] has compiled and uploaded a NTSL script to [src.id] (JMP)")
-
// Simple log entry datum
-
/datum/comm_log_entry
var/parameters = list() // carbon-copy to signal.data[]
var/name = "data packet (#)"
diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm
index 28a2809e5b4..8979dfeeb75 100644
--- a/code/game/machinery/telecomms/traffic_control.dm
+++ b/code/game/machinery/telecomms/traffic_control.dm
@@ -1,25 +1,23 @@
/obj/machinery/computer/telecomms/traffic
name = "telecommunications traffic control"
- var/screen = 0 // the screen number:
- var/allservers = 0 // Are all servers being edited at the same time?
- var/list/servers = list() // the servers located by the computer
- var/mob/editingcode
- var/mob/lasteditor
- var/obj/machinery/telecomms/server/SelectedServer
-
- var/compiling_errors = ""
-
- var/network = "NULL" // the network to probe
- var/temp = "" // temporary feedback messages
-
- var/storedcode = "" // code stored
-
light_color = LIGHT_COLOR_DARKGREEN
req_access = list(access_tcomsat)
circuit = /obj/item/circuitboard/comm_traffic
+ // NTSL2
+ var/window_id // mostly used to let the configuration datum update the user's UI
+ var/unlocked = FALSE
+
+/obj/machinery/computer/telecomms/traffic/attackby(obj/item/I, mob/user)
+ if(ismultitool(I))
+ unlocked = !unlocked
+ to_chat(user, "This computer is now [unlocked ? "Unlocked" : "Locked"]. \
+Reopen the UI to see the difference.")
+ return
+ . = ..()
+
/obj/machinery/computer/telecomms/traffic/attack_hand(mob/user)
interact(user)
@@ -27,154 +25,19 @@
if(stat & (BROKEN|NOPOWER))
return 0
- user.set_machine(src)
+ if(GLOB.ntsl2_config.valid_languages.len == 1)
+ GLOB.ntsl2_config.update_languages() // this is silly but it has to be done because ntsl2 inits before languages do
- if(!editingcode || editingcode && editingcode.machine != src)
- editingcode = user
- lasteditor = user
-
- var/dat = ""
-
- dat += "
Telecommunications Traffic Control"
-
- if(screen == 0) //main menu
- dat += "
[temp]"
- dat += "
Current Network: [network]
"
- if(servers.len)
- dat += "
Detected Telecommunication Servers:"
-
- dat += "
\[Flush Buffer\]"
-
- else
- dat += "
No servers detected. Scan for servers: \[Scan\]"
-
- if(screen == 1) //server menu
- dat += "
[temp]
"
- dat += "\[Main Menu\] \[Refresh\]"
- dat += "
Current Network: [network]"
- if(allservers)
- dat += "
Selected Server: All Servers
"
- else
- dat += "
Selected Server: [SelectedServer.id]
"
- dat += "
\[Edit Code\]"
- dat += "
Signal Execution: "
- if(allservers)
- dat += "ALWAYS NEVER"
- else
- if(SelectedServer.autoruncode)
- dat += "ALWAYS"
- else
- dat += "NEVER"
-
- if(screen == 2) //code editor
- if(editingcode == user)
- dat += {"
[temp]
-
- \[Back\]
- \[Main Menu\]
- \[Refresh\]
-
-
-
-
-
-
-
-
-
- Compile
- Clear
-
-
- [compiling_errors]
-
-
-
- "}
- else
- dat += {"
[temp]
- \[Refresh\]
-
-
-
-
-
- [compiling_errors]
-
- "} //anything typed will be overridden anyways by the one who is editing the code
-
- var/datum/browser/popup = new(user, "traffic_control", "Telecommunication Traffic Control", 700, 500)
- //codemirror
- popup.add_script("codemirror-compressed", 'nano/codemirror/codemirror-compressed.js') // A custom minified JavaScript file of CodeMirror, with the following plugins: CSS Mode, NTSL Mode, CSS-hint addon, Search addon, Sublime Keymap.
- popup.add_stylesheet("codemirror", 'nano/codemirror/codemirror.css') // A CSS sheet containing the basic stylings and formatting information for CodeMirror.
- popup.add_stylesheet("lesser-dark", 'nano/codemirror/lesser-dark.css') // A theme for CodeMirror to use, which closely resembles the rest of the NanoUI style.
-
- popup.set_content(dat)
- popup.open()
-
- temp = ""
+ var/datum/asset/assets = get_asset_datum(/datum/asset/simple/ntsl2)
+ assets.send(user)
+ var/dat = file2text("html/ntsl2/dist/index.html")
+ if(unlocked)
+ dat += "\n"
+ var/datum/browser/ntsl2/nt_browser = new(user, name, "NTSL2", 720, 480, src, GLOB.ntsl2_config.ntsl_serialize())
+ nt_browser.set_content(dat)
+ nt_browser.open()
+ window_id = nt_browser.window_id
/obj/machinery/computer/telecomms/traffic/Topic(href, href_list)
if(..())
@@ -184,209 +47,4 @@
if(!istype(user) || !user.client)
return 0
- if(user != editingcode)
- return 0
-
- var/code = href_list["cMirror"]
- if(code)
- storedcode = code
-
- var/list/codelist = href_list["cMirrorList"]
- if(istext(codelist))
- codelist = json_decode(codelist)
-
- add_fingerprint(user)
- user.set_machine(src)
-
- if(!allowed(user) && !emagged && !user.can_admin_interact())
- to_chat(user, "Access Denied.")
- return 0
-
- switch(href_list["choice"])
- if("Compile")
- if(!istype(codelist))
- return 0
- if(user != editingcode)
- return 0 //only one editor
-
- if(SelectedServer)
- var/obj/machinery/telecomms/server/Server = SelectedServer
- Server.setcode(codelist)
-
- spawn(0)
- // Output all the compile-time errors
- compiling_errors = "Please wait, compiling..."
- updateUsrDialog()
-
- var/list/compileerrors = Server.compile(user) // then compile the code!
- if(!telecomms_check(user))
- return
-
- if(compileerrors.len)
- compiling_errors = "Compile Errors
"
- for(var/datum/scriptError/e in compileerrors)
- compiling_errors += "\t>[e.message]"
- compiling_errors += "([compileerrors.len] errors)"
-
-
- else
- compiling_errors = "TCS compilation successful!
"
- compiling_errors += "(0 errors)"
-
- updateUsrDialog()
- if(allservers)
- spawn(0)
- compiling_errors = "Please wait, compiling..."
- updateUsrDialog()
-
- for(var/obj/machinery/telecomms/server/Server in servers)
- Server.setcode(codelist)
- var/list/compileerrors = Server.compile(user)
- if(!telecomms_check(user))
- return
- if(compileerrors.len)
- compiling_errors = "Compile Errors
"
- for(var/datum/scriptError/e in compileerrors)
- compiling_errors += "\t>[e.message]"
- compiling_errors += "([compileerrors.len] errors)"
- updateUsrDialog()
- return // If there are errors, don't waste time compiling on other servers
- compiling_errors = "TCS compilation successful!
"
- compiling_errors += "(0 errors)"
- updateUsrDialog()
-
- if("Clear")
- if(!telecomms_check(user) || user != editingcode)
- return 0
-
- if(SelectedServer)
- var/obj/machinery/telecomms/server/Server = SelectedServer
- Server.memory = list() // clear the memory
-
- compiling_errors = "Server Memory Cleared!"
- storedcode = null
- updateUsrDialog()
- if(allservers)
- for(var/obj/machinery/telecomms/server/Server in servers)
- Server.memory = list() // clear the memory
-
- compiling_errors = "Server Memory Cleared!"
- storedcode = null
- updateUsrDialog()
-
- if(href_list["viewserver"])
- screen = 1
- if(href_list["viewserver"] == "all")
- allservers = 1
- else
- allservers = 0
- for(var/obj/machinery/telecomms/T in servers)
- if(T.id == href_list["viewserver"])
- SelectedServer = T
- break
-
- if(href_list["operation"])
- switch(href_list["operation"])
-
- if("release")
- servers = list()
- screen = 0
-
- if("mainmenu")
- screen = 0
-
- if("codeback")
- if(allservers || SelectedServer)
- screen = 1
-
- if("scan")
- if(servers.len > 0)
- temp = "- FAILED: CANNOT PROBE WHEN BUFFER FULL -"
-
- else
- for(var/obj/machinery/telecomms/server/T in range(25, src))
- if(T.network == network)
- servers.Add(T)
-
- if(!servers.len)
- temp = "- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -"
- else
- temp = "- [servers.len] SERVERS PROBED & BUFFERED -"
-
- screen = 0
-
- if("editcode")
- screen = 2
-
- if("togglerun")
- SelectedServer.autoruncode = !(SelectedServer.autoruncode)
- if("runon")
- for(var/obj/machinery/telecomms/server/Server in servers)
- Server.autoruncode = 1
- if("runoff")
- for(var/obj/machinery/telecomms/server/Server in servers)
- Server.autoruncode = 0
-
- if(href_list["network"])
-
- var/newnet = input(user, "Which network do you want to view?", "Comm Monitor", network) as null|text
-
- if(newnet && canAccess(user))
- if(length(newnet) > 15)
- temp = "- FAILED: NETWORK TAG STRING TOO LENGHTLY -"
-
- else
-
- network = newnet
- screen = 0
- servers = list()
- temp = "- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -"
-
- updateUsrDialog()
-
-/obj/machinery/computer/telecomms/traffic/attackby(var/obj/item/D as obj, var/mob/user as mob, params)
- if(istype(D, /obj/item/screwdriver))
- playsound(get_turf(src), D.usesound, 50, 1)
- if(do_after(user, 20 * D.toolspeed, target = src))
- if(src.stat & BROKEN)
- to_chat(user, "The broken glass falls out.")
- var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
- new /obj/item/shard(loc)
- var/obj/item/circuitboard/comm_traffic/M = new /obj/item/circuitboard/comm_traffic( A )
- for(var/obj/C in src)
- C.loc = src.loc
- A.circuit = M
- A.state = 3
- A.icon_state = "3"
- A.anchored = 1
- qdel(src)
- else
- to_chat(user, "You disconnect the monitor.")
- var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
- var/obj/item/circuitboard/comm_traffic/M = new /obj/item/circuitboard/comm_traffic( A )
- for(var/obj/C in src)
- C.loc = src.loc
- A.circuit = M
- A.state = 4
- A.icon_state = "4"
- A.anchored = 1
- qdel(src)
- src.updateUsrDialog()
- return
-
-/obj/machinery/computer/telecomms/traffic/emag_act(user as mob)
- if(!emagged)
- playsound(get_turf(src), 'sound/effects/sparks4.ogg', 75, 1)
- emagged = 1
- to_chat(user, "You you disable the security protocols")
-
-/obj/machinery/computer/telecomms/traffic/proc/canAccess(var/mob/user)
- if(issilicon(user) || in_range(user, src))
- return 1
- return 0
-
-/obj/machinery/computer/telecomms/traffic/proc/telecomms_check(var/mob/mob)
- //writepanic("[__FILE__].[__LINE__] (no type)([usr ? usr.ckey : ""]) \\/proc/telecomms_check() called tick#: [world.time]")
- if(mob && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && in_range(mob.machine, mob) || issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic))
- return 1
- return 0
+ GLOB.ntsl2_config.Topic(user, href_list, window_id, src)
\ No newline at end of file
diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm
index 7078ba83561..79bd222dc85 100644
--- a/code/game/machinery/transformer.dm
+++ b/code/game/machinery/transformer.dm
@@ -133,7 +133,7 @@
return
// Crossed didn't like people lying down.
- if(isobject(AM))
+ if(isatom(AM))
AM.loc = src.loc
do_transform_mime(AM)
else
@@ -221,7 +221,7 @@
AM.loc = src.loc
irradiate(AM)
- else if(isobject(AM))
+ else if(isatom(AM))
AM.loc = src.loc
scan(AM)
diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm
index 4623a46d7d1..49b2f06d003 100644
--- a/code/modules/admin/admin_investigate.dm
+++ b/code/modules/admin/admin_investigate.dm
@@ -26,6 +26,13 @@
investigate_log_subjects |= subject
F << "[time_stamp()] \ref[src] ([x],[y],[z]) || [src] [message]
"
+/proc/log_investigate(message, subject)
+ if(!message) return
+ var/F = investigate_subject2file(subject)
+ if(!F) return
+ investigate_log_subjects |= subject
+ F << "[time_stamp()] || [message]
"
+
//ADMINVERBS
/client/proc/investigate_show( subject in investigate_log_subjects )
set name = "Investigate"
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index dd0a67021b6..6789e80f924 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -720,7 +720,7 @@ var/list/admin_verbs_ticket = list(
var/list/Lines = file2list("config/admins.txt")
for(var/line in Lines)
var/list/splitline = splittext(line, " - ")
- if(n_lower(splitline[1]) == ckey)
+ if(lowertext(splitline[1]) == ckey)
if(splitline.len >= 2)
rank = ckeyEx(splitline[2])
break
diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm
index f944d015749..abb83b5b1ae 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -937,25 +937,20 @@ Traitors and the like can also be revived with the previous role mostly intact.
/client/proc/reset_all_tcs()
set category = "Admin"
- set name = "Reset Telecomms Scripts"
- set desc = "Blanks all telecomms scripts from all telecomms servers"
+ set name = "Reset NTSL2 Configuration"
+ set desc = "Resets NTSL2 to the default configuration."
if(!check_rights(R_ADMIN))
return
- var/confirm = alert(src, "You sure you want to blank all NTSL scripts?", "Confirm", "Yes", "No")
+ var/confirm = alert(src, "You sure you want to reset NTSL2?", "Confirm", "Yes", "No")
if(confirm != "Yes")
return
- for(var/obj/machinery/telecomms/server/S in telecomms_list)
- var/datum/TCS_Compiler/C = S.Compiler
- S.rawcode = ""
- C.Compile("")
- for(var/obj/machinery/computer/telecomms/traffic/T in GLOB.machines)
- T.storedcode = ""
- log_admin("[key_name(usr)] blanked all telecomms scripts.")
- message_admins("[key_name_admin(usr)] blanked all telecomms scripts.")
- feedback_add_details("admin_verb","RAT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ GLOB.ntsl2_config.reset()
+ log_admin("[key_name(usr)] reset NTSL2 scripts.")
+ message_admins("[key_name_admin(usr)] reset NTSL2 scripts.")
+ feedback_add_details("admin_verb","RAT2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/list_ssds()
set category = "Admin"
diff --git a/code/modules/nano/modules/ert_manager.dm b/code/modules/nano/modules/ert_manager.dm
index 080ed3d56ff..6675cd985d4 100644
--- a/code/modules/nano/modules/ert_manager.dm
+++ b/code/modules/nano/modules/ert_manager.dm
@@ -66,7 +66,7 @@
slots_list += "paranormal: [paranormal_slots]"
if(cyborg_slots > 0)
slots_list += "cyborg: [cyborg_slots]"
- var slot_text = list_implode(slots_list, ", ")
+ var/slot_text = jointext(slots_list, ", ")
notify_ghosts("An ERT is being dispatched. Open positions: [slot_text]")
message_admins("[key_name_admin(usr)] dispatched a [ert_type] ERT. Slots: [slot_text]", 1)
log_admin("[key_name(usr)] dispatched a [ert_type] ERT. Slots: [slot_text]")
diff --git a/code/modules/scripting/AST/AST Nodes.dm b/code/modules/scripting/AST/AST Nodes.dm
deleted file mode 100644
index c8bb3ba9f78..00000000000
--- a/code/modules/scripting/AST/AST Nodes.dm
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- File: AST Nodes
- An abstract syntax tree (AST) is a representation of source code in a computer-friendly format. It is composed of nodes,
- each of which represents a certain part of the source code. For example, an node represents an if statement in the
- script's source code. Because it is a representation of the source code in memory, it is independent of any specific scripting language.
- This allows a script in any language for which a parser exists to be run by the interpreter.
-
- The AST is produced by an object. It consists of a with an arbitrary amount of statements. These statements are
- run in order by an object. A statement may in turn run another block (such as an if statement might if its condition is
- met).
-
- Articles:
- -
-*/
-/*
- Constants: Operator Precedence
- OOP_OR - Logical or
- OOP_AND - Logical and
- OOP_BIT - Bitwise operations
- OOP_EQUAL - Equality checks
- OOP_COMPARE - Greater than, less then, etc
- OOP_ADD - Addition and subtraction
- OOP_MULTIPLY - Multiplication and division
- OOP_POW - Exponents
- OOP_UNARY - Unary Operators
- OOP_GROUP - Parentheses
-*/
-/var/const/OOP_OR = 1 //||
-/var/const/OOP_AND = OOP_OR + 1 //&&
-/var/const/OOP_BIT = OOP_AND + 1 //&, |
-/var/const/OOP_EQUAL = OOP_BIT + 1 //==, !=
-/var/const/OOP_COMPARE = OOP_EQUAL + 1 //>, <, >=, <=
-/var/const/OOP_ADD = OOP_COMPARE + 1 //+, -
-/var/const/OOP_MULTIPLY= OOP_ADD + 1 //*, /, %
-/var/const/OOP_POW = OOP_MULTIPLY + 1 //^
-/var/const/OOP_UNARY = OOP_POW + 1 //!
-/var/const/OOP_GROUP = OOP_UNARY + 1 //()
-
-/*
- Class: node
-*/
-/datum/node/proc/ToString()
- return "[src.type]"
-/*
- Class: identifier
-*/
-/datum/node/identifier
- var/id_name
-
-/datum/node/identifier/New(id)
- . = ..()
- src.id_name = id
-
-/datum/node/identifier/ToString()
- return id_name
-
-/*
- Class: expression
-*/
-/datum/node/expression
-/*
- Class: operator
- See and for subtypes.
-*/
-/datum/node/expression/operator
- var/datum/node/expression/exp
- var/token = "" // Used when giving type mismatches.
- var/tmp/name
- var/tmp/precedence
-
-/datum/node/expression/operator/New()
- .=..()
- if(!src.name)
- src.name = "[src.type]"
-
-/datum/node/expression/operator/ToString()
- return "operator: [name]"
-
-/*
- Class: FunctionCall
-*/
-/datum/node/expression/FunctionCall
- //Function calls can also be expressions or statements.
- var/func_name
- var/datum/node/identifier/object
- var/list/parameters = list()
-
-/*
- Class: literal
-*/
-/datum/node/expression/value/literal
- var/value
-
-/datum/node/expression/value/literal/New(value)
- . = ..()
- src.value = value
-
-/datum/node/expression/value/literal/ToString()
- return src.value
-
-/*
- Class: variable
-*/
-/datum/node/expression/value/variable
- var/datum/node/object //Either a node/identifier or another node/expression/value/variable which points to the object
- var/datum/node/identifier/id
-
-
-/datum/node/expression/value/variable/New(ident)
- . = ..()
- id = ident
- if(istext(id))
- id = new(id)
-
-/datum/node/expression/value/variable/ToString()
- return src.id.ToString()
-
-/*
- Class: reference
-*/
-/datum/node/expression/value/reference
- var/datum/value
-
-/datum/node/expression/value/reference/New(value)
- . = ..()
- src.value = value
-
-/datum/node/expression/value/reference/ToString()
- return "ref: [src.value] ([src.value.type])"
\ No newline at end of file
diff --git a/code/modules/scripting/AST/Blocks.dm b/code/modules/scripting/AST/Blocks.dm
deleted file mode 100644
index 331e49c16fe..00000000000
--- a/code/modules/scripting/AST/Blocks.dm
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- File: Block Types
-*/
-/*
- Class: BlockDefinition
- An object representing a set of actions to perform independently from the rest of the script. Blocks are basically just
- lists of statements to execute which also contain some local variables and methods. Note that since functions are local to a block,
- it is possible to have a function definition inside of any type of block (such as in an if statement or another function),
- and not just in the global scope as in many languages.
-*/
-/datum/node/BlockDefinition
- var/list/statements = new
- var/list/functions = new
- var/list/initial_variables = new
-
-/*
- Proc: SetVar
- Defines a permanent variable. The variable will not be deleted when it goes out of scope.
-
- Notes:
- Since all pre-existing temporary variables are deleted, it is not generally desirable to use this proc after the interpreter has been instantiated.
- Instead, use .
-
- See Also:
- -
-*/
-/datum/node/BlockDefinition/proc/SetVar(name, value)
- initial_variables[name] = value
-
-
-/*
- Class: GlobalBlock
- A block object representing the global scope.
-*/
-//
-/datum/node/BlockDefinition/GlobalBlock/New()
- initial_variables["null"] = null
- return ..()
-
-/*
- Class: FunctionBlock
- A block representing a function body.
-*/
-//
-/datum/node/BlockDefinition/FunctionBlock
\ No newline at end of file
diff --git a/code/modules/scripting/AST/Operators/Binary Operators.dm b/code/modules/scripting/AST/Operators/Binary Operators.dm
deleted file mode 100644
index 8781b6dd416..00000000000
--- a/code/modules/scripting/AST/Operators/Binary Operators.dm
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- File: Binary Operators
-*/
-/*
- Class: binary
- Represents a binary operator in the AST. A binary operator takes two operands (ie x and y) and returns a value.
-*/
-/datum/node/expression/operator/binary
- var/datum/node/expression/exp2
-
-////////// Comparison Operators //////////
-/*
- Class: Equal
- Returns true if x = y.
-*/
-//
-/datum/node/expression/operator/binary/Equal
- token = "=="
- precedence = OOP_EQUAL
-
-/*
-Class: NotEqual
-Returns true if x and y aren't equal.
-*/
-//
-/datum/node/expression/operator/binary/NotEqual
- token = "!="
- precedence = OOP_EQUAL
-
-/*
-Class: Greater
-Returns true if x > y.
-*/
-//
-/datum/node/expression/operator/binary/Greater
- token = ">"
- precedence = OOP_COMPARE
-
-/*
-Class: Less
-Returns true if x < y.
-*/
-//
-/datum/node/expression/operator/binary/Less
- token = "<"
- precedence = OOP_COMPARE
-
-/*
-Class: GreaterOrEqual
-Returns true if x >= y.
-*/
-//
-/datum/node/expression/operator/binary/GreaterOrEqual
- token = ">="
- precedence = OOP_COMPARE
-
-/*
-Class: LessOrEqual
-Returns true if x <= y.
-*/
-//
-/datum/node/expression/operator/binary/LessOrEqual
- token = "<="
- precedence = OOP_COMPARE
-
-
-////////// Logical Operators //////////
-
-/*
-Class: LogicalAnd
-Returns true if x and y are true.
-*/
-//
-/datum/node/expression/operator/binary/LogicalAnd
- token = "&&"
- precedence = OOP_AND
-
-/*
-Class: LogicalOr
-Returns true if x, y, or both are true.
-*/
-//
-/datum/node/expression/operator/binary/LogicalOr
- token = "||"
- precedence = OOP_OR
-
-/*
-Class: LogicalXor
-Returns true if either x or y but not both are true.
-*/
-//
-/datum/node/expression/operator/binary/LogicalXor //Not implemented in nS
- precedence = OOP_OR
-
-
-////////// Bitwise Operators //////////
-
-/*
-Class: BitwiseAnd
-Performs a bitwise and operation.
-
-Example:
-011 & 110 = 010
-*/
-//
-/datum/node/expression/operator/binary/BitwiseAnd
- token = "&"
- precedence = OOP_BIT
-
-/*
-Class: BitwiseOr
-Performs a bitwise or operation.
-
-Example:
-011 | 110 = 111
-*/
-//
-/datum/node/expression/operator/binary/BitwiseOr
- token = "|"
- precedence = OOP_BIT
-
-/*
-Class: BitwiseXor
-Performs a bitwise exclusive or operation.
-
-Example:
-011 xor 110 = 101
-*/
-//
-/datum/node/expression/operator/binary/BitwiseXor
- token = "`"
- precedence = OOP_BIT
-
-
-////////// Arithmetic Operators //////////
-
-/*
-Class: Add
-Returns the sum of x and y.
-*/
-//
-/datum/node/expression/operator/binary/Add
- token = "+"
- precedence = OOP_ADD
-
-/*
-Class: Subtract
-Returns the difference of x and y.
-*/
-//
-/datum/node/expression/operator/binary/Subtract
- token = "-"
- precedence = OOP_ADD
-
-/*
-Class: Multiply
-Returns the product of x and y.
-*/
-//
-/datum/node/expression/operator/binary/Multiply
- token = "*"
- precedence = OOP_MULTIPLY
-
-/*
-Class: Divide
-Returns the quotient of x and y.
-*/
-//
-/datum/node/expression/operator/binary/Divide
- token = "/"
- precedence = OOP_MULTIPLY
-
-/*
-Class: Power
-Returns x raised to the power of y.
-*/
-//
-/datum/node/expression/operator/binary/Power
- token = "^"
- precedence = OOP_POW
-
-/*
-Class: Modulo
-Returns the remainder of x / y.
-*/
-//
-/datum/node/expression/operator/binary/Modulo
- token = "%"
- precedence = OOP_MULTIPLY
diff --git a/code/modules/scripting/AST/Operators/Unary Operators.dm b/code/modules/scripting/AST/Operators/Unary Operators.dm
deleted file mode 100644
index e7cd4b8489a..00000000000
--- a/code/modules/scripting/AST/Operators/Unary Operators.dm
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- File: Unary Operators
-*/
-/*
- Class: unary
- Represents a unary operator in the AST. Unary operators take a single operand (referred to as x below) and return a value.
-*/
-/datum/node/expression/operator/unary
- precedence = OOP_UNARY
-
-/*
- Class: LogicalNot
- Returns !x.
-
- Example:
- !true = false and !false = true
-*/
-//
-/datum/node/expression/operator/unary/LogicalNot
- name = "logical not"
-
-/*
- Class: BitwiseNot
- Returns the value of a bitwise not operation performed on x.
-
- Example:
- ~10 (decimal 2) = 01 (decimal 1).
-*/
-//
-/datum/node/expression/operator/unary/BitwiseNot
- name = "bitwise not"
-
-/*
- Class: Minus
- Returns -x.
-*/
-//
-/datum/node/expression/operator/unary/Minus
- name = "minus"
-
-/*
- Class: group
- A special unary operator representing a value in parentheses.
-*/
-//
-/datum/node/expression/operator/unary/group
- precedence = OOP_GROUP
-
-/datum/node/expression/operator/unary/New(var/datum/node/expression/exp)
- src.exp = exp
- return ..()
diff --git a/code/modules/scripting/AST/Statements.dm b/code/modules/scripting/AST/Statements.dm
deleted file mode 100644
index bae9f3de68c..00000000000
--- a/code/modules/scripting/AST/Statements.dm
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- File: Statement Types
-*/
-/*
- Class: statement
- An object representing a single instruction run by an interpreter.
-*/
-/datum/node/statement
-/*
- Class: FunctionCall
- Represents a call to a function.
-*/
-//
-/datum/node/statement/FunctionCall
- var/func_name
- var/datum/node/identifier/object
- var/list/parameters = new
-
-/*
-Class: FunctionDefinition
-Defines a function.
-*/
-//
-/datum/node/statement/FunctionDefinition
- var/func_name
- var/list/parameters = new
- var/datum/node/BlockDefinition/FunctionBlock/block
-
-/*
-Class: VariableAssignment
-Sets a variable in an accessible scope to the given value if one exists, otherwise initializes a new local variable to the given value.
-
-Notes:
-If a variable with the same name exists in a higher block, the value will be assigned to it. If not,
-a new variable is created in the current block. To force creation of a new variable, use .
-
-See Also:
--
-*/
-//
-/datum/node/statement/VariableAssignment
- var/datum/node/identifier/object
- var/datum/node/identifier/var_name
- var/datum/node/expression/value
-
-/*
-Class: VariableDeclaration
-Intializes a local variable to a null value.
-
-See Also:
--
-*/
-//
-/datum/node/statement/VariableDeclaration
- var/datum/node/identifier/object
- var/datum/node/identifier/var_name
-
-/*
-Class: IfStatement
-*/
-//
-/datum/node/statement/IfStatement
- var/skip = 0
- var/datum/node/BlockDefinition/block
- var/datum/node/BlockDefinition/else_block //may be null
- var/datum/node/expression/cond
- var/datum/node/statement/else_if
-
-/datum/node/statement/IfStatement/ElseIf
-
-/*
-Class: WhileLoop
-Loops while a given condition is true.
-*/
-//
-/datum/node/statement/WhileLoop
- var/datum/node/BlockDefinition/block
- var/datum/node/expression/cond
-
-/*
-Class: ForLoop
-Loops while test is true, initializing a variable, increasing the variable
-*/
-/datum/node/statement/ForLoop
- var/datum/node/BlockDefinition/block
- var/datum/node/expression/test
- var/datum/node/expression/init
- var/datum/node/expression/increment
-
-/*
-Class: BreakStatement
-Ends a loop.
-*/
-//
-/datum/node/statement/BreakStatement
-
-/*
-Class: ContinueStatement
-Skips to the next iteration of a loop.
-*/
-//
-/datum/node/statement/ContinueStatement
-
-/*
-Class: ReturnStatement
-Ends the function and returns a value.
-*/
-//
-/datum/node/statement/ReturnStatement
- var/datum/node/expression/value
\ No newline at end of file
diff --git a/code/modules/scripting/Errors.dm b/code/modules/scripting/Errors.dm
deleted file mode 100644
index 63538c3f18f..00000000000
--- a/code/modules/scripting/Errors.dm
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- File: Errors
-*/
-/*
- Class: scriptError
- An error scanning or parsing the source code.
-*/
-/datum/scriptError
-/*
- Var: message
- A message describing the problem.
-*/
- var/message
-
-/datum/scriptError/New(msg = null)
- if(msg)message = msg
-
-/datum/scriptError/BadToken
- message = "Unexpected token: "
- var/datum/token/token
-
-/datum/scriptError/BadToken/New(datum/token/t)
- token = t
- if(t && t.line)
- message = "[t.line]: [message]"
-
- if(istype(t))
- message += "[t.value]"
-
- else
- message += "[t]"
-
-/datum/scriptError/InvalidID
- parent_type = /datum/scriptError/BadToken
- message = "Invalid identifier name: "
-
-/datum/scriptError/ReservedWord
- parent_type = /datum/scriptError/BadToken
- message = "Identifer using reserved word: "
-
-/datum/scriptError/BadNumber
- parent_type = /datum/scriptError/BadToken
- message = "Bad number: "
-
-/datum/scriptError/BadReturn
- var/datum/token/token
- message = "Unexpected return statement outside of a function."
-
-/datum/scriptError/BadReturn/New(datum/token/t)
- src.token = t
-
-/datum/scriptError/EndOfFile
- message = "Unexpected end of file."
-
-/datum/scriptError/ExpectedToken
- message = "Expected: '"
-
-/datum/scriptError/ExpectedToken/New(id, datum/token/T)
- if(T && T.line)
- message = "[T.line]: [message]"
-
- message += "[id]'. "
-
- if(T)
- message += "Found '[T.value]'."
-
-
-/datum/scriptError/UnterminatedComment
- message = "Unterminated multi-line comment statement: expected */"
-
-/datum/scriptError/DuplicateFunction/New(name, datum/token/t)
- message = "Function '[name]' defined twice."
-
-/datum/scriptError/ParameterFunction
- message = "You cannot use a function inside a parameter."
-
-/datum/scriptError/ParameterFunction/New(datum/token/t)
- var/line = "?"
- if(t)
- line = t.line
- message = "[line]: [message]"
-
-/*
- Class: runtimeError
- An error thrown by the interpreter in running the script.
-*/
-/datum/runtimeError
- var/name
-/*
- Var: message
- A basic description as to what went wrong.
-*/
- var/message
- var/datum/stack/stack
-/*
- Proc: ToString
- Returns a description of the error suitable for showing to the user.
-*/
-/datum/runtimeError/proc/ToString()
- . = "[name]: [message]"
- if(!stack.Top())
- return
-
- . += "\nStack:"
- while(stack.Top())
- var/datum/node/statement/FunctionCall/stmt = stack.Pop()
- . += "\n\t [stmt.func_name]()"
-
-/datum/runtimeError/TypeMismatch
- name = "TypeMismatchError"
-
-/datum/runtimeError/TypeMismatch/New(op, a, b)
- message = "Type mismatch: '[a]' [op] '[b]'"
-
-/datum/runtimeError/TypeMismatch/unary/New(op, a)
- message = "Type mismatch: [op]'[a]'"
-
-/datum/runtimeError/TypeMismatch/New(op, a, b)
- message = "Type mismatch: '[a]' [op] '[b]'"
-
-/datum/runtimeError/UnexpectedReturn
- name = "UnexpectedReturnError"
- message = "Unexpected return statement."
-
-/datum/runtimeError/UnknownInstruction
- name = "UnknownInstructionError"
- message = "Unknown instruction type. This may be due to incompatible compiler and interpreter versions or a lack of implementation."
-
-/datum/runtimeError/UndefinedVariable
- name = "UndefinedVariableError"
-
-/datum/runtimeError/UndefinedVariable/New(variable)
- message = "Variable '[variable]' has not been declared."
-
-/datum/runtimeError/UndefinedFunction
- name = "UndefinedFunctionError"
-
-/datum/runtimeError/UndefinedFunction/New(function)
- message = "Function '[function]()' has not been defined."
-
-/datum/runtimeError/DuplicateVariableDeclaration
- name = "DuplicateVariableError"
-
-/datum/runtimeError/DuplicateVariableDeclaration/New(variable)
- message="Variable '[variable]' was already declared."
-
-/datum/runtimeError/IterationLimitReached
- name = "MaxIterationError"
- message = "A loop has reached its maximum number of iterations."
-
-/datum/runtimeError/RecursionLimitReached
- name = "MaxRecursionError"
- message = "The maximum amount of recursion has been reached."
-
-/datum/runtimeError/DivisionByZero
- name = "DivideByZeroError"
- message = "Division by zero attempted."
-
-/datum/runtimeError/MaxCPU
- name = "MaxComputationalUse"
- message = "Maximum amount of computational cycles reached (>= 1000)."
-
-/datum/runtimeError/VectorLimit
- name = "VectorSizeOverflow"
- message = "Maximum vector size reached"
-
-/datum/runtimeError/StringLimit
- name = "StringSizeOverflow"
- message = "Maximum string size reached"
diff --git a/code/modules/scripting/Implementations/Telecomms.dm b/code/modules/scripting/Implementations/Telecomms.dm
deleted file mode 100644
index e8fa2ed19b6..00000000000
--- a/code/modules/scripting/Implementations/Telecomms.dm
+++ /dev/null
@@ -1,352 +0,0 @@
-/* --- Traffic Control Scripting Language --- */
- // Nanotrasen TCS Language - Made by Doohl
-
-/datum/n_Interpreter/TCS_Interpreter
- var/datum/TCS_Compiler/Compiler
-
-/datum/n_Interpreter/TCS_Interpreter/HandleError(datum/runtimeError/e)
- Compiler.Holder.add_entry(e.ToString(), "Execution Error")
-
-/datum/n_Interpreter/TCS_Interpreter/GC()
- ..()
- Compiler = null
-
-/datum/TCS_Compiler
- var/datum/n_Interpreter/TCS_Interpreter/interpreter
- var/obj/machinery/telecomms/server/Holder // the server that is running the code
- var/ready = 1 // 1 if ready to run code
-
- /* -- Set ourselves to Garbage Collect -- */
-
-/datum/TCS_Compiler/proc/GC()
- Holder = null
- if(interpreter)
- interpreter.GC()
-
-
-//temp
-/datum/TCS_Compiler
- var/datum/n_scriptOptions/nS_Options/options
- var/datum/n_Scanner/nS_Scanner/scanner
- var/list/tokens
- var/datum/n_Parser/nS_Parser/parser
- var/datum/node/BlockDefinition/GlobalBlock/program
-
- /* -- Compile a raw block of text -- */
-
-/datum/TCS_Compiler/proc/Compile(list/code)
- options = new()
- scanner = new(code, options)
- tokens = scanner.Scan()
- parser = new(tokens, options)
- program = parser.Parse()
-
- var/list/returnerrors = list()
-
- returnerrors += scanner.errors
- returnerrors += parser.errors
-
- if(returnerrors.len)
- return returnerrors
-
- interpreter = new(program)
- interpreter.persist = 1
- interpreter.Compiler= src
-
- return returnerrors
-
-/* -- Execute the compiled code -- */
-
-/datum/TCS_Compiler/proc/Run(var/datum/signal/signal)
- if(!ready)
- return
-
- if(!interpreter)
- return
-
- interpreter.container = src
-
- interpreter.CreateGlobalScope() // Reset the variables.
- interpreter.curScope = interpreter.globalScope
-
- interpreter.SetVar("PI", 3.141592653) // value of pi
- interpreter.SetVar("E", 2.718281828) // value of e
- interpreter.SetVar("SQURT2", 1.414213562) // value of the square root of 2
- interpreter.SetVar("FALSE", 0) // boolean shortcut to 0
- interpreter.SetVar("false", 0) // boolean shortcut to 0
- interpreter.SetVar("TRUE", 1) // boolean shortcut to 1
- interpreter.SetVar("true", 1) // boolean shortcut to 1
-
- interpreter.SetVar("NORTH", NORTH) // NORTH (1)
- interpreter.SetVar("SOUTH", SOUTH) // SOUTH (2)
- interpreter.SetVar("EAST", EAST) // EAST (4)
- interpreter.SetVar("WEST", WEST) // WEST (8)
-
- // Channel macros
- interpreter.SetVar("$common", PUB_FREQ)
- interpreter.SetVar("$science", SCI_FREQ)
- interpreter.SetVar("$command", COMM_FREQ)
- interpreter.SetVar("$medical", MED_FREQ)
- interpreter.SetVar("$engineering", ENG_FREQ)
- interpreter.SetVar("$security", SEC_FREQ)
- interpreter.SetVar("$supply", SUP_FREQ)
- interpreter.SetVar("$service", SRV_FREQ)
-
- // Signal data
-
- interpreter.SetVar("$content", signal.data["message"])
- interpreter.SetVar("$freq", signal.frequency)
- interpreter.SetVar("$source", signal.data["name"])
- interpreter.SetVar("$job", signal.data["job"])
- interpreter.SetVar("$sign", signal)
- interpreter.SetVar("$pass", !(signal.data["reject"])) // if the signal isn't rejected, pass = 1; if the signal IS rejected, pass = 0
-
- var/datum/language/speaking = signal.data["language"]
- if(speaking)
- interpreter.SetVar("$language", speaking.name)
- else
- interpreter.SetVar("$language", "Unknown")
-
- // Set up the script procs
-
- /*
- -> Send another signal to a server
- @format: broadcast(content, frequency, source, job)
-
- @param content: Message to broadcast
- @param frequency: Frequency to broadcast to
- @param source: The name of the source you wish to imitate. Must be stored in stored_names list.
- @param job: The name of the job.
- */
- interpreter.SetProc("broadcast", "tcombroadcast", signal, list("message", "freq", "source", "job"))
-
- /*
- -> Store a value permanently to the server machine (not the actual game hosting machine, the ingame machine)
- @format: mem(address, value)
-
- @param address: The memory address (string index) to store a value to
- @param value: The value to store to the memory address
- */
- interpreter.SetProc("mem", "mem", signal, list("address", "value"))
-
- /*
- -> Delay code for a given amount of deciseconds
- @format: sleep(time)
-
- @param time: time to sleep in deciseconds (1/10th second)
- */
- interpreter.SetProc("sleep", "delay", signal, list("time"))
-
- /*
- -> Replaces a string with another string
- @format: replace(string, substring, replacestring)
-
- @param string: the string to search for substrings (best used with $content$ constant)
- @param substring: the substring to search for
- @param replacestring: the string to replace the substring with
-
- */
- interpreter.SetProc("replace", /proc/n_replacetext)
-
- /*
- -> Locates an element/substring inside of a list or string
- @format: find(haystack, needle, start = 1, end = 0)
-
- @param haystack: the container to search
- @param needle: the element to search for
- @param start: the position to start in
- @param end: the position to end in
-
- */
- interpreter.SetProc("find", /proc/smartfind)
-
- /*
- -> Finds the length of a string or list
- @format: length(container)
-
- @param container: the list or container to measure
-
- */
- interpreter.SetProc("length", /proc/smartlength)
-
- /* -- Clone functions, carried from default BYOND procs --- */
-
- // vector namespace
- interpreter.SetProc("vector", /proc/n_list)
- interpreter.SetProc("at", /proc/n_listpos)
- interpreter.SetProc("copy", /proc/n_listcopy)
- interpreter.SetProc("push_back", /proc/n_listadd)
- interpreter.SetProc("remove", /proc/n_listremove)
- interpreter.SetProc("cut", /proc/n_listcut)
- interpreter.SetProc("swap", /proc/n_listswap)
- interpreter.SetProc("insert", /proc/n_listinsert)
-
- interpreter.SetProc("pick", /proc/n_pick)
- interpreter.SetProc("prob", /proc/prob_chance)
- interpreter.SetProc("substr", /proc/docopytext)
-
- interpreter.SetProc("shuffle", /proc/shuffle)
- interpreter.SetProc("uniquevector", /proc/uniquelist)
-
- interpreter.SetProc("text2vector", /proc/n_splittext)
- interpreter.SetProc("vector2text", /proc/n_jointext)
-
- // Donkie~
- // Strings
- interpreter.SetProc("lower", /proc/n_lower)
- interpreter.SetProc("upper", /proc/n_upper)
- interpreter.SetProc("explode", /proc/string_explode)
- interpreter.SetProc("implode", /proc/n_jointext)
- interpreter.SetProc("repeat", /proc/n_repeat)
- interpreter.SetProc("reverse", /proc/reverse_text)
- interpreter.SetProc("tonum", /proc/n_str2num)
- interpreter.SetProc("capitalize", /proc/capitalize)
- interpreter.SetProc("replacetextEx",/proc/n_replacetextEx)
-
- // Numbers
- interpreter.SetProc("tostring", /proc/n_num2str)
- interpreter.SetProc("sqrt", /proc/n_sqrt)
- interpreter.SetProc("abs", /proc/n_abs)
- interpreter.SetProc("floor", /proc/n_floor)
- interpreter.SetProc("ceil", /proc/n_ceiling)
- interpreter.SetProc("round", /proc/n_round)
- interpreter.SetProc("clamp", /proc/n_clamp)
- interpreter.SetProc("inrange", /proc/n_isInRange)
- interpreter.SetProc("rand", /proc/rand_chance)
- interpreter.SetProc("arctan", /proc/Atan2)
- interpreter.SetProc("lcm", /proc/n_lcm)
- interpreter.SetProc("gcd", /proc/Gcd)
- interpreter.SetProc("mean", /proc/Mean)
- interpreter.SetProc("root", /proc/n_root)
- interpreter.SetProc("sin", /proc/n_sin)
- interpreter.SetProc("cos", /proc/n_cos)
- interpreter.SetProc("arcsin", /proc/n_asin)
- interpreter.SetProc("arccos", /proc/n_acos)
- interpreter.SetProc("tan", /proc/n_tan)
- interpreter.SetProc("csc", /proc/n_csc)
- interpreter.SetProc("cot", /proc/n_cot)
- interpreter.SetProc("sec", /proc/n_sec)
- interpreter.SetProc("todegrees", /proc/n_toDegrees)
- interpreter.SetProc("toradians", /proc/n_toRadians)
- interpreter.SetProc("lerp", /proc/Lerp)
- interpreter.SetProc("max", /proc/n_max)
- interpreter.SetProc("min", /proc/n_min)
-
- // End of Donkie~
-
- // Time
- interpreter.SetProc("time", /proc/time)
- interpreter.SetProc("timestamp", /proc/gameTimestamp)
-
- // Run the compiled code
- interpreter.Run()
-
- // Backwards-apply variables onto signal data
- /* sanitize EVERYTHING. fucking players can't be trusted with SHIT */
-
- /* Okay, so, the original 'sanitizing' code... did fucking nothing. Then PJB fixed it, which means no HTML.
- But I like HTML, so back to no sanitizing.*/
-
- var/message = interpreter.GetVar("$content")
- var/regex/bannedTags = new ("(
+
+
+
+
+
+

+
Home
+
Filtering
+
Regex
+
Firewall
+
1337
+
NTTC
+
+
+
+
+
+
+
+
+