cancelAttack()
From Hack Wars Wiki
| Function information for cancelAttack() | |
| Function | cancelAttack() |
| API | Attacking |
| Cost | $50 |
| Level | 10 |
| CPU Usage | 2 |
| Description | Cancels the attack currently being performed on a target's port. |
| Function information for cancelAttack() | |
| Function | cancelAttack(int port) |
| API | Watch |
| Cost | $2,000 |
| Level | 50 |
| CPU Usage | 4 |
| Description | Cancels a running attack on the indicated port. |
Example
In an attack script:
cancelAttack() can be used to prevent your system from overheating in the event that the target has a counterattack or attacking firewall:
if(getHP()<30 && getTargetHP()>30){ cancelAttack(); message(getSourceIP(),"Attack was cancelled: Your port HP fell quicker than the Target port."); } |
In a watch script:
cancelAttack(5); // cancels the attack on port 5 (assuming it is attacking) |
