scan()

From Hack Wars Wiki

Jump to: navigation, search


Function information for scan()
Function scan(string ip)
API Watch
Cost $2,500
Level 45
CPU Usage 5
Description Scan takes an IP as input and performs a scan on the target.


Limitations

This function only works if the watch was fired by triggerWatch(). If a watch using this function was fired by a scan or attack then scan() will be skipped.

Example

Putting this in the 'fire' section of your watch would make this watch scan the IP that is sent to it by triggerWatch()

int main() {
	// asuming that the triggerWatch() key-value pairs are:
	// ip = ip to be scanned (ex. "900.800.6.000" )
 
	if (isTriggered()) { // only allows this to part run if the watch was triggered by triggerWatch()
		string scanip = getTriggerParameter("ip"); // retrieves value of key "ip" sent by triggering script
		scan(scanip); // scans the ip. (ex. would be equivalent to scan("900.800.6.000");)
	} else {
		// normal trigger script can go here
	}
}
Personal tools