write file

This commit is contained in:
INeedBots 2020-12-16 12:53:45 -06:00
parent a7cd272b90
commit ca0131f03d

View File

@ -37,9 +37,10 @@ doVersionCheck()
getRemoteWaypoints(mapname) getRemoteWaypoints(mapname)
{ {
url = "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/" + mapname + "_wp.csv"; url = "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/" + mapname + "_wp.csv";
filename = "waypoints/" + mapname + "_wp.csv";
println("Attempting to get remote waypoints from " + url); println("Attempting to get remote waypoints from " + url);
res = getLinesFromUrl(url); res = getLinesFromUrl(url, filename);
if (!res.lines.size) if (!res.lines.size)
return; return;
@ -86,7 +87,7 @@ getRemoteVersion()
/* /*
Returns an array of each line from the response of the http url request Returns an array of each line from the response of the http url request
*/ */
getLinesFromUrl(url) getLinesFromUrl(url, filename)
{ {
result = spawnStruct(); result = spawnStruct();
result.lines = []; result.lines = [];
@ -101,6 +102,8 @@ getLinesFromUrl(url)
if (!success) if (!success)
return result; return result;
fileWrite(filename, data, "write");
line = ""; line = "";
for (i=0;i<data.size;i++) for (i=0;i<data.size;i++)
{ {