Better approach

This commit is contained in:
ineed bots 2022-04-17 13:35:24 -06:00
parent b6e06f73f4
commit 15ec54bfd4
2 changed files with 144 additions and 116 deletions

View File

@ -30,7 +30,7 @@ onBotConnected()
{ {
level waittill( "bot_connected", bot ); 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 Starts things for the bot
*/ */
start_chat_threads() start_chat_watch()
{
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()
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) 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 ) switch ( state )
{ {
case "go": case "go":
@ -110,19 +124,12 @@ bot_chat_revive_watch()
break; break;
} }
} }
}
/* /*
Killcam 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 ) switch ( state )
{ {
case "start": case "start":
@ -154,19 +161,12 @@ bot_chat_killcam_watch()
break; break;
} }
} }
}
/* /*
Stuck 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 ); sayLength = randomintRange( 5, 30 );
msg = ""; msg = "";
@ -214,4 +214,32 @@ bot_chat_stuck_watch()
self BotDoChat( 50, msg ); 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;
}
} }

View File

@ -235,7 +235,7 @@ BotStopMoving( what )
*/ */
BotNotifyBotChat( msg, a, b, c, d, e, f, g ) 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 );
} }
/* /*