Skip to content

Commit

Permalink
waittillframeend event
Browse files Browse the repository at this point in the history
  • Loading branch information
ineed bots committed Mar 12, 2024
1 parent 9e81407 commit 3c1d16f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/mp/bots.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -1630,12 +1630,22 @@ allowTeamChoice()
return true;
}

/*
Waits till frame end so that if two notifies happen in the same frame, the other will not be missed.
*/
BotNotifyBotEvent_( msg, a, b, c, d, e, f, g )
{
self endon( "disconnect" );
waittillframeend; // wait for the waittills to setup again
self notify( "bot_event", msg, a, b, c, d, e, f, g );
}

/*
Notify the bot chat message
*/
BotNotifyBotEvent( msg, a, b, c, d, e, f, g )
{
self notify( "bot_event", msg, a, b, c, d, e, f, g );
self thread BotNotifyBotEvent_( msg, a, b, c, d, e, f, g );
}

/*
Expand Down

0 comments on commit 3c1d16f

Please sign in to comment.