Esempio n. 1
0
bool CAutoplayer::ExecutePrimaryFormulasIfNecessary() {
	write_log(preferences.debug_autoplayer(), "[AutoPlayer] ExecutePrimaryFormulasIfNecessary()\n");
	if (!AnyPrimaryFormulaTrue())
	{
		write_log(preferences.debug_autoplayer(), "[AutoPlayer] No primary formula true. Nothing to do\n");
		return false;
	}
	// Execute beep (if necessary) independent of all other conditions (mutex, etc.)
	// and with autoplayer-actions.
	ExecuteBeep();

	assert(p_symbol_engine_autoplayer->isfinalanswer());
	assert(p_symbol_engine_autoplayer->ismyturn());
	// Precondition: my turn and isfinalanswer
	// So we have to take an action and are able to do so.
	// This function will ALWAYS try to click a button,
	// so we can handle the preparation once at the very beginning.
	CMyMutex mutex;

	if (!mutex.IsLocked())
	{
		return false;
	}

	PrepareActionSequence();

	if (p_function_collection->EvaluateAutoplayerFunction(k_autoplayer_function_allin))
	{
		if (DoAllin())
		{
			return true;
		}
		// Else continue with swag and betpot
	}
	if (DoBetPot())
	{
		return true;
	}
	if (DoBetsize())
	{
		return true;
	}
	return ExecuteRaiseCallCheckFold();
}
Esempio n. 2
0
bool CAutoplayer::ExecutePrimaryFormulasIfNecessary()
{
    write_log(prefs.debug_autoplayer(), "[AutoPlayer] ExecutePrimaryFormulasIfNecessary()\n");
    if (!AnyPrimaryFormulaTrue())
    {
        write_log(prefs.debug_autoplayer(), "[AutoPlayer] No primary formula true. Nothing to do\n");
        return false;
    }
    assert(p_symbol_engine_autoplayer->isfinalanswer());
    assert(p_symbol_engine_autoplayer->ismyturn());
    // Precondition: my turn and isfinalanswer
    // So we have to take an action and are able to do so.
    // This function will ALWAYS try to click a button,
    // so we can handle the preparation once at the very beginning.
    if (!PrepareActionSequence())
    {
        return false;
    }
    if (p_autoplayer_functions->f$alli())
    {
        if (DoAllin())
        {
            return true;
        }
        // Else continue with swag and betpot
    }
    if (DoBetPot())
    {
        return true;
    }
    if (DoSwag())
    {
        return true;
    }
    return ExecuteRaiseCallCheckFold();
}