Hack Wars is the revolutionary new MMO Game where players compete in a war of all against all. With its in-game programming and merchant tools, players create, buy and sell programs to earn, steal and hack their way to the top. Level up your skills to enhance your ability to attack and defend against other players in an attempt to hack their system and get more cash. Create your own malicious programs for use or sale in your online store, which appears on your personal webpage. Discuss your strategies in the online forum. As you level up, you’ll be able to upgrade your hardware to protect your system and forge stronger attacks. Defend against attacks while offline by upgrading your security, and gain defense experience. The Hack Wars system creates a unique environment where the norm is malicious intent—no one can be trusted, and that includes you.
This manual will help you learn how to defeat your opponents and become the worlds greatest hacker.
Welcome to Hack Wars! This manual begins with a broad overview of some of the most important features in the game. Make sure you click on the links on the right and read the more specific information provided regarding each of the game’s major features. Once you've picked up the basics give it a try online with other players. If you are having trouble and need a hint there are always player in the in-game Help chat. You can also search this manual by using the site search tool on the left.
The Store, which can be accessed through the Web Browser, offers rudimentary applications for free. At the very least, a Basic Bank application is necessary to start playing Hack Wars. In the Store, you can also purchase hardware and firewalls (these generally require that you reach a certain total level before they can be purchased).
Once you have purchased the basic applications from the store, you can install them using the Port Manager (System — Administration — Port Management).
In the above screen shot, we see an example of a Banking script installed on port 2, which is currently On, with no Firewall, at 100% health, and which is also a Dummy port.
Websites in Hack Wars serve several functions. In Hack Wars you receive a daily pay from your website. To receive this pay you must have an HTTP program and Banking program installed, and the ports must be On (and not dummy ports). You can upload compiled programs, firewalls, and images using the Store FTP to sell on your website. Your personal website is indexed in the Hack Wars search engine, and players can use this search engine to find merchants to buy from and to find viable targets for attacks. An HTTP port itself can be targeted by an attack, and players can hijack your daily pay.
You can edit your personal website by using the HTML Editor tool. You can use HTML and CSS syntax to create a complex website – for those who aren’t technically savvy, a website can also consist simply of text. Most importantly, your website should describe your store, so that other players can use the search engine to find your goods and services.
To access and modify your personal settings go to System — Administration — Personal Settings. In your personal settings you can select an image for your character in Hack Wars, set a description for yourself, view what challenges you have completed, and see what hardware you have installed.
You can view other players personal settings by clicking on their name in the forums from within the game — doing this also provides shortcuts to attack this player.
An FTP application is used to transfer files to your Store Directory (for selling on your website), and for transferring files to your Public Directory (this directory can be used to share files with your friends) – make sure to set your public FTP password, so that only your friends can access the files. You must have an FTP program installed to sell items in your website’s store. Like Attacking, Banking, and HTTP programs, an FTP program must be installed on a port and turned on before it will be functional.
If a player successfully destroys an FTP port (along with the regular options of peeking at code and being able to install their own malicious FTP application) they will be presented with the option of stealing a single file from the victim’s Public directory.
To make some extra cash and experience, a player can accept various programming challenges. These challenges describe inputs and the expected output. A programmer using this information implements an application using the Challenges API. Challenges are a good way for a novice to get a handle on programming. At the same time advanced programmers can put their skills to the test on the higher level challenges.
As a player levels up, they can purchase better CPUs, Hard Drives, and Memory for their computer from the Store in the Web Browser application. You can also receive PCI and AGP cards from NPC drops, or purchase them from other players/the game store -- these cards give you various other bonuses: extra damage, extra CPU points, immunities, etc. To equip your hardware go to System->Administration->Equipment Manager
Every application, watch, or firewall that a player installs takes a certain portion of CPU load. As a player levels up they can purchase better CPUs to allow them to run more applications simultaneously.
A player can only store a limited number of files on their hard drive (this includes their Store and Public directories). As a player levels up they can purchase better Hard Drives to increase the amount of space available.
By purchasing better memory, a player can install applications on a larger range of ports (to start out a player only has 8 ports to install applications on). Memory also determines how many watches you can have running at any given time.
Additional upgrades for your computer (in the form of PCI and AGP cards) are dropped by NPCs. They can be purchased from the game store, or from other players.
Still have some questions?
Make sure you read the more detailed descriptions of the game’s various features provided throughout the manual.
You can also use this websites' forums, and talk to other players inside the game, many of whom will surely be glad to help you with your troubles.
Hack Wars is unique in that its in game crafting takes the form of actual programming — you can effectively play the game without any prior knowledge of programming, but crafting applications can have lucrative financial benefits. As you level up your programmable skills (Attacking,Watches,Banking) , you will be presented with powerful new API ‘s. These can be used to create compiled applications to sell in your store, or perhaps for more dubious purposes.
When programming Hack Wars applications you can use a few helper methods which cost no money to compile and absorb no CPU load.
| Method | Required Level | Compile Price | CPU Usage | Description |
| equal(string s1,string s2) | N/A | $0 | 0 | Returns a boolean representing whether or not s1 and s2 are equal. |
| printf(string s,args…) | N/A | $0 | 0 | Returns the string s with the values of the variables provided in args appended onto it. Usage: printf("Value = %s Name = %s",30.0,"Ben"); |
| rand() | N/A | $0 | 0 | Returns a random floating point value between 0 and 1. |
| intValue(float i) | N/A | $0 | 0 | Given a float it returns the integer value of it. |
| floatValue(int i) | N/A | $0 | 0 | Given an int it returns the float value of it. |
| indexOf(string s1,string s2,int n) | N/A | $0 | 0 | Searches for nth occurrence of s2 in s1. |
| replaceAll(string s1,string s2,string s3) | N/A | $0 | 0 | Replaces all instances of s2 in s1 with s3. |
| setGlobal(int index,variable var) | N/A | $0 | 0 | Sets the value of one of your 20 global variables. These can be used between scripts, and save with your account. They can take on the value of integer, boolean, string, or float. |
| getGlobal(int index) | N/A | $0 | 0 | Fetches the variable stored in the global variable array indicated by index. |
| parseFloat(string s) | N/A | $0 | 0 | Attempts to parse a floating point number based on the string input.. |
| parseInt(string s) | N/A | $0 | 0 | Attempts to parse an integer value from the string provided. |
| toUpper(string s) | N/A | $0 | 0 | Returns an upper-case version of the string provided. |
| toLower(string s) | N/A | $0 | 0 | Returns a lower case version of the string provided. |
| isGlobalSet(int index) | N/A | $0 | 0 | Returns whether the global variable indicated by index is set. |
| isGetVariableSet(string key) | N/A | $0 | 0 | Returns whether the resource indicated by key has been set. |
| isParameterSet(string key) | N/A | $0 | 0 | Returns whether the resource indicated by key has been set. |
| isTriggerParameterSet(string key) | N/A | $0 | 0 | Returns whether the resource indicated by key has been set. |
To help a player level up, and to make some cash, Hack Wars offers a series of programming challenges. These challenges have a an API specifically designed to create and solve interesting (and sometimes difficult) challenges. Please note that while writing challenge code you also have access to the Helper Functions.
| Method | Required Level | Compile Price | CPU Usage | Description |
| strlen(string s) | N/A | $0 | 0 | Returns an integer representing the length of a string. |
| sqrt(float f) | N/A | $0 | 0 | Returns the square root of the float provided. |
| abs(float f) | N/A | $0 | 0 | Returns the absolute value of the float provided. |
| ln(float) | N/A | $0 | 0 | Returns the natural logarithm of the float provided. |
| atan(float) | N/A | $0 | 0 | Returns the arc-tangent of the floating point number provided. |
| acos(float) | N/A | $0 | 0 | Returns the arc-cosine of the floating point number provided. |
| asin(float) | N/A | $0 | 0 | Returns the arc-sine of the floating point number provided. |
| tan(float) | N/A | $0 | 0 | Returns the tangent of the floating point number provided. |
| cos(float) | N/A | $0 | 0 | Returns the cosine of the floating point number provided. |
| sin(float) | N/A | $0 | 0 | Returns the sine of the floating point number provided. |
| getE() | N/A | $0 | 0 | Returns the mathematical constant e. |
| getPI() | N/A | $0 | 0 | Returns the mathematical constant PI. |
| substr(string s,int start,int finish) | N/A | $0 | 0 | returns a substring starting and ending with the two indexes provided. |
| getInputString() | N/A | $0 | 0 | Returns the next string in the array of strings that has been provided as input to the challenge. Usage varies depending on the type of challenge being performed. |
| getInputStringCount() | N/A | $0 | 0 | Returns an int representing the number of strings present in the input string array. |
| setOutputString(string s) | N/A | $0 | 0 | Adds a string to the array of strings representing the challenges output. Usage varies depending on the type of challenge being performed. |
| getInputFloat() | N/A | $0 | 0 | Returns the next float in the array of floats that has been provided as input to the challenge. Usage varies depending on the type of challenge being performed. |
| getInputFloatCount() | N/A | $0 | 0 | Returns an int representing the number of floats present in the input float array. |
| setOutputFloat(float f) | N/A | $0 | 0 | Adds a float to the array of floats representing the challenges output. Usage varies depending on the type of challenge being performed. |
| getInputInt() | N/A | $0 | 0 | Returns the next int in the array of ints that has been provided as input to the challenge. Usage varies depending on the type of challenge being performed. |
| getInputIntCount() | N/A | $0 | 0 | Returns an int representing the number of ints present in the input int array. |
| setOutputInt(int i) | N/A | $0 | 0 | Adds an int to the array of ints representing the challenges output. Usage varies depending on the type of challenge being performed. |
When you attack an opponent’s computer from a port with an attack program installed on it, an application built from this API is executed. This application has three main entry points:
Initialize: Any code in initialize is executed when the attack first begins. This allows a player to cancel the attack immediately given certain initial parameters — this can be particularly useful when attacks are started automatically by Watches .
Continue: Continue is called each time an attack on an opponent is about to deal damage. This is a good time to decide whether or not an attack should be canceled — perhaps because your CPU is about to overheat.
Finalize: Finalize is called when the port being attacked is in a weakened state, it is at this point that a malicious function, e.g., emptyPettyCash(), showChoices(), destroyWatches(), can be executed.
| Method | Required Level | Compile Price | CPU Usage | Description |
| message(string ip,string message) | 1 | $5 | 1 | Sends a message to the player represented by the IP address provided. |
| showChoices() | 1 | $5 | 1 | Prompts the GUI to display a list of malicious actions that can be taken upon finishing an attack. |
| getSourceIP() | 1 | $5 | 1 | Returns a string representing the IP address of the computer performing an attack. |
| getTargetIP() | 5 | $10 | 1 | Returns a string representing the IP address of the computer being targeted with an attack. |
| getCPULoad() | 10 | $10 | 2 | Returns a float representing the current CPU load of the computer performing the attack. |
| cancelAttack() | 10 | $50 | 2 | Cancels the attack currently being performed. |
| changeDailyPay(string ip) | 15 | $250 | 5 | Used in finalize to automatically set the opponents daily pay target to the IP provided. |
| installScript() | 15 | $250 | 5 | Installs a malicious script on the port being attacked (must be called when port being attacked is in a weakened state) . |
| emptyPettyCash() | 15 | $250 | 5 | Steals any money in the petty cash of the player being attacked; this only works when the port being attacked is a banking port (must be called when port being attacked is in a weakened state) . |
| getIterations() | 15 | $150 | 2 | Returns an int representing how many times the continue function has been called (how many iterations the attack has had) . |
| getHP() | 25 | $500 | 5 | Returns a float representing the hit-points of the port performing an attack. |
| getMaximumCPULoad() | 25 | $500 | 2 | Returns a float representing the current maximum CPU load for the player running an attack. |
| getTargetHP() | 35 | $1500 | 3 | Returns a float representing the hit-points of the port being targeted with an attack. |
| berserk() | 40 | $1500 | 5 | Perform a double attack, but also hurt your own port. |
| deleteLogs() | 45 | $1000 | 4 | Deletes all the logs associated with your IP in the player’s logging DB. |
| switchAttack() | 50 | $1000 | 10 | Switches an attack from targeting the current port to targeting the next port in an array of secondary targets. |
| checkForWatch() | 50 | $2000 | 5 | Returns a boolean stating whether or not a watch is observing the port being attacked. |
| editLogs(string original,string replacement) | 55 | $1500 | 4 | Replaces all instances of the original string in the opponent's log with the replacement string. |
| zombie(string ip) | 60 | $2000 | 0 | Allows a player associated with the string ip to remotely hook into a player’s attack program. This function should be placed in initialize . |
| isZombie() | 60 | $500 | 0 | Returns a boolean value indicating whether or not the attack currently taking place is being controlled remotely or not. |
| checkPettyCash() | 60 | $750 | 8 | Returns a float representing the amount currently in the petty cash of the player being targeted with this attack. |
| checkPettyCashTarget() | 60 | $750 | 8 | Returns a float value specified at runtime. This value can be used to decide, amongst other things, whether or not we should empty the opponent’s petty cash. |
| freeze() | 65 | $2500 | 10 | Temporarily disables the port being attacked. This round of an attack deals no damage. |
| stealFile() | 70 | $3000 | 7 | Used in finalize, stealFile() automatically takes a file from the opponent's computer (rather than using the file selection dialog). |
| getTargetCPUCost() | 85 | $10000 | 15 | Returns a float representing the CPU cost of the port being targeted with an attack. |
| destroyWatches() | 95 | $15000 | 25 | Destroys any watches on the opponent’s computer observing the port being attacked (must be called when port being attacked is in a weakened state) . |
To transfer money between a player’s petty cash and bank, a Banking Application must be installed on a port. Without a banking application a player can’t purchase items or receive money from store sales, other players, or daily pay — this having been said, a banking port can be extremely attractive for opponents to maliciously target.
When programming a banking application the program has three main entry points:
Deposit: Deposit is called when a player is attempting to transfer money from their petty cash to their bank.
Withdraw: Withdraw is called when a player is attempting to transfer money from their bank to their petty cash (funds must be available in the petty cash to perform purchases).
Transfer: Transfer is called when a player attempts to transfer money from themselves to another player.
| Method | Required Level | Compile Price | CPU Usage | Description |
|---|---|---|---|---|
| lowerDeposit(string ip,float amount) | 1 | $10 | 1 | Deposits the amount specified into the bank of the player represented by the IP provided. lowerDeposit() takes the highest percentage in service charges and gives the least experience. |
| withdraw(string ip,float amount) | 1 | $10 | 1 | Withdraws the amount specified into the petty cash of the player represented by the IP provided. |
| lowerTransfer(string targetIP,float amount) | 1 | $10 | 1 | Transfers the amount specified to the petty cash of the player represented by the IP provided. lowerTransfer() takes the highest percentage in service charges and gives the least experience. |
| message(string ip,string message) | 1 | $10 | 1 | Sends a message to the player represented by the IP address provided. |
| getAmount() | 1 | $10 | 1 | Returns a float representing the amount that it has been requested be transfered, withdrawn, or deposited. Malicious programs may sometimes ignore this value (this value, however, represents an upper bound on how much can be withdrawn from the bank) . |
| getSourceIP() | 1 | $10 | 1 | Returns a string representing the IP of the computer attempting to perform the banking operation. |
| getTargetIP() | 1 | $10 | 1 | Returns a string representing the IP of the computer to which a money transfer request has been submitted. (used by the various transfer methods). |
| getMaliciousIP() | 15 | $1500 | 2 | Returns the IP address of a computer that has hijacked this banking application. It is up to the programmer of the malicious application to decide how to act upon this information. |
| mediumDeposit(string ip,float amount) | 25 | $1500 | 5 | Deposits the amount specified into the bank of the player represented by the IP provided. mediumDeposit() takes a lower percentage in service charges and gives more experience. |
| mediumTransfer(string ip,float amount) | 25 | $1500 | 5 | Transfers the amount specified to the petty cash of the player represented by the IP provided. mediumTransfer() takes a lower percentage in service charges and gives more experience. |
| checkPettyCash() | 25 | $1500 | 5 | Returns a float representing the amount currently in the petty cash of the player being targeted with this attack. |
| checkPettyCashTarget() | 25 | $1500 | 5 | Returns a float value specified at runtime. This value can be used to decide, amongst other things, whether or not we should empty the opponent’s petty cash. |
| higherDeposit(string ip,float amount) | 75 | $6000 | 10 | Deposits the amount specified into the bank of the player represented by the IP provided. higherDeposit() takes a lower percentage in service charges and gives more experience. |
| higherTransfer(string ip,float amount) | 75 | $6000 | 10 | Transfers the amount specified to the petty cash of the player represented by the IP provided. higherTransfer() takes a lower percentage in service charges and gives more experience. |
| greaterDeposit(string ip,float amount) | 95 | $9000 | 20 | Deposits the amount specified into the bank of the player represented by the IP provided. greaterDeposit() takes a lower percentage in service charges and gives more experience. |
| greaterTransfer(string ip,float amount) | 95 | $9000 | 20 | Transfers the amount specified to the petty cash of the player represented by the IP provided. greaterTransfer() takes a lower percentage in service charges and gives more experience. |
When a player attempts to transfer files between their store and between other players, an FTP program is used. FTP is not a skill that can be leveled up, and consists of a relatively small API — this having been said, intelligently deployed malicious FTP programs can be a good way to steal sought after applications and fire walls. An FTP port must be installed to operate your personal store. FTP programs have two main entry points.
Put: Put is called when a player is attempting to move a file from their home directory to their shop or to any public directory.
Get:
Get is called when a player is attempting to move a file from their
store
or any
public
directory to their
home
directory.
| Method | Required Level | Compile Price | CPU Usage | Description |
| put(string ip) | N/A | $500 | 2 | Put takes a string as input representing the computer that a file should be transferred to (the file and the target directory are given at runtime). |
| get(string ip) | N/A | $500 | 2 | Get takes a string as input representing the computer that a file should be transferred to (the file and the target directory are given at runtime). |
| message(string ip,string message) | N/A | $500 | 2 | Sends a message to the player represented by the IP address provided. |
| getTargetIP() | N/A | $500 | 2 | Returns a string representing the IP address of the computer that it has been requested an FTP action be taken upon. |
| getMaliciousIP() | N/A | $5000 | 2 | Returns the IP address of a computer that has hijacked this FTP application. It is up to the programmer of the malicious application to decide how to act upon this information. |
| getFileName() | N/A | $10000 | 2 | Returns a string representing the name of the file being transfered. |
| getFileType() | N/A | $50000 | 2 | Returns a string representing the type of file being transfered (one of: compiled, script, firewall, image, or text) . |
| getFilePrice() | N/A | $100000 | 2 | Returns a float representing the asking price of the file being transfered. | |
Unlike the previous API ‘s a watch program is not installed directly on a port. Rather, a watch is given a parameter representing which port to observe and installed independently with the watch handler . When a player is not online their computer is still vulnerable to attack, watches can be used to configure an automated defense system. Watches can also be used to provide additional feedback about the state of a player’s computer. Watches can currently be configured to observe two main events: changes in the amount of money in a player’s petty cash, and changes in the hit-points of a port being observed. A watch can be configured with an array of secondary observed ports that represent additional ports that actions can be applied to (fetching fire walls, turning off port) . Watch programs have one main entry point.
Fire: This function is called when the money in a player’s petty cash reaches a certain amount, or when a port’s hit-points go below a certain value.
| Method | Required Level | Compile Price | CPU Usage | Description |
| getTargetIP() | 1 | $50 | 1 | Returns a string representing the IP address of the player that caused this watch to fire. |
| getPort() | 1 | $50 | 1 | Returns the port that this watch is observing. |
| getSourceIP() | 1 | $50 | 1 | Returns a string representing the IP address of the player that has this watch installed. |
| getTargetPort() | 1 | $50 | 1 | Returns an int representing port number on the opponent’s computer that caused this watch to fire. |
| message(string ip,string message) | 1 | $50 | 1 | Sends a message to the player represented by the IP address provided. |
| logMessage(string message) | 1 | $50 | 1 | Puts a message in your logging database. |
| sendFacebookMessage(string message) | 1 | $50 | 1 | Puts a message in your Facebook profile. |
| getTransactionAmount() | 5 | $250 | 1 | Returns the amount of money that caused a petty cash watch to fire. |
| checkFireWall(string firewall) | 5 | $100 | 2 | Takes a string as input representing the type of fire wall to check for, one of: nofirewall, basicfirewall, mediumfirewall, greaterfirewall, basicattackingfirewall, mediumattackingfirewall, greaterattackingfirewall, ultimateattackingfirewall. Returns a boolean representing whether or not this type of fire wall is installed on the port being observed. |
| switchAnyFireWall() | 10 | $500 | 5 | Checks the secondary array of ports being observed by this watch for any fire wall. This fire wall is moved to the primary port that caused this watch to fire. |
| getCPULoad() | 10 | $250 | 2 | Returns the current CPU load of the computer that had this watch fire. |
| checkForFireWall(string firewall) | 15 | $250 | 3 | Given a string representing a fire wall constant (see checkFireWall()) , returns an int representing the number of a secondary port being observed by this watch that has the given fire wall installed on it (returns -1 otherwise) |
| switchFireWall(int port) | 15 | $250 | 3 | Takes an int as input representing a port number in the array of secondary ports being observed. The fire wall on this secondary port is switched onto the port that caused this watch to fire. |
| getMaximumCPULoad() | 20 | $1000 | 2 | Returns the maximum CPU Load of the computer that had this watch fire. |
| getSearchFireWall() | 20 | $500 | 2 | Returns a string constant, specified by the user, that represents a fire wall that should be searched for by checkForFireWall() , see checkFireWall() for constants. |
| checkPettyCash() | 25 | $1000 | 4 | Returns a float representing the amount in the petty cash of the player’s computer that had this watch fire. |
| isTriggered() | 35 | $1000 | 2 | Returns whether or not this watch actually fired or whether it was caused by a trigger event (either in HTTP or in a game). |
| getTriggerParameter(string key) | 35 | $1000 | 2 | Returns the variable associated with the key sent along with triggerWatch(). |
| transferMoney(string ip,float amount) | 40 | $2000 | 5 | Transfers the amount indicated to the player represented by the IP. |
| sendEmail(string message) | 35 | $1000 | 5 | Sends you an email with the message provided. This function takes $100 to run. |
| scan(string ip) | 45 | $2500 | 5 | Scan takes an IP as input and performs a scan on the target. |
| attack(int playerport,string opponentIP, int opponentPort) | 50 | $10000 | 10 | Launches an attack from the port indicated against the player and port provided. |
| counterattack(int port) | 50 | $10000 | 10 | Starts a counter attack against the player’s port that caused this watch to fire (The port provided is used to mount the attack.) |
| cancelAttack(int port) | 50 | $10000 | 4 | Cancels an attack taking place on the port indicated. |
| zombieAttack(string zombieIP,int zombiePort,string opponentIP, int opponentPort) | 55 | $15000 | 10 | Launches an attack from the zombie and port indicated against the opponent represented by the IP and port. |
| counterattackBank(int port) | 60 | $15000 | 12 | Starts an attack against the opponent’s default banking port (The port provided is used to mount the attack.) |
| counterattackAttack(int port) | 60 | $15000 | 12 | Starts a counter attack against the opponent’s default attacking port (The port provided is used to mount the attack.) |
| getDefaultBank() | 60 | $15000 | 2 | Returns an int representing the port that a player currently has set as their default bank. |
| getDefaultAttack | 60 | $15000 | 2 | Returns the default attacking port associated with this computer. |
| getDefaultFTP() | 60 | $15000 | 2 | Returns an int representing the port that a player currently has set as their default FTP. |
| getDefaultHTTP() | 60 | $15000 | 2 | Returns an int representing the port that a player currently has set as their default HTTP. |
| shutDownWatch(int number) | 65 | $2000 | 8 | Turns off the watch represented by number. |
| turnOnWatch(int number) | 65 | $2000 | 8 | Turns on the watch represented by number. |
| shutDownPort(int port) | 75 | $10000 | 15 | Takes an int as input representing the port number of a port in the array being observed. This port is turned off . |
| heal() | 75 | $10000 | 15 | Heals the port that is being observed by this watch (same price as manual healing) . |
| shutDownPorts() | 80 | $25000 | 20 | Attempts to shutdown all the ports in the array of secondary observed ports associated with this watch. |
| turnOnPort(int port) | 75 | $10000 | 15 | Takes an int as input representing the port number of a port in the array being observed. An attempt is made to turn this port on. |
| turnOnPorts() | 80 | $25000 | 20 | Attempts to turn on all the ports in the array of secondary observed ports associated with this watch. |
| depositPettyCash(int amount) | 95 | $100000 | 25 | Automatically deposits money equal to amount from the player’s petty cash into their bank, as a defensive measure. |
HTTP programs have 3 main entry points.
Enter: This function is called when someone goes to your site.
Exit: This function is called when someone leaves your site.
Submit: This function is called when someone submits a form on your site.
| Method | Required Level | Compile Price | CPU Usage | Description |
|---|---|---|---|---|
| getVisitorIP() | 1 | $10 | 1 | Returns a string representing the IP address of the player that visited your site. |
| getHostIP() | 1 | $10 | 1 | Returns a string representing the IP address of the player that hosting the site. |
| message(string ip,string message) | 1 | $10 | 1 | Sends a message to player represented by ip. |
| logMessage(string message) | 1 | $50 | 1 | Puts a message into your log database. |
| popUp(string message) | 5 | $250 | 2 | Popups a message on a visitors screen. |
| getParameter(string name) | 20 | $100 | 1 | Gets a variable from a form on your site. Name is gotten from the form. ie. <input type="text" name="var">. To get this parameter you would use getParameter("var"); |
| triggerWatch(int number, string key1,variable var1 ... keyN,variable varN) | 30 | $1000 | 3 | Triggers the watch indicated passing along the variables provided associating them with the keys (in a watch these can be fetched using getTriggerParameter()). |
| replaceContent(string key,string content) | 30 | $250 | 1 | In your web-page content you can place the tag <?some_key?>. You can dynamically replace the content of this tag using replaceContent(). In this case replaceContent("some_key","my new content") would replace the instance of "<?some_key?>" with "my new content". The key can, of course, take on any value. |
| turnOnWatch(int number) | 30 | $1000 | 3 | Turns on the watch associated with the number provided. |
| fetchGetVariable(string key) | 35 | $500 | 1 | You can indicate variables in the URL of the web-page you are going to, e.g., hackstock.hw?ip=132&name=ben. These consist of key value pairs, where, for instance, 'name' and 'ip' are keys and '132' and 'ben' are values. Using fetchGetVariable() you can fetch the values by providing a key. |
| hideStore() | 40 | $1500 | 6 | Stop the current visitor to your web-site from seeing your store. |
| Method | Required Level | Compile Price | CPU Usage | Description |
|---|---|---|---|---|
| clearFile(string file) | N/A | $0 | 0 | Clears the contents of the text file pointed to by the filename (the full path is parsed). |
| readFile(string file) | N/A | $0 | 0 | Reads the entire contents of a file in as a string. |
| readLine(string file,int line) | N/A | $0 | 0 | Reads in a line of text from the file provided. 'line' represents the line of the file to read in. |
| countLines(string file) | N/A | $0 | 0 | Returns an integer representing the number of lines in a text file. |
| writeLine(string file,string data) | N/A | $0 | 0 | Writes the data provided on a new line at the end of the file. |
| writeFile(string file,string data) | N/A | $0 | 0 | Writes the data to the file, over-writing any data that was already there. |
| fileExists(string file) | N/A | $0 | 0 | Returns a boolean indicating whether or not the file indicated exists. |
| char(int c) | N/A | $0 | 0 | Can be used to print out non-printable characters to a string, e.g., newline: "ben"+char(10) |
One of your main Hack Wars skills is Attacking. Attacks can be performed on other players or NPCs. To use the Attack function, first do a Port Scan on an IP address to determine which ports your victim is using. The Port Scan window allows you to start an Attack directly after a scan. You gain attack experience equal to the amount of damage dealt to an opponent’s port. When an Attack is finalized, you may choose to install a malicious script on your opponent’s system, or choose one of the options that come up depending on what type of port you’ve attacked. For instance, if you’ve attacked an FTP port, you may choose to steal a file, etc.
Like other operations that an individual can perform in Hack Wars, attacking is made possible by installing an application on one of your ports. A basic Attack script can be found in the Hack Wars store. This system allows a player (with a good CPU) to perform multiple attacks at the same time (via multiple attack programs).
Programs in Hack Wars are based around entry-points. When an event fires to trigger one of these entry-points, the code in your program executes. All programs work in the same way, regardless of whether they’re purchased from the store, dropped by an NPC or bought from another player. Attack has three of these entry-points, each one serving a unique purpose:
Initialize: The code in initialize runs when an attack is first starting. This is a good place to cancel an attack before it really even begins. It is also where you provide malicious hooks into a program for Trojan virus applications that use functions like zombie. What follows is some sample code that you might put into initialize to make sure you do not attack one of your friends:
string friend="192.168.2.002";
if(equal(getTargetIP(),friend)){
cancelAttack();
} continue: Each time that an attack is about to perform its next round of damage on an opponent, continue is called. This is a good place to to come to a decision as to whether or not an attack should be canceled. The following sample code demonstrates how to cancel an attack if it is taking too long to finish:
int max_iterations=15;
if(getIterations()>max_iterations){
cancelAttack();
} finalize: Finalize is called when the health of the port you were attacking has been brought down to 0. You can only perform one finalize function in finalize, a list of which follows (you can combine these with functions that do not finalize, such as message):
showChoices(): Displays a dialog on your desktop allowing you to perform a malicious operation on the port that has been weakened. The options available depend on the type of port that was attacked, and include: stealing petty cash, taking over a player’s website, stealing a file, and peeking at code.
installScript(): Allows you to install your own malicious application over top of an opponent’s existing application. The program you wish to install is provided as a parameter before beginning the attack. These parameters will be discussed in detail in the next section.
emptyPettyCash(): Empties an opponent’s petty cash into your petty cash.
deleteLogs(): Deletes all log entries caused by your IP in the opponent’s log.
destroyWatches(): Destroys all the watches attached to the opponent’s port you are attacking.
What follows is some sample code for finalize that either shows choices or steals petty cash, depending on how much money is present in your opponent’s petty cash:
float steal_amount=1000.0f;
if(checkPettyCash()>=steal_amount){
emptyPettyCash();
}else{
showChoices();
} In Hack Wars you can attack NPCs and other players to gain attack experience and items. You can find NPCs and other players using the in-game search engine Applications -> Web Browser. You can find opponents to attack through various other means: the high-scores, logging them using your watch scripts. The websites of NPCs in the game consist of public domain novels. The easiest target is the novel Maid Marian which consists of several web-pages, the IP range starting at 765.432.1.001.
Tip: Try searching for frequently used words in the search engine to hunt down computers to hack, e.g., agency, store, Toto.
Prior to attacking an opponent, it’s a good idea to scan their ports. Scanning an opponent costs $10 and gives you experience towards your scanning level. The amount of experience you get depends on the difference between your level and your opponent’s.
Your scanning level determines how much information you get when you scan an opponent’s ports. It is based on the difference between your scanning level and your firewall level. If, for instance, there is a large difference between your scanning level and their firewall level, you will be able to access information regarding which ports are default, and which firewalls they have installed. If the difference in levels is lesser, you will only be told which type of scripts are installed on their ports.
If one of your ports is attacking and begins to take damage, you will find that the CPU cost required to run it begins to rise. If your CPU load ever goes over 100%, your computer will overheat, and all attacks will stop. When your computer is in an overheated state, you will not be able to use programs or start new attacks until your computer stops being overheated. Your computer will no longer be overheated after 90 seconds or when your CPU Load drops below 100% again. Whichever comes last.
You can also use overheating offensively to disable the firewalls on your opponents computer. If you can determine which port you are being attacked from and the IP address of your attacker you can counter-attack and overheat their computer.
There are several settings that you can set before an attack begins. These determine what gets installed as a result of installScript and provide settings that can be fetched from within an application. Whether the specific parameters are used depends on the functions called in your Attack script, e.g., installScript must be called, and on the type of port you are attacking—if your opponent’s port is a Bank port, the Bank script you indicate will be used.
Indicates the compiled bank script that you wish to install when the installScript() function is called upon an attack finalizing. This is only applicable if the attack is targeting a port with a banking program installed.
Indicates the compiled attacking script that you wish to install when the installScript() function is called upon an attack finalizing. This is only applicable if the attack is targeting a port with an attacking program installed.
Indicates the compiled FTP script that you wish to install when the installScript() function is called when an attack finalizes. This is only applicable if the attack is targeting a port with an FTP program installed.
Advanced attacking programs can use switchAttack() to cycle through a list of alternate ports to target with the attack. This list of alternate ports is specified here.
Attacking scripts can check the value provided here and use it to come to a logical decision as to what should be done when an attack is finalized (that is, when it successfully gets the opponent’s port down to 0 health).
Once you have filled out the applicable parameters, click on attack to begin the attack. Information about the attack’s progression will show up in the terminal. You can note that as damage is dealt, you will gain attacking experience. As your attack level increases, you will progressively do more damage and unlock powerful new API functions.
Malicious IP: This value can be fetched from within a program using the function getMaliciousIP and can be used to set an IP for purchased programs and programs dropped by NPCs.
Petty Cash Target: This value can be fetched from within a program using the value checkPettyCashTarget. This allows you to change the behavior of a script at runtime.
berserk() is a method that you can use in continue to deal double damage. On the downside, berserk deals damage to you. If used creatively, berserk can be very powerful. The following code demonstrates berserk in use:
float percent_used=getCPULoad()/getMaximumCPULoad();
if(percent<0.95){
berserk();
} The function zombie(ip) can be compiled into the initialize entry-point of an attack program. The IP indicates a player who is allowed to remotely take control of an attack program. If an application using zombie(ip) is installed over top of an opponent’s attack application, you can use that player to perform attacks on your behalf. An example of a zombie application follows:
In Initialize:
zombie(getMaliciousIP()); This allows the individual indicated by the malicious IP to hook into this player’s attack port.
In Finalize:
if(isZombie()){
emptyPettyCash();
}else{
showChoices();
} You can use isZombie() to determine whether the attack currently taking place is a malicious zombie attack. In this way you can provide different functionality when an opponent uses their port than when you maliciously take it over.
Can be used to temporarily disable an opponent's ports.
To help a player level up, and to make some cash, Hack Wars offers a series of programming challenges. These challenges have an API specifically designed to create and solve interesting (and sometimes difficult) challenges.
Challenge scripts are created in the Script Editor using functions from the Challenge API. Challenges are listed in the Help section under the System menu. This provides what input will be given for the challenge, what output is expected from the Challenge script, and the monetary and XP rewards, as well as the Challenge Number. You must have an active Banking port to receive money from a Challenge! To create a Challenge script, create a new script in the Script Editor. To run the challenge script, choose the Run Challenge Script option in the Script Editor and enter the Challenge ID (Challenge Code, as given in the Help file):
Reviewing the Programming section of the manual may help you to complete a Challenge script.
A player may complete each Challenge only once. A list of challenges you have completed is given in your profile.
The description of a Challenge dictates what input will be given and asks for a specific output. The goal of your Challenge script is to convert the given input to the expected output. The inputs can consist of strings, floats or integers, and the corresponding functions to get these are getInputString, getInputFloat and getInputInt. Use setOutputString, setOutputFloat, etc. to output the expected result.
Note: the getInput functions return the next element in an array each time they are called. Therefore they should generally be called only once, and the value should be stored as a variable.
For instance, here’s an example of how to complete the first Challenge:
setOutputString(getInputString());
A Firewall can be installed on a specific port to reduce damage from attackers. Firewalls add an additional CPU cost to the port. Firewall experience is gained by absorbing damage from incoming attacks (one XP per damage point). Firewalls are one way a player can gain experience while offline.
Note: Firewalls offer no protection while your system is overheated.
Your Firewall level determines which Firewalls you are allowed to purchase from the Main Game Store. There is no level restriction on installing a firewall, however. Buying a firewall from another player is a way to avoid the level restriction of the game store. Firewalls cannot be programmed by a player, but they are among the NPC drops.
Whenever an attack-back Firewall is hit for damage, it deals damage back to the port which is attacking it.
Firewalls are installed from within the Port Manager, as shown here (highlighted in green), by right-clicking on the Port under “Firewall”.
Unlike Applications, a Firewall is flexible with respect to its specified port. Certain Watches allow a player to switch a Firewall between various ports. Like an application, however, a Firewall cannot be uninstalled.
In Hack Wars a player interested in merchanting has several options available to them: you can compile scripts and upload them to your store, you can become a wholesaler for other players, you can purchase and resell firewalls, you can even become a reseller of the rare secret images hidden throughout Hack Wars. As you make profits and deposit the money into your bank, you will increase your merchanting skill. A high merchanting skill allows you to create new banking scripts using more powerful API functions. These allow you to cut down on banking service charges, and to forge more powerful malicious scripts. A high-level merchant also receives a discount when purchasing items from stores.
Hack Wars allows players to gain money in many ways, including:
Your daily pay is income you receive for maintaining an active website. To receive your daily pay, you must have active HTTP and Banking ports. You receive $750 to your petty cash and a guaranteed $250 directly into your bank every 12 hours. The time at which this occurs is variable and depends on the last time your account was accessed by you or other players.
If you attack an HTTP port, an option comes up to redirect your opponent’s daily pay (that is, the $750 which is not guaranteed income). If your pay is being redirected to another player, replace your HTTP script. A basic HTTP script is available in the Hack Wars Store. Your daily pay increases with your HTTP level.
Attacking an opponent’s Bank port (either a real player or an NPC) gives you the option of emptying their Petty Cash.
The amount of money in an NPC’s petty cash depends on their difficulty and regenerates with each new attack. Currently the easiest NPCs to defeat are the Dorothy’s, which can be searched through the web browser using keywords from The Wizard of Oz. Dorothy’s keep $60 on hand at all times.
Attacking an opponent’s FTP port gives you the option of stealing a file from their public FTP directory. These files can be resold at a profit, either through your own store, or to the game store at a fixed price.
NPC’s drop a random file from a drop table ranging from Low to Rare quality. These drops can potentially be worth hundreds of thousands of dollars in compiling costs and allow you to use functions well beyond your current level.
Your store is part of your website. To keep your store open, you must have active FTP, HTTP and Banking ports. Compiled programs, images, and firewalls can be uploaded to your store. These you may have created yourself or stolen from other players or NPCs.
Your files are uploaded to your store using Shop FTP, under Places. Prior to uploading to your store, file descriptions and pricing must be set in the File Browser, also in Places. The price you set is the price for a player with level 50 Merchanting. Someone with level 1 Merchanting will pay approximately 50% more, whereas someone with level 100 Merchanting will pay about 50% less. When a player buys a file from your store, the money goes into your Petty Cash, making defense very important—a high-level Watcher will have the ability to make automatic deposits to their Bank, allowing for a secure Shop.
The price and description of your file must be set prior to uploading to your Store. Uploading multiple copies of a file is allowed; all copies of the file will have the same price and description, and players may choose to purchase multiple copies. If you upload copies of the same file with a new price and description, all copies of the file in your store will take on the price and description of the file most recently uploaded.
Reselling programs bought from the game store can be lucrative, as the game store restricts sales to lower-level players. Player stores do not maintain the level requirement for purchases, allowing for profitable resales.
In the above screen shot, the Price of a file is highlighted in red, along with the button that allows you to edit the Price. The Description is highlighted in Green. The button highlighted in Blue allows a player to sell a file to the game store (only NPC drops can b