Globals

From Hack Wars Wiki

Jump to: navigation, search

Globals also known as global variables are a variable that is stored outside of the scripts as a sort of system variable (in hackwars case in the save file). This allows you to make any type of hackscript and include them, even use them to share data between each other and make the scripts more dynamic. For example a watch could set the global[0] as the last IP to attack you, and your HTTP output this on your website. Currently there are 20 globals that users can access within the game (ranging from 0-19), which can be accessed by any hackscript language using 3 API's that are available:

The datatype of the globals within hackwars is "object", this means they have no real data type (though it can be set using parseInt and alike), which allows you to run less OPs in a script if you know it will already be an int for example. The costs of using globals is nothing, no CPU usage increase and no $0 needed to compile.

Personal tools