diff --git a/code/game/machinery/telecomms/ntsl2.dm b/code/game/machinery/telecomms/ntsl2.dm
index ec1e5b923ca..3404a662296 100644
--- a/code/game/machinery/telecomms/ntsl2.dm
+++ b/code/game/machinery/telecomms/ntsl2.dm
@@ -1,3 +1,4 @@
+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
@@ -58,6 +59,25 @@
// 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 all_languages)
var/datum/language/L = all_languages[language]
@@ -108,6 +128,12 @@
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)
@@ -152,11 +178,6 @@
new_message = start.Replace(original, replacePattern)
signal.data["message"] = new_message
- // Firewall
- if(islist(firewall) && firewall.len > 0)
- if(firewall.Find(signal.data["name"]))
- signal.data["reject"] = 1
-
// Check the message for forbidden HTML (REMOVE THIS IF YOU START STRIPPING HTML IN REGEX)
var/regex/bannedTags = new("(
- 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/telecomms/traffic_control_ntsl2.dm b/code/game/machinery/telecomms/traffic_control_ntsl2.dm
deleted file mode 100644
index e48b52000f1..00000000000
--- a/code/game/machinery/telecomms/traffic_control_ntsl2.dm
+++ /dev/null
@@ -1,51 +0,0 @@
-GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new())
-/obj/machinery/computer/telecomms/traffic
- name = "telecommunications traffic control"
-
- 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)
-
-/obj/machinery/computer/telecomms/traffic/interact(mob/user)
- if(stat & (BROKEN|NOPOWER))
- return 0
-
- 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
-
- 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(..())
- return 1
-
- var/mob/user = usr
- if(!istype(user) || !user.client)
- 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 45294f01286..29f78c124c2 100644
--- a/code/game/machinery/transformer.dm
+++ b/code/game/machinery/transformer.dm
@@ -134,7 +134,7 @@
return
// Crossed didn't like people lying down.
- if(isobject(AM))
+ if(isatom(AM))
AM.loc = src.loc
do_transform_mime(AM)
else
@@ -222,7 +222,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_verbs.dm b/code/modules/admin/admin_verbs.dm
index 91c237a0328..d7ce35b6d72 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -721,7 +721,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 cbada74eee1..90b95aa3d1b 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -886,23 +886,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("")
- 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 d954c36ee2d..09e54db366c 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 a24a9522b38..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 ("(