getGlobal()
From Hack Wars Wiki
| Information for free function getGlobal() | |
| Function | getGlobal(int key) |
| API | Attacking, Banking, FTP, Watch, HTTP, ?Challenges?, Hacktendo |
| Description | Returns the global variable associated with the key. use setGlobal() to set values |
- note data is sometimes returned without a type (int,string,float,boolean) so you have to force a type to be sure (see examples)
Example
As string
string foo = (string)getGlobal(1); string bar = getGlobal(1) + ""; |
As int
int foo = (int)getGlobal(2); int bar = getGlobal(2) * 1; |
As float
float foo = (float)getGlobal(3); float bar = getGlobal(3) * 1; |
As boolean
boolean foo = (boolean)getGlobal(4); boolean bar = (getGlobal(4) == true); |
All of the above will force the datatype (but not convert from one to another)
