mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 13:35:44 +00:00
Better approach
This commit is contained in:
parent
b6e06f73f4
commit
15ec54bfd4
@ -30,7 +30,7 @@ onBotConnected()
|
||||
{
|
||||
level waittill( "bot_connected", bot );
|
||||
|
||||
bot thread start_chat_threads();
|
||||
bot thread start_chat_watch();
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,26 +57,40 @@ BotDoChat( chance, string, isTeam )
|
||||
/*
|
||||
Starts things for the bot
|
||||
*/
|
||||
start_chat_threads()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
self thread bot_chat_revive_watch();
|
||||
self thread bot_chat_killcam_watch();
|
||||
self thread bot_chat_stuck_watch();
|
||||
}
|
||||
|
||||
/*
|
||||
Revive
|
||||
*/
|
||||
bot_chat_revive_watch()
|
||||
start_chat_watch()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "bot_chat_revive", state, revive );
|
||||
self waittill( "bot_chat", msg, a, b, c, d, e, f, g );
|
||||
|
||||
switch ( msg )
|
||||
{
|
||||
case "revive":
|
||||
self bot_chat_revive_watch( a, b, c, d, e, f, g );
|
||||
break;
|
||||
|
||||
case "killcam":
|
||||
self bot_chat_killcam_watch( a, b, c, d, e, f, g );
|
||||
break;
|
||||
|
||||
case "stuck":
|
||||
self bot_chat_stuck_watch( a, b, c, d, e, f, g );
|
||||
break;
|
||||
|
||||
case "tube":
|
||||
self bot_chat_tube_watch( a, b, c, d, e, f, g );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Revive
|
||||
*/
|
||||
bot_chat_revive_watch( state, revive, c, d, e, f, g )
|
||||
{
|
||||
switch ( state )
|
||||
{
|
||||
case "go":
|
||||
@ -110,19 +124,12 @@ bot_chat_revive_watch()
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Killcam
|
||||
*/
|
||||
bot_chat_killcam_watch()
|
||||
bot_chat_killcam_watch( state, b, c, d, e, f, g )
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "bot_chat_killcam", state );
|
||||
|
||||
switch ( state )
|
||||
{
|
||||
case "start":
|
||||
@ -154,19 +161,12 @@ bot_chat_killcam_watch()
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Stuck
|
||||
*/
|
||||
bot_chat_stuck_watch()
|
||||
bot_chat_stuck_watch( a, b, c, d, e, f, g )
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "bot_chat_stuck" );
|
||||
|
||||
sayLength = randomintRange( 5, 30 );
|
||||
msg = "";
|
||||
|
||||
@ -214,4 +214,32 @@ bot_chat_stuck_watch()
|
||||
|
||||
self BotDoChat( 50, msg );
|
||||
}
|
||||
|
||||
/*
|
||||
Tube
|
||||
*/
|
||||
bot_chat_tube_watch( state, tubeWp, tubeWeap, d, e, f, g )
|
||||
{
|
||||
switch ( state )
|
||||
{
|
||||
case "go":
|
||||
switch ( randomInt( 1 ) )
|
||||
{
|
||||
case 0:
|
||||
self BotDoChat( 10, "i am going to go tube" );
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "start":
|
||||
switch ( randomInt( 1 ) )
|
||||
{
|
||||
case 0:
|
||||
self BotDoChat( 10, "i tubed" );
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ BotStopMoving( what )
|
||||
*/
|
||||
BotNotifyBotChat( msg, a, b, c, d, e, f, g )
|
||||
{
|
||||
self notify( "bot_chat_" + msg, a, b, c, d, e, f, g );
|
||||
self notify( "bot_chat", msg, a, b, c, d, e, f, g );
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user