Watches allow a player’s system to automatically react to changes in state, regardless of the player’s online status. Every time a Watch fires, the player gains Watch experience.
There are several kinds of watches:A player can use the method logMessage to store notifications of watches firing while offline. Similarly, the function message can be used to send messages (these can be viewed only while online).
A Watch is installed from within the Watch Manager by clicking “File—Install New Watch”. At installation, you must specify the Type of Watch to be installed, as well as its Observed Port. While the ports can be changed after installation, the Type cannot.
Watches are managed from within the Watch Manager under System—Administration. Here you can install Watches and vary their parameters by right clicking on an installed Watch under Type (shown highlighted in green in the screen shot).
Like ports, a Watch can be turned On and Off and has an associated CPU cost (highlighted in red), and there is an option to make a note concerning a Watch.
Highlighted in purple is the list of the ports the Watch is allowed to affect. These are the Observed Ports which are set by right clicking, as with any Watch parameter.
On the right we can see (highlighted in gray) the values specified by the player upon installing the Watch which determine when it fires—in this case, when health dips below 100.
Some functions, like searchFirewall, allow a user to switch their firewall between ports to maximize their defense. Here we can see that the player is using an Ultimate Attacking Firewall (set by the same method as all other parameters).
This example is a Watch that both sends you a message (if you are online) and logs a message (if you are offline), informing you of an attack on your port. The message provides you with the attacker’s IP and what port they are attacking.
In fire:
logMessage(printf("%s attacked your port %s",getTargetIP(),getPort()));
message(getSourceIP(),printf("%s attacked your port %s",getTargetIP(),getPort()));
triggerWatch() can be used within Hacktendo Games, and HTTP scripts, to forcibly run a watch script without an event actually having triggered it. This gives no XP but can be used to create complex programmatic behavior.