mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 21:45:43 +00:00
write file
This commit is contained in:
parent
a7cd272b90
commit
ca0131f03d
@ -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++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user