PurchaseServer()

is a basic Netscript function.
__TOC__
== Description ==
In this function, the "hostname" argument can be of any data type, but it will be converted to a string and any whitespace will be removed. If the resulting string is empty, the function will fail. If a server already exists with the specified hostname, the function will automatically add a number to the end of the hostname value until a unique name is found. For instance, if the script calls "purchaseServer("foo", 4)" but a server named "foo" already exists, the hostname will be changed to "foo-0". If a server with the name "foo-0" already exists, the hostname will be changed to "foo-1", and so on.
== Usage ==
ram = 64;
hn = "pserv-";
for (i = 0; i < 5; ++i) {
 purchaseServer(hn + i, ram);
}