mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 11:13:16 +00:00
More work on NTSL and world/Topic()
Includes a plethora of new NTSL functions, courtesy of Donkieyo (thread: http://nanotrasen.com/phpBB3/viewtopic.php?f=16&t=8153) Bugfix for a weird runtime generated when an AI tries to interact with telecomms machinery directly. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3347 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -157,6 +157,25 @@
|
||||
interpreter.SetProc("prob", /proc/prob_chance)
|
||||
interpreter.SetProc("substr", /proc/docopytext)
|
||||
|
||||
// Donkie~
|
||||
// Strings
|
||||
interpreter.SetProc("lower", /proc/n_lower)
|
||||
interpreter.SetProc("upper", /proc/n_upper)
|
||||
interpreter.SetProc("explode", /proc/string_explode)
|
||||
interpreter.SetProc("repeat", /proc/n_repeat)
|
||||
interpreter.SetProc("reverse", /proc/n_reverse)
|
||||
interpreter.SetProc("tonum", /proc/n_str2num)
|
||||
|
||||
// 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_ceil)
|
||||
interpreter.SetProc("round", /proc/n_round)
|
||||
interpreter.SetProc("clamp", /proc/n_clamp)
|
||||
interpreter.SetProc("inrange", /proc/n_inrange)
|
||||
// End of Donkie~
|
||||
|
||||
|
||||
// Run the compiled code
|
||||
@@ -165,7 +184,7 @@
|
||||
// Backwards-apply variables onto signal data
|
||||
/* sanitize EVERYTHING. fucking players can't be trusted with SHIT */
|
||||
|
||||
signal.data["message"] = trim(copytext(sanitize(interpreter.GetVar("$content")), 1, MAX_MESSAGE_LEN))
|
||||
signal.data["message"] = interpreter.GetVar("$content")
|
||||
signal.frequency = interpreter.GetVar("$freq")
|
||||
|
||||
var/setname = ""
|
||||
@@ -173,7 +192,7 @@
|
||||
if(interpreter.GetVar("$source") in S.stored_names)
|
||||
setname = interpreter.GetVar("$source")
|
||||
else
|
||||
setname = "<i>[trim(copytext(sanitize(interpreter.GetVar("$source")), 1, MAX_MESSAGE_LEN))]</i>"
|
||||
setname = "<i>[interpreter.GetVar("$source")]</i>"
|
||||
|
||||
if(signal.data["name"] != setname)
|
||||
signal.data["realname"] = setname
|
||||
|
||||
Reference in New Issue
Block a user