Minimized Bot Help!!

03/21/2013 01:28 elmarcia#1
Hi elitepvpers i want to make a bot that will work with the game window minimized so that i can do anything else while the bot is running but i have some troubles D:

The script only click Start button, its a begining

[Only registered and activated users can see links. Click Here To Register...]


When the button is clicked the game start:
[Only registered and activated users can see links. Click Here To Register...]

The game : S4League


Here is my script:

Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Misc.au3>

$i = 0
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Minimize Bot", 239, 131, 196, 124)

$Button1=GUICtrlCreateButton("Click Ready",56,40,123,49)


GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###




global $startx,$starty

AdlibRegister("_Winsize",1000)
Func _Winsize()
	if WinExists("S4 Client") Then
	 $size = WinGetClientSize("S4 Client");Returns size of the window
	$_sizex = $size[0]
	$_sizey=$size[1]
	$_TotalSize=$_sizex & "," & $_sizey

	Switch  $_TotalSize
		Case "1024,752" ;two posible resolution one in window mode and other in fullscreen

			$startx=944
			$starty=519

		Case "1024,768"

			$startx=947
			$starty=504

			EndSwitch
	EndIf
EndFunc

Func _Attack()
	While (not _IsPressed("60"));NUMPAD0

	_WinAPI_Mouse_Event(0x0002)
				Sleep(100)
	_WinAPI_Mouse_Event(0x0004)
	Sleep(500)
WEnd
Exit 0
	EndFunc

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		case $Button1

		WinSetState("S4 Client","",@SW_MINIMIZE)
		Sleep(100)
		ControlClick("S4 Client","","","left",2,$startx,$starty);click Ready button
		Sleep(500)
		_Attack()
EndSwitch
WEnd
The problems are...
Anti Hacking Program Block keystrokes so i'm suposed to use _isPressed, to set hotkeys, and _WinAPI_Mouse_Event() to make the bot work when the character is ready.
but...
_WinAPI_Mouse_Event doesn't work when the window is minimized
ControlClick would be good but i think is blocked too... because it doesn't do anything...

Don't Tested: _SendMessage/PostMessage cause i don't know how to make them work with these...

Until Now the only thing which is working is clicking Start button when window is minimized it just click elsewhere

Question:
Is there any way to combine ControlClick function with _WinAPI_Mouse_Event ??

What the bot should do?:
it should click start , then send mouseclicks to make the character autoattack all of these with the window minimized

Its a beta version so i don't make an effort to continue loop when finish,
until i solve this problem...
03/21/2013 11:18 Croco™#2
In the S4 section was an AutoIT bypass a few mounth ago.
Maybe you can use ControlSend with this bypass.
03/21/2013 12:40 Achat#3
Code:
WinActivate ; - S4 in foreground
;Your actions
WinActivate  ; - last window in foreground again
Kind Regards
03/21/2013 14:49 elmarcia#4
Quote:
Originally Posted by Achat View Post
Code:
WinActivate ; - S4 in foreground
;Your actions
WinActivate  ; - last window in foreground again
Kind Regards
The thing is that i don't want the window to bother me all the time also the mouseclick event is all the time so the focus event will make me crazy

i want to make it work with the window minimized with no need to maximize again ;)

Quote:
Originally Posted by Croco™ View Post
In the S4 section was an AutoIT bypass a few mounth ago.
Maybe you can use ControlSend with this bypass.
i think its patched by i will check if there is one more recent

Can anyone make me an example of _SendMessage/PostMessage cause i have no idea how to make that work with mouse events
03/21/2013 18:39 Achat#5
Quote:
Originally Posted by elmarcia View Post
i think its patched by i will check if there is one more recent

Can anyone make me an example of _SendMessage/PostMessage cause i have no idea how to make that work with mouse events
Send/Postmessage doesn't work either.
S4 Client only accepts keystrokes if it is in foreground.

Kind Regards