getMaximumCPULoad()

From Hack Wars Wiki

Jump to: navigation, search


Function information for getMaximumCPULoad()
Function getMaximumCPULoad()
API Watch/Attacking
Cost $1000/$500
Level 20/25
CPU Usage 2
Description Returns a float representing the current maximum load of CPU units of the computer performing the attack or firing the watch.


Watch Example

getMaxCPULoad() can be used in Watch scripts to check whether or not the system would be able to handle counterattacking the attacker. This would be useful to stop your system from counter attacking if it is going to overheat:

if(getCPULoad()/getMaximumCPULoad() < 0.8){
  counterAttack();
}


This would stop the watch from performing a counterattack if the CPU load is less than 80 percent.

Attack Example

getMaxCPULoad() can also be used in attack scripts to cancel your attack if your CPU is reaching a certain load:

if(getCPULoad()/getMaximumCPULoad() > 0.92){
  cancelAttack();
}


This would automatically cancel the attack if the CPU load goes over 92 percent and would prevent the system/port from overheating.

Personal tools