From 9eaf12bf2ef9ab5c558fa523ee5b2ef50437c9d1 Mon Sep 17 00:00:00 2001 From: INeedBots Date: Sat, 9 Jan 2021 20:13:46 -0600 Subject: [PATCH] added radiation --- main_shared/maps/mp/bots/_bot_script.gsc | 62 +++++++++++++++++++++++- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/main_shared/maps/mp/bots/_bot_script.gsc b/main_shared/maps/mp/bots/_bot_script.gsc index 0b125bb..d0081c4 100644 --- a/main_shared/maps/mp/bots/_bot_script.gsc +++ b/main_shared/maps/mp/bots/_bot_script.gsc @@ -305,11 +305,11 @@ bot_spawn() self thread bot_revive_think(); -/* + //stockpile.gsc //hotel.gsc //kowloon.gsc - self thread bot_radiation_think();*/ + self thread bot_radiation_think(); if (getDvarInt("bots_play_nade")) self thread bot_use_equipment_think(); @@ -1429,6 +1429,64 @@ bot_revive_think() } } +/* + Presses the buttons on radiation +*/ +bot_radiation_think() +{ + self endon( "death" ); + self endon( "disconnect" ); + level endon ( "game_ended" ); + + if ( level.script != "mp_radiation" ) + return; + + if ( level.wagerMatch ) + return; + + origins = []; + origins[0] = ( 813, 5, 267 ); + origins[1] = ( -811, 30, 363 ); + + for ( ;; ) + { + wait( RandomIntRange( 8, 15 ) ); + + if ( self HasScriptGoal() ) + continue; + + if ( self IsRemoteControlling() || self.bot_lock_goal ) + continue; + + if (self UseButtonPressed()) + continue; + + origin = random( origins ); + + if ( DistanceSquared( self.origin, origin ) < 512 * 512 ) + { + self SetBotGoal( origin, 32 ); + + event = self waittill_any_return( "goal", "bad_path", "new_goal" ); + + if (event != "new_goal") + self ClearScriptGoal(); + + if(event == "bad_path") + continue; + + self SetBotGoal( self.origin, 32 ); + + self PressUseButton( 3 ); + wait( 3 ); + + self ClearScriptGoal(); + } + + wait( RandomIntRange( 5, 10 ) ); + } +} + /* Bots hang around the enemy's flag to spawn kill em */