void SelectButtonWithCustomInputComponent::OnInput( VariantList *pVList )
{
	
	if (*m_pDisabled == 1) return;
	
	switch (eMessageType( int(pVList->Get(0).GetFloat())))
	{
	
	case MESSAGE_TYPE_GUI_CHAR_RAW:
		#ifdef _DEBUG
				LogMsg("Got raw char %d", pVList->Get(2).GetUINT32());
		#endif
		break;

	case MESSAGE_TYPE_GUI_CHAR:
		{
		if (*m_pKeyCode != 0)
		{
			if (pVList->Get(2).GetUINT32() == *m_pKeyCode)
			{
				ClickButton();
				return;
			}
		
			if (m_pKeys->empty()) return;
		}
		char c = (char)pVList->Get(2).GetUINT32();
	

		if (m_pKeys->size() > 0)
		{
			
			bool bFound = false;
			for (unsigned int i=0; i < m_pKeys->size(); i++)
			{
			
				if (c == m_pKeys->at(i))
				{
					bFound = true;
					break;
				}

			}

			if (!bFound)
			{
				return;//none of the accepted keys are here.  Bye
			}
		}
		ClickButton();	
		}
		break;

        default:;
		//LogMsg("Got msg %d", int(pVList->Get(0).GetFloat()));

	}	

}
bool CCasinoInterface::ClickButtonSequence(int first_button, int second_button, int delay_in_milli_seconds) {
	if (ClickButton(first_button)) {
		Sleep(delay_in_milli_seconds); 
		if (TableLostFocus())	{
			return false;
		}
    return ClickButton(second_button);
	}
  return false;
}
Example #3
0
bool CCasinoInterface::ClickButtonSequence(int first_button, int second_button, int delay_in_milli_seconds)
{
	if (ClickButton(first_button))
	{
		Sleep(delay_in_milli_seconds); // stolen focus ???
		return ClickButton(second_button);
	}

	return false;
}
Example #4
0
void CScrollList::ClickButton(int nIndex)
{
	if (nIndex < (int)m_vtrButtons.size())
	{
		if (m_bItemSelectable)
			ClickButton(m_vtrButtons.at(nIndex), CHECKBOX_STATE_EVENT_SELECTED);
		else
			ClickButton(m_vtrButtons.at(nIndex), TOUCH_EVENT_ENDED);
	}
}
BOOL CFifa2AutoLauncher::Run()
{
	StartLauncherWindow();

	if (NULL == m_hMainWindow) {
		return FALSE;
	}

	if (DISCONNECT == m_state) {
		ClickButton(m_hMainWindow, m_iFailedOkButtonID);
		return FALSE;
	}

	if (FALSE == CheckButton(m_iAcceptCheckboxID)) {
		return FALSE;
	}

	if (FALSE == CheckButton(m_iZone1RadioButtonID)) {
		return FALSE;
	}

	HWND hStartButton = ::GetDlgItem(m_hMainWindow, m_iStartButtonID);
	if (NULL == hStartButton) {
		return FALSE;
	}

	HANDLE hThread = ::CreateThread(NULL, 0, MonitorThreadFunction, this, 0, NULL);

	if (NULL == hThread) {
		return FALSE;
	}

	while (hStartButton != NULL) {
	
		if (FALSE == ClickButton(m_iStartButtonID)) {
			return FALSE;
		}

		hStartButton = ::GetDlgItem(m_hMainWindow, m_iStartButtonID);
	}

	if (FALSE == WaitForComplete()) {
		return FALSE;
	}

	::WaitForSingleObject(hThread, INFINITE);
	::CloseHandle(hThread);

	if (TRUE == m_bIsFailed)
	{
		return FALSE;
	}
	return TRUE;
}
void RadioButtonSet::ClickButton(int nIndex)
{
	if (nIndex < (int)m_vtrButtons.size())
	{
		ClickButton(m_vtrButtons[nIndex], CHECKBOX_STATE_EVENT_SELECTED);
	}
}
BOOL CLauncher::ClickButton( int iButtonID )
{

	if (FALSE == ClickButton(m_hMainWindow, iButtonID)) {
		return FALSE;
	}

	return TRUE;
}
void SelectButtonWithCustomInputComponent::OnInputRaw( VariantList *pVList )
{

	if (*m_pDisabled == 1) return;
	bool bDown = pVList->Get(1).GetUINT32() != 0;
	if (!bDown)	 return;

	int key = pVList->Get(0).GetUINT32();
	//LogMsg("Got raw char %d, down is %d", key, int(bDown));
	
	if (*m_pKeyCode != 0)
	{
		if (key == *m_pKeyCode)
		{
			ClickButton();
			return;
		}
	}
}
BOOL CAuditionAutoLauncher::Run()
{

	HWND hMainWnd = StartLauncherWindow(L"GOPLAY", L"goPlay");
	if (NULL == hMainWnd) {
		return FALSE;
	}
	
	if (FALSE == SelectAudition()) {
		return FALSE;
	}

	HWND hPanel = ::GetDlgItem(hMainWnd, m_iPanelID);
	if (NULL == hPanel) {
		return FALSE;
	}

	if (FALSE == CheckButton(hPanel, m_iHCMButtonID)) {
		return FALSE;
	}

	if (FALSE == CheckButton(hPanel, m_iHNButtonID, BST_UNCHECKED)) {
		return FALSE;
	}

	HANDLE hThread = ::CreateThread(NULL, 0, CAuditionAutoLauncher::MonitorThreadFunction, this, 0, NULL);

	if (NULL == hThread) {
		return FALSE;
	}

	if (FALSE == ClickButton(hPanel, m_iGoButtonID)) {
		return FALSE;
	}
	
	::WaitForSingleObject(hThread, INFINITE);
	::CloseHandle(hThread);

	return TRUE;
}
bool CCasinoInterface::EnterBetsize(double total_betsize_in_dollars) {
	POINT			cur_pos = {0};
	bool			lost_focus = false;
	POINT			point_null = {-1, -1};
	CString		swag_amt;

	write_log(preferences.debug_autoplayer(), "[CasinoInterface] Starting DoBetsize...\n");
  // In some cases only call and fold are possible.
  // Then a betsize should be skipped.
  // We detect this situation by missing min-raise button.
  // No backup-action here:
  // OH-script doesn't provide that and OPPL eill do that automatically.
  // http://www.maxinmontreal.com/forums/viewtopic.php?f=117&t=18125
  if (!p_scraper_access->available_buttons[k_autoplayer_function_raise]) {
    write_log(preferences.debug_autoplayer(), "[CasinoInterface] ...ending DoBetsize early (no (min-)raise possible).\n");
		return false;
  }
	// swag regions are hard coded as #3 for now, due to legacy WH standard
	if (!p_scraper_access->i3_edit_defined || !p_scraper_access->i3_button_available)	{
		write_log(preferences.debug_autoplayer(), "[CasinoInterface] ...ending DoBetsize early (no edit field or no i3button).\n");
		return false;
	}
  SelectSwagText();
  // First sleep(), THEN check for stolen focus, then act
	//  NOT the other way: http://www.maxinmontreal.com/forums/viewtopic.php?f=120&t=14791
  write_log(preferences.debug_autoplayer(), "[CasinoInterface] Sleeping %dms.\n", preferences.swag_delay_1());
	Sleep(preferences.swag_delay_1()); 
	// Check for stolen , and thus misswag
	if (TableLostFocus()) {
		lost_focus = true;
  }
	DeleteSwagText();
  write_log(preferences.debug_autoplayer(), "[CasinoInterface] Sleeping %dms.\n", preferences.swag_delay_2());
	Sleep(preferences.swag_delay_2());
	// Check for stolen focus, and thus misswag
	if (TableLostFocus()) {
		lost_focus = true;
  }
	// SWAG AMOUNT ENTRY
	double swag_adjusted = AdjustedBetsize(total_betsize_in_dollars);
	swag_amt = Number2CString(swag_adjusted);
  // Also adapt f$betsize for correct logging later-on
  // http://www.maxinmontreal.com/forums/viewtopic.php?f=156&t=18648
  p_function_collection->SetAutoplayerFunctionValue(k_autoplayer_function_betsize, swag_adjusted);
	write_log(preferences.debug_autoplayer(), "[CasinoInterface] betsize (not adjusted): %.2f\n", total_betsize_in_dollars);
	write_log(preferences.debug_autoplayer(), "[CasinoInterface] calling keyboard.dll to enter betsize (adjusted): %s %d,%d %d,%d\n", 
		swag_amt, i3_edit_region.left, i3_edit_region.top, i3_edit_region.right, i3_edit_region.bottom);
  bool use_comma_instead_of_dot = p_tablemap->use_comma_instead_of_dot();
	(theApp._dll_keyboard_sendstring) (p_autoconnector->attached_hwnd(), i3_edit_region, 
    swag_amt, use_comma_instead_of_dot, NULL, point_null);

	write_log(preferences.debug_autoplayer(), "[CasinoInterface] Sleeping %dms.\n", preferences.swag_delay_3());
	Sleep(preferences.swag_delay_3());
	// Check for stolen focus, and thus misswag
	if (TableLostFocus()) {
    lost_focus = true;
  }
  // BET CONFIRMATION ACTION
	if (lost_focus) {
    // Print a very verbose warning in the log
    // Experience tell that beginenrs (and veterans) need that.
    write_log(k_always_log_errors, "[CasinoInterface] WARNING! Betsizing failed because of lost focus.\n");
    write_log(k_always_log_errors, "[CasinoInterface] Another window popped up and receives mouse and keyboard input.\n");
    write_log(k_always_log_errors, "[CasinoInterface] This might be caused by bad casino, bad hopper or by user-interaction.\n");
  } else {
		if (p_tablemap->swagconfirmationmethod() == BETCONF_ENTER) 	{
			write_log(preferences.debug_autoplayer(), "[CasinoInterface] Confirmation; calling keyboard.dll to press 'Enter'\n");
			(theApp._dll_keyboard_sendkey) (p_autoconnector->attached_hwnd(), r_null, VK_RETURN, GetFocus(), cur_pos);
		}	else if (p_tablemap->swagconfirmationmethod() == BETCONF_CLICKBET 
			  && p_scraper_access->available_buttons[k_autoplayer_function_raise]) 	{
			write_log(preferences.debug_autoplayer(), "[CasinoInterface] Bet Confirmation: Using raise button\n");
      if (p_tablemap->buttonclickmethod() == BUTTON_DOUBLECLICK) 	{
				ClickButtonSequence(k_autoplayer_function_raise, 
					k_autoplayer_function_raise, 
					k_double_click_delay);
			}	else {
				ClickButton(k_autoplayer_function_raise);
			}
		}	else if (p_tablemap->swagconfirmationmethod() == BETCONF_NOTHING)	{
		} else {
			write_log(preferences.debug_autoplayer(), "[CasinoInterface] ...ending DoBetsize early (invalid betsizeconfirmationmethod).\n");
      write_log(preferences.debug_autoplayer(), "[CasinoInterface] Valid options are: \"enter\", \"click bet\", \"nothing\"\n");
			return false;
		}
		p_autoplayer_trace->Print(ActionConstantNames(k_autoplayer_function_betsize), true);
	}
	int betround = p_betround_calculator->betround();
	write_log(preferences.debug_autoplayer(), "[CasinoInterface] ...ending DoBetsize, 'didbetsize' now: %d\n", 
		p_symbol_engine_history->didswag(betround));
	return (!lost_focus);
}
bool CCasinoInterface::UseSliderForAllin() {
  POINT			cur_pos = {0};
	POINT			point_null = {-1, -1};

	write_log(preferences.debug_autoplayer(), "[CasinoInterface] Starting DoSlider...\n");

	if (!(p_scraper_access->i3_slider_defined && p_scraper_access->i3_handle_defined)) {
		write_log(preferences.debug_autoplayer(), "[CasinoInterface] ...ending DoSlider early (i3handle or i3slider are not defined in the tablemap)\n");
		return false;
	}
	if (!p_table_state->_SCI._handle_found_at_xy)	{
		write_log(preferences.debug_autoplayer(), "[CasinoInterface] ...ending DoSlider early (handle not found - i3handle must use a transform that resolves to either 'handle' or 'true')\n");
		return false;
	}
  // Click and drag handle
	RECT drag_region;
	drag_region.left      = p_table_state->_SCI._handle_xy.x + ((i3_handle_region.right - i3_handle_region.left)/2);
	drag_region.top       = p_table_state->_SCI._handle_xy.y + ((i3_handle_region.bottom - i3_handle_region.top)/2);
	drag_region.right     = p_table_state->_SCI._handle_xy.x + (i3_slider_region.right - i3_slider_region.left);
	drag_region.bottom    = drag_region.top;		

	write_log(preferences.debug_autoplayer(), "[CasinoInterface] Slider : Calling mouse.dll to jam from %d,%d to %d,%d\n", drag_region.left, drag_region.top, drag_region.right, drag_region.bottom);
	(theApp._dll_mouse_click_drag) (p_autoconnector->attached_hwnd(), drag_region, NULL, point_null);

	write_log(preferences.debug_autoplayer(), "[CasinoInterface] Sleeping %d ms\n.", preferences.swag_delay_3());
	Sleep(preferences.swag_delay_3());

	// Click confirmation button
	if (p_tablemap->swagconfirmationmethod() == BETCONF_ENTER) 	{
		write_log(preferences.debug_autoplayer(), "[CasinoInterface] Slider Confirmation : calling keyboard.dll to press 'Enter'\n");
		(theApp._dll_keyboard_sendkey) (p_autoconnector->attached_hwnd(), r_null, VK_RETURN, GetFocus(), cur_pos);
	}	else if (p_tablemap->swagconfirmationmethod() == BETCONF_CLICKBET &&
			 (p_scraper_access->available_buttons[k_autoplayer_function_raise] || p_scraper_access->i3_button_available)) {
		int confirmation_button = k_button_undefined;

		// use allin button if it exists,  
		// otherwise use the bet/raise button region
		if (p_scraper_access->available_buttons[k_autoplayer_function_allin])	{
			write_log(preferences.debug_autoplayer(), "[CasinoInterface] Slider Confirmation : Using the allin button\n");
			confirmation_button = k_autoplayer_function_allin;
		}	else {
			write_log(preferences.debug_autoplayer(), "[CasinoInterface] Slider Confirmation : Using the raise button\n");
			confirmation_button = k_autoplayer_function_raise;
		}

		if (p_tablemap->buttonclickmethod() == BUTTON_DOUBLECLICK)		{
			ClickButtonSequence(confirmation_button, confirmation_button, k_double_click_delay);
		}	else {
			ClickButton(confirmation_button);
		}
	}	else {
		write_log(preferences.debug_autoplayer(), "[CasinoInterface] ...ending DoSlider early (invalid betsizeconfirmationmethod).\n");
		return false;
	}

	p_autoplayer_trace->Print(ActionConstantNames(k_autoplayer_function_allin), true);
	write_log(preferences.debug_autoplayer(), "[CasinoInterface] Jam complete: %d,%d,%d,%d\n", drag_region.left, drag_region.top, drag_region.right, drag_region.bottom);

	// reset elapsedauto symbol
	write_log(preferences.debug_autoplayer(), "[CasinoInterface] ...ending DoSlider.\n");
	return true;
}
Example #12
0
bool CCasinoInterface::EnterBetsize(double total_betsize_in_dollars)
{
	POINT			cur_pos = {0};
	bool			lost_focus = false;
	POINT			point_null = {-1, -1};
	CString			swag_amt;

	write_log(preferences.debug_autoplayer(), "[AutoPlayer] Starting DoSwag...\n");

	// swag regions are hard coded as #3 for now, due to legacy WH standard
	if (!p_scraper_access->i3_edit_defined || !p_scraper_access->i3_button_available)
	{
		write_log(preferences.debug_autoplayer(), "[AutoPlayer] ...ending DoSwag early (no edit field or no i3button).\n");
		return false;
	}

	SelectSwagText();

	// First sleep(), THEN check for stolen focus, then act
	//  NOT the other way: http://www.maxinmontreal.com/forums/viewtopic.php?f=120&t=14791
	write_log(preferences.debug_autoplayer(), "[AutoPlayer] Sleeping %dms.\n", preferences.swag_delay_1());
	Sleep(preferences.swag_delay_1()); 

	// Check for stolen , and thus misswag
	if (TableLostFocus())
		lost_focus = true;
	
	DeleteSwagText();

	// Check for stolen focus, and thus misswag
	if (TableLostFocus())
		lost_focus = true;

	write_log(preferences.debug_autoplayer(), "[AutoPlayer] Sleeping %dms.\n", preferences.swag_delay_2());
	
	// SWAG AMOUNT ENTRY
	double swag_adjusted = AdjustedBetsize(p_autoplayer_functions->f$betsize());

	if (swag_adjusted != (int) swag_adjusted)
		swag_amt.Format("%.2f", swag_adjusted);
	else
		swag_amt.Format("%.0f", swag_adjusted);

	write_log(preferences.debug_autoplayer(), "[AutoPlayer] Swag amount (not adjusted): %.2f\n", p_autoplayer_functions->f$betsize());
	write_log(preferences.debug_autoplayer(), "[AutoPlayer] Swag amount; calling keyboard.dll to swag (adjusted): %s %d,%d %d,%d\n", 
		swag_amt, i3_edit_region.left, i3_edit_region.top, i3_edit_region.right, i3_edit_region.bottom);
	(theApp._dll_keyboard_sendstring) (p_autoconnector->attached_hwnd(), i3_edit_region, swag_amt, preferences.swag_use_comma(), NULL, point_null);

	Sleep(preferences.swag_delay_2());
	// Check for stolen focus, and thus misswag
	if (TableLostFocus())
		lost_focus = true;

	write_log(preferences.debug_autoplayer(), "[AutoPlayer] Sleeping %dms.\n", preferences.swag_delay_3());
	Sleep(preferences.swag_delay_3());

	// BET CONFIRMATION ACTION
	if (!lost_focus)
	{
		if (p_tablemap->swagconfirmationmethod() == BETCONF_ENTER)
		{
			write_log(preferences.debug_autoplayer(), "[AutoPlayer] Confirmation; calling keyboard.dll to press 'Enter'\n");
			(theApp._dll_keyboard_sendkey) (p_autoconnector->attached_hwnd(), r_null, VK_RETURN, GetFocus(), cur_pos);
		}
		else if (p_tablemap->swagconfirmationmethod() == BETCONF_CLICKBET 
			&& p_scraper_access->available_buttons[k_autoplayer_function_raise])
		{
			write_log(preferences.debug_autoplayer(), "[AutoPlayer] Bet Confirmation: Using raise button\n");

			if (p_tablemap->buttonclickmethod() == BUTTON_DOUBLECLICK)
			{
				ClickButtonSequence(k_autoplayer_function_raise, 
					k_autoplayer_function_raise, 
					k_double_click_delay);
			}
			else
			{
				ClickButton(k_autoplayer_function_raise);
			}
		}

		else if (p_tablemap->swagconfirmationmethod() == BETCONF_NOTHING)
		{
		}

		else
		{
			write_log(preferences.debug_autoplayer(), "[AutoPlayer] ...ending DoSwag early (invalid swagconfirmationmethod).\n");
			return false;
		}
		
		write_logautoplay(ActionConstantNames(k_prevaction_betsize));

	}
	int betround = p_betround_calculator->betround();
	write_log(preferences.debug_autoplayer(), "[AutoPlayer] ...ending DoSwag, 'didswag' now: %d\n", 
		p_symbol_engine_history->didswag(betround));
	return (!lost_focus);
}
Example #13
0
int main(int argc, char* argv[]) {
#ifdef _WIN32
	wchar_t exepath[MAX_PATH];
	GetModuleFileNameW(NULL, exepath, MAX_PATH);
	wchar_t* p = wcsrchr(exepath, '\\');
	*p = '\0';
	SetCurrentDirectoryW(exepath);
#endif //_WIN32
#ifdef _WIN32
	WORD wVersionRequested;
	WSADATA wsaData;
	wVersionRequested = MAKEWORD(2, 2);
	WSAStartup(wVersionRequested, &wsaData);
	evthread_use_windows_threads();
#else
	evthread_use_pthreads();
#endif //_WIN32
	ygo::Game _game;
	ygo::mainGame = &_game;
	if(!ygo::mainGame->Initialize())
		return 0;

	bool keep_on_return = false;
	for(int i = 1; i < argc; ++i) {
		if(argv[i][0] == '-' && argv[i][1] == 'e') {
			char param[128];
			GetParameter(param, &argv[i][2]);
			ygo::dataManager.LoadDB(param);
		}
		if(!strcmp(argv[i], "-e")) { // extra database
			++i;
			char param[128];
			GetParameter(param, &argv[i][0]);
			ygo::dataManager.LoadDB(param);
			continue;
		} else if(!strcmp(argv[i], "-n")) { // nickName
			++i;
			wchar_t param[128];
			GetParameterW(param, &argv[i][0]);
			ygo::mainGame->ebNickName->setText(param);
			continue;
		} else if(!strcmp(argv[i], "-h")) { // Host address
			++i;
			wchar_t param[128];
			GetParameterW(param, &argv[i][0]);
			ygo::mainGame->ebJoinHost->setText(param);
			continue;
		} else if(!strcmp(argv[i], "-p")) { // host Port
			++i;
			wchar_t param[128];
			GetParameterW(param, &argv[i][0]);
			ygo::mainGame->ebJoinPort->setText(param);
			continue;
		} else if(!strcmp(argv[i], "-w")) { // host passWord
			++i;
			wchar_t param[128];
			GetParameterW(param, &argv[i][0]);
			ygo::mainGame->ebJoinPass->setText(param);
			continue;
		} else if(!strcmp(argv[i], "-k")) { // Keep on return
			exit_on_return = false;
			keep_on_return = true;
		} else if(!strcmp(argv[i], "-j")) { // Join host
			exit_on_return = !keep_on_return;
			ClickButton(ygo::mainGame->btnLanMode);
			ClickButton(ygo::mainGame->btnJoinHost);
			break;
		} else if(!strcmp(argv[i], "-d")) { // Deck
			exit_on_return = !keep_on_return;
			if(i < argc) {
				open_file = true;
				GetParameterW(open_file_name, &argv[i + 1][0]);
			}
			ClickButton(ygo::mainGame->btnDeckEdit);
			break;
		} else if(!strcmp(argv[i], "-r")) { // Replay
			exit_on_return = !keep_on_return;
			if(i < argc) {
				open_file = true;
				GetParameterW(open_file_name, &argv[i + 1][0]);
			}
			ClickButton(ygo::mainGame->btnReplayMode);
			if(open_file)
				ClickButton(ygo::mainGame->btnLoadReplay);
			break;
		} else if(!strcmp(argv[i], "-s")) { // Single
			exit_on_return = !keep_on_return;
			if(i < argc) {
				open_file = true;
				GetParameterW(open_file_name, &argv[i + 1][0]);
			}
			ClickButton(ygo::mainGame->btnServerMode);
			if(open_file)
				ClickButton(ygo::mainGame->btnLoadSinglePlay);
			break;
		}
	}
	ygo::mainGame->MainLoop();
#ifdef _WIN32
	WSACleanup();
#else

#endif //_WIN32
	return EXIT_SUCCESS;
}
Example #14
0
void FileDialog::OnExtra( wxCommandEvent &WXUNUSED(event) )
{
    ClickButton(m_choice->GetSelection());
}
Example #15
0
bool CCasinoInterface::EnterBetsize(double total_betsize_in_dollars)
{
	POINT			cur_pos = {0};
	bool			lost_focus = false;
	POINT			point_null = {-1, -1};
	CString			swag_amt;

	write_log(prefs.debug_autoplayer(), "[AutoPlayer] Starting DoSwag...\n");

	// swag regions are hard coded as #3 for now, due to legacy WH standard
	if (!p_scraper_access->i3_edit_defined)
	{
		write_log(prefs.debug_autoplayer(), "[AutoPlayer] ...ending DoSwag early (no edit field).\n");
		return false;
	}

	SelectSwagText();

	// First sleep(), THEN check for stolen focus
	write_log(prefs.debug_autoplayer(), "[AutoPlayer] Sleeping %dms.\n", prefs.swag_delay_1());
	Sleep(prefs.swag_delay_1()); 

	// Check for stolen , and thus misswag
	if (GetForegroundWindow() != p_autoconnector->attached_hwnd())
		lost_focus = true;
	
	DeleteSwagText();

	// Check for stolen focus, and thus misswag
	if (GetForegroundWindow() != p_autoconnector->attached_hwnd())
		lost_focus = true;

	write_log(prefs.debug_autoplayer(), "[AutoPlayer] Sleeping %dms.\n", prefs.swag_delay_2());
	
	// SWAG AMOUNT ENTRY
	double swag_adjusted = SwagAmountAdjusted(p_autoplayer_functions->f$betsize());

	if (swag_adjusted != (int) swag_adjusted)
		swag_amt.Format("%.2f", swag_adjusted);
	else
		swag_amt.Format("%.0f", swag_adjusted);

	write_log(prefs.debug_autoplayer(), "[AutoPlayer] Swag amount (not adjusted): %.2f\n", p_autoplayer_functions->f$betsize());
	write_log(prefs.debug_autoplayer(), "[AutoPlayer] Swag amount; calling keyboard.dll to swag (adjusted): %s %d,%d %d,%d\n", 
		swag_amt, i3_edit_region.left, i3_edit_region.top, i3_edit_region.right, i3_edit_region.bottom);
	(theApp._dll_keyboard_sendstring) (p_autoconnector->attached_hwnd(), i3_edit_region, swag_amt, prefs.swag_use_comma(), NULL, point_null);

	Sleep(prefs.swag_delay_2());
	// Check for stolen focus, and thus misswag
	if (GetForegroundWindow() != p_autoconnector->attached_hwnd())
		lost_focus = true;

	write_log(prefs.debug_autoplayer(), "[AutoPlayer] Sleeping %dms.\n", prefs.swag_delay_3());
	Sleep(prefs.swag_delay_3());

	// BET CONFIRMATION ACTION
	if (!lost_focus)
	{
		if (p_tablemap->swagconfirmationmethod() == BETCONF_ENTER)
		{
			write_log(prefs.debug_autoplayer(), "[AutoPlayer] Confirmation; calling keyboard.dll to press 'Enter'\n");
			(theApp._dll_keyboard_sendkey) (p_autoconnector->attached_hwnd(), r_null, VK_RETURN, GetFocus(), cur_pos);
		}
		else if (p_tablemap->swagconfirmationmethod() == BETCONF_CLICKBET &&
				 (p_scraper_access->available_buttons[k_autoplayer_function_raise] || p_scraper_access->i3_button_available))
		{
			int confirmation_button = k_button_undefined;

			// use i3button region if it exists, otherwise use the bet/raise button region
			if (p_scraper_access->i3_button_available)
			{
				confirmation_button = k_button_i3;
				write_log(prefs.debug_autoplayer(), "[AutoPlayer] Bet Confirmation: Using i3button\n");
			}
			else
			{
				confirmation_button = k_button_raise;
				write_log(prefs.debug_autoplayer(), "[AutoPlayer] Bet Confirmation: Using raise button\n");
			}

			if (p_tablemap->buttonclickmethod() == BUTTON_DOUBLECLICK)
			{
				ClickButtonSequence(confirmation_button, confirmation_button, k_double_click_delay);
			}
			else
			{
				ClickButton(confirmation_button);
			}
		}

		else if (p_tablemap->swagconfirmationmethod() == BETCONF_NOTHING)
		{
		}

		else
		{
			write_log(prefs.debug_autoplayer(), "[AutoPlayer] ...ending DoSwag early (invalid swagconfirmationmethod).\n");
			return false;
		}
		
		p_symbols->RecordPrevAction(k_action_betsize);
		write_logautoplay(ActionConstantNames(k_action_betsize));

		p_heartbeat_thread->set_replay_recorded_this_turn(false);
	}
	int betround = p_betround_calculator->betround();
	write_log(prefs.debug_autoplayer(), "[AutoPlayer] ...ending DoSwag, 'didswag' now: %d\n", 
		p_symbol_engine_history->didswag(betround));
	return (!lost_focus);
}
void FILEDIALOG::OnExtra( wxCommandEvent &WXUNUSED(event) )
{
#if !defined(GENERIC_FILEDIALOG)
   ClickButton(m_choice->GetSelection());
#endif
}