mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-06-28 07:01:49 +00:00
remote waypoints
This commit is contained in:
36
userraw/maps/mp/bots/_bot_http.gsc
Normal file
36
userraw/maps/mp/bots/_bot_http.gsc
Normal file
@ -0,0 +1,36 @@
|
||||
getRemoteWaypoints(mapname)
|
||||
{
|
||||
printLn( "Getting waypoints from csv: " );
|
||||
//"https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/mp_rust_wp.csv"
|
||||
}
|
||||
|
||||
getLinesFromUrl(url)
|
||||
{
|
||||
result = spawnStruct();
|
||||
result.lines = [];
|
||||
|
||||
request = httpGet( url );
|
||||
request waittill( "done", success, data );
|
||||
request destroy();
|
||||
|
||||
if (!success)
|
||||
return result;
|
||||
|
||||
line = "";
|
||||
for (i=0;i<data.size;i++)
|
||||
{
|
||||
c = data[i];
|
||||
|
||||
if (c == "\n")
|
||||
{
|
||||
result.lines[result.lines.size] = line;
|
||||
|
||||
line = "";
|
||||
continue;
|
||||
}
|
||||
|
||||
line += c;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
Reference in New Issue
Block a user