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,161 +57,189 @@ 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 ( state ) switch ( msg )
{ {
case "go": case "revive":
switch ( randomInt( 1 ) ) self bot_chat_revive_watch( a, b, c, d, e, f, g );
{
case 0:
self BotDoChat( 10, "i am going to revive " + revive.name );
break;
}
break; break;
case "start": case "killcam":
switch ( randomInt( 1 ) ) self bot_chat_killcam_watch( a, b, c, d, e, f, g );
{
case 0:
self BotDoChat( 10, "i am reviving " + revive.name );
break;
}
break; break;
case "stop": case "stuck":
switch ( randomInt( 1 ) ) self bot_chat_stuck_watch( a, b, c, d, e, f, g );
{ break;
case 0:
self BotDoChat( 10, "i revived " + revive.name );
break;
}
case "tube":
self bot_chat_tube_watch( a, b, c, d, e, f, g );
break; break;
} }
} }
} }
/*
Revive
*/
bot_chat_revive_watch( state, revive, c, d, e, f, g )
{
switch ( state )
{
case "go":
switch ( randomInt( 1 ) )
{
case 0:
self BotDoChat( 10, "i am going to revive " + revive.name );
break;
}
break;
case "start":
switch ( randomInt( 1 ) )
{
case 0:
self BotDoChat( 10, "i am reviving " + revive.name );
break;
}
break;
case "stop":
switch ( randomInt( 1 ) )
{
case 0:
self BotDoChat( 10, "i revived " + revive.name );
break;
}
break;
}
}
/* /*
Killcam Killcam
*/ */
bot_chat_killcam_watch() bot_chat_killcam_watch( state, b, c, d, e, f, g )
{ {
self endon( "disconnect" ); switch ( state )
for ( ;; )
{ {
self waittill( "bot_chat_killcam", state ); case "start":
switch ( randomInt( 2 ) )
{
case 0:
self BotDoChat( 10, "WTF?!?!?!! Dude youre a hacker and a half!!" );
break;
switch ( state ) case 1:
{ self BotDoChat( 10, "Haa! Got my fraps ready, time to watch this killcam." );
case "start": break;
switch ( randomInt( 2 ) ) }
{
case 0:
self BotDoChat( 10, "WTF?!?!?!! Dude youre a hacker and a half!!" );
break;
case 1: break;
self BotDoChat( 10, "Haa! Got my fraps ready, time to watch this killcam." );
break;
}
break; case "stop":
switch ( randomInt( 2 ) )
{
case 0:
self BotDoChat( 10, "Wow... Im reporting you!!!" );
break;
case "stop": case 1:
switch ( randomInt( 2 ) ) self BotDoChat( 10, "Got it on fraps!" );
{ break;
case 0: }
self BotDoChat( 10, "Wow... Im reporting you!!!" );
break;
case 1: break;
self BotDoChat( 10, "Got it on fraps!" );
break;
}
break;
}
} }
} }
/* /*
Stuck Stuck
*/ */
bot_chat_stuck_watch() bot_chat_stuck_watch( a, b, c, d, e, f, g )
{ {
self endon( "disconnect" ); sayLength = randomintRange( 5, 30 );
msg = "";
for ( ;; ) for ( i = 0; i < sayLength; i++ )
{ {
self waittill( "bot_chat_stuck" ); switch ( randomint( 9 ) )
sayLength = randomintRange( 5, 30 );
msg = "";
for ( i = 0; i < sayLength; i++ )
{ {
switch ( randomint( 9 ) ) case 0:
msg = msg + "w";
break;
case 1:
msg = msg + "s";
break;
case 2:
msg = msg + "d";
break;
case 3:
msg = msg + "a";
break;
case 4:
msg = msg + " ";
break;
case 5:
msg = msg + "W";
break;
case 6:
msg = msg + "S";
break;
case 7:
msg = msg + "D";
break;
case 8:
msg = msg + "A";
break;
}
}
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: case 0:
msg = msg + "w"; self BotDoChat( 10, "i am going to go tube" );
break;
case 1:
msg = msg + "s";
break;
case 2:
msg = msg + "d";
break;
case 3:
msg = msg + "a";
break;
case 4:
msg = msg + " ";
break;
case 5:
msg = msg + "W";
break;
case 6:
msg = msg + "S";
break;
case 7:
msg = msg + "D";
break;
case 8:
msg = msg + "A";
break; break;
} }
}
self BotDoChat( 50, msg ); 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 );
} }
/* /*