NT Script: Difference between revisions

93 bytes added ,  09:07, 16 June 2023
m
Added additional info to the "time" function description
No edit summary
m (Added additional info to the "time" function description)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Needs revision | reason = Scripts have currently been removed from the game due to PR #12105 as of 4 of october of 2015.}}
The NT Scripting Language(NT Script, or NTSL) is a new piece of technology being pushed by NT Tech Department to standardize programming and communication of all Nanotrasen-grade electronic devices. Its syntax is a mixture of PHP, C++, and JavaScript. Most implementations of NT Script are not object-oriented and do not allow the definition of classes, instead, rely on ROBUST(tm) memory management system to store entities in a dynamic data tree. NT Script does allow the in-line definition of functions, however.
The NT Scripting Language(NT Script, or NTSL) is a new piece of technology being pushed by NT Tech Department to standardize programming and communication of all Nanotrasen-grade electronic devices. Its syntax is a mixture of PHP, C++, and JavaScript. Most implementations of NT Script are not object-oriented and do not allow the definition of classes, instead, rely on ROBUST(tm) memory management system to store entities in a dynamic data tree. NT Script does allow the in-line definition of functions, however.


Line 312: Line 311:
| bgcolor="#AAAAAA" | || bgcolor="#AAAAAA" | || bgcolor="#AAAAAA" |
| bgcolor="#AAAAAA" | || bgcolor="#AAAAAA" | || bgcolor="#AAAAAA" |
|-
|-
| time() || number || Returns the real time of the server in a number. You can then use this to see how much time has passed since the code has last been run via mem().
| time() || number || Returns the real time of the server as a number. Time is in deciseconds, to convert into seconds divide by 10. You can then use this to see how much time has passed since the code has last been run via mem().
|-
|-
| bgcolor="#AAAAAA" | || bgcolor="#AAAAAA" | || bgcolor="#AAAAAA" |
| bgcolor="#AAAAAA" | || bgcolor="#AAAAAA" | || bgcolor="#AAAAAA" |
Line 319: Line 318:
|}
|}


=== Prefab Variables ===
===Prefab Variables===


  '''PI''' = 3.141592653;
  '''PI''' = 3.141592653;
Line 338: Line 337:
  '''channels.security''' = 1359
  '''channels.security''' = 1359
  '''channels.supply''' = 1347
  '''channels.supply''' = 1347
'''channels.service''' = 1349
   
   
  '''languages.HUMAN''' = 1
  '''languages.human''' = 1
  '''languages.MONKEY''' = 2
  '''languages.monkey''' = 2
  '''languages.ALIEN''' = 4
  '''languages.robot''' = 4
  '''languages.ROBOT''' = 8
  '''languages.polysmorph''' = 8
  '''languages.SLIME''' = 16
  '''languages.draconic''' = 16
  '''languages.DRONE''' = 32
  '''languages.beachtongue''' = 32
    
    
  '''filter_types.robot''' = "robot"
  '''filter_types.robot''' = "robot"
Line 375: Line 375:
  sig.language // the language of the signal. Can be any of HUMAN, MONKEY, ALIEN, ROBOT, SLIME or DRONE. Or a combination of them
  sig.language // the language of the signal. Can be any of HUMAN, MONKEY, ALIEN, ROBOT, SLIME or DRONE. Or a combination of them
  sig.filters  // The voice filter of the signal. Includes bolding, italics, as well as silicon and wacky fonts. '''These must be given as a list!'''
  sig.filters  // The voice filter of the signal. Includes bolding, italics, as well as silicon and wacky fonts. '''These must be given as a list!'''
sig.pass    // Whether the signal will be broadcasted. Is a boolean, set to 0 to stop the signal from passing.
  sig.say      // The verb used in a radio messages ending in "."
  sig.say      // The verb used in a radio messages ending in "."
  sig.ask   // The verb used in messages ending in "?". Example: COMMON SERVER asks, "Why?"
  sig.ask   // The verb used in messages ending in "?". Example: COMMON SERVER asks, "Why?"