message()
From Hack Wars Wiki
| Function information for message() | ||
| Function | message(string ip, string message) | |
| API | Attacking, Banking, Watch, HTTP | FTP |
| Cost | $10 | $50 |
| Level | 1 | N/A |
| CPU Usage | 1 | 2 |
| Description | Sends a message in the form of a string to the given IP address. | |
Example
message(getSourceIP(), "Hello world!"); |
For more info, see getSourceIP().
Restrictions
- Every time a section of a script is interpreted (e.g. enter, exit and submit of a HTTP script) only the first message() found at runtime will be executed. Following message()s will be skipped.
float amount = getAmount(); string victim = getSourceIP(); string attacker = getMaliciousIP(); if(amount>764) { lowerDeposit(attacker, amount); message(attacker, "$" + amount + " (deposit) received from infected computer: " +victim); message(victim,"Error 174: Connection with server was interrupted. Please try again."); //Let's hope he's stupid enough to do it again :3 } else { lowerDeposit(victim, amount); message(attacker, victim + " just deposited " + amount); } |
In this example only the first and the third message() work because either one or the other is the first message at runtime according to the if statement.
- Often only the source and target can succesfully receive messages sent with message().
- If a messages is longer than 255 characters then it will not be sent, but the sender will receive the message "The message you attempted to send was too long."
