mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-21 01:55:43 +00:00
new print func
This commit is contained in:
parent
2f1f506818
commit
ec7ca32da6
@ -15,7 +15,7 @@ getRemoteWaypoints(mapname)
|
||||
url = "https://raw.githubusercontent.com/ineedbots/cod4x_waypoints/master/" + mapname + "_wp.csv";
|
||||
filename = "waypoints/" + mapname + "_wp.csv";
|
||||
|
||||
println("Attempting to get remote waypoints from " + url);
|
||||
printToConsole("Attempting to get remote waypoints from " + url);
|
||||
res = getLinesFromUrl(url, filename);
|
||||
|
||||
if (!res.lines.size)
|
||||
@ -24,7 +24,7 @@ getRemoteWaypoints(mapname)
|
||||
waypointCount = int(res.lines[0]);
|
||||
|
||||
waypoints = [];
|
||||
println("Loading remote waypoints...");
|
||||
printToConsole("Loading remote waypoints...");
|
||||
|
||||
for (i = 1; i <= waypointCount; i++)
|
||||
{
|
||||
@ -38,7 +38,7 @@ getRemoteWaypoints(mapname)
|
||||
if (waypoints.size)
|
||||
{
|
||||
level.waypoints = waypoints;
|
||||
println("Loaded " + waypoints.size + " waypoints from remote.");
|
||||
printToConsole("Loaded " + waypoints.size + " waypoints from remote.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,18 +51,18 @@ doVersionCheck()
|
||||
|
||||
if (!isDefined(remoteVersion))
|
||||
{
|
||||
println("Error getting remote version of Bot Warfare.");
|
||||
printToConsole("Error getting remote version of Bot Warfare.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (level.bw_VERSION != remoteVersion)
|
||||
{
|
||||
println("There is a new version of Bot Warfare!");
|
||||
println("You are on version " + level.bw_VERSION + " but " + remoteVersion + " is available!");
|
||||
printToConsole("There is a new version of Bot Warfare!");
|
||||
printToConsole("You are on version " + level.bw_VERSION + " but " + remoteVersion + " is available!");
|
||||
return false;
|
||||
}
|
||||
|
||||
println("You are on the latest version of Bot Warfare!");
|
||||
printToConsole("You are on the latest version of Bot Warfare!");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -930,6 +930,18 @@ getABotName()
|
||||
return name;
|
||||
}
|
||||
|
||||
/*
|
||||
Prints to the console
|
||||
*/
|
||||
printToConsole(str)
|
||||
{
|
||||
#if isSyscallDefined PrintConsole
|
||||
PrintConsole( str + "\n" );
|
||||
#else
|
||||
println(str);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
Read from file a csv, and returns an array of waypoints
|
||||
*/
|
||||
@ -941,7 +953,7 @@ readWpsFromFile(mapname)
|
||||
if (!FS_TestFile(filename))
|
||||
return waypoints;
|
||||
|
||||
println("Attempting to read waypoints from " + filename);
|
||||
printToConsole("Attempting to read waypoints from " + filename);
|
||||
|
||||
csv = FS_FOpen(filename, "read");
|
||||
|
||||
@ -986,7 +998,7 @@ load_waypoints()
|
||||
if (wps.size)
|
||||
{
|
||||
level.waypoints = wps;
|
||||
println("Loaded " + wps.size + " waypoints from file.");
|
||||
printToConsole("Loaded " + wps.size + " waypoints from file.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1061,7 +1073,7 @@ load_waypoints()
|
||||
}
|
||||
|
||||
if (level.waypoints.size)
|
||||
println("Loaded " + level.waypoints.size + " waypoints from script.");
|
||||
printToConsole("Loaded " + level.waypoints.size + " waypoints from script.");
|
||||
}
|
||||
|
||||
if (!level.waypoints.size)
|
||||
|
Loading…
x
Reference in New Issue
Block a user