Skip to content

Deprecated Server Script Functions

ArchZombie edited this page Jun 16, 2013 · 14 revisions

These functions are old and shouldn't be used, but they are kept so old scripts continues to work.

Deprecated timer functions

sys.setTimer, sys.unsetTimer, and sys.unsetAllTimers do everything this massive conglomerate of functions did.

  • sys.callLater(script, seconds) runs the script given in parameter seconds later.
  • sys.callQuickly(script, milliseconds) works like callLater() but accepts milliseconds as parameter instead of seconds. Don't overdo it.
  • sys.delayedCall(func, seconds) works like callLater() but accepts a function without arguments as a first parameter instead of a string.
  • sys.quickCall
  • sys.intervalTimer
  • sys.intervalCall
  • sys.stopTimer

Deprecated settings functions

On windows, storing things in the registry is not a good idea, all servers on a username share this namespace! At least on other operating system's it's stored in a file, but this isn't guaranteed!

The current, non-deprecated functions all start with a new argument filename which is the file used to store the configuration settings.

  • sys.getVal(key) returns the variable stored in the registry with that key.
  • sys.saveVal(key, value) saves a variable in the registry so it'll still be there after a server restart.
  • sys.getValKeys() returns an array of keys stored (without values) in the registry.
  • sys.removeVal(key) deletes the variable in the registry.

Deprecated time

Deprecated in favor of JavaScript native code, e.g., ((+new Date)/1000)|0 or etc.

  • sys.time() returns the number of seconds elapsed since 1 Jan 1970.