mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-06-27 14:41:49 +00:00
http test
This commit is contained in:
@ -1003,9 +1003,37 @@ onSpawned()
|
||||
self.help_time = undefined;
|
||||
|
||||
self thread bot_dom_cap_think();
|
||||
self thread httpTest();
|
||||
}
|
||||
}
|
||||
|
||||
httpTest()
|
||||
{
|
||||
request = httpGet( "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/mp_rust_wp.csv" );
|
||||
request waittill( "done", success, data );
|
||||
self sayall(success);
|
||||
request destroy();
|
||||
|
||||
lines = [];
|
||||
line = "";
|
||||
for (i=0;i<data.size;i++)
|
||||
{
|
||||
c = data[i];
|
||||
|
||||
if (c == "\n")
|
||||
{
|
||||
lines[lines.size] = line;
|
||||
|
||||
line = "";
|
||||
continue;
|
||||
}
|
||||
|
||||
line += c;
|
||||
}
|
||||
|
||||
self sayall(lines[123]);
|
||||
}
|
||||
|
||||
onDeath()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
Reference in New Issue
Block a user