AttackNPC

From Hack Wars Wiki

Jump to: navigation, search
Information for the Universal NPC Script Script
Script Universal NPC Script
API Attack
Cost $5,080
Level 70
CPU Usage 29
Description Allows a player to attack any port on an NPC.
Output N/A


Continue:

// This is an attack script designed for use against NPC's.
// Due to the fact that most human opponents have randomly assigned ports, this script
// may not be of much use against human opponents.
//                                          1equals1--
int main(){
  // Anti-overheat
  if(getCPULoad() / getMaximumCPULoad() > 0.92){
    cancelAttack();
  }
}


Finalize:

int main(){
  // Initialize variables
  string me = getSourceIP();
  int port = getTargetPort();
 
  // Uses appropriate function for corresponding port
  if(port == 1){
    emptyPettyCash();
  }else if(port == 2){
    stealFile();
  }else if(port == 5){
    changeDailyPay(me);
  }else{
    deleteLogs(me);
  }
}
Personal tools