how are you moving the mouse and sending the click?
Heya guys,
Some days ago I made a bot for a game called World Of Tanks. So let's explain better what it does:
• It opens the game and logs you in (everything is ok here)
• Then the mouse should move to a button named Battle! (which starts you a battle) and click it (here is where the problem is)
• Exits the game and opens it again ...
So when in step 2 when it should move it to the button and press it it just stays at one place but if I move it a bit it teleports to the button but doesn't click it maybe it clicks while moving but as I said it doesnt want to move. I tried both fullscreen and windowed but still the same result.
If some1 know why this happens and could help me somehow it will be nice.
Thanks!
EDIT: Tried to do
MouseMove($xcoord,$ycoord,0)
and
MouseClick("main", , ,5,0)
instead of
MouseClick("main",$xcoord,$ycoord,5,0)
But the result was the same; also tried running as administrator and didnt help
Last edited by stanislavmil; 08-21-2013 at 01:25 PM.
how are you moving the mouse and sending the click?
'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
--
MoveMouse(***)
does the cursor ever move correctly?
Did you mess with MouseCoordMode ?
Work on getting the mouse to move correctly first, then worry about the clicks.
'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
--
Tried some different things now and when I let it without touching the mouse and when the game closes at the end then I see the cursor going to the place it should do before the game closes but if I touch the mouse as I said it just teleport to where it should be.
EDIT: I have While/WEnd loop and I dont know if it is a problem for the mouse movement/clicks
---------- Post added at 01:59 PM ---------- Previous post was at 01:48 PM ----------
Thats the code I use tried with 2 MouseClick-s but same result it just dont want to move in the gameCode:Opt("MouseCoordMode", 1) ;Misc; $WoT = "WoT" $win = "W.o.T. Client" ;-------------------------; ;Times; $loading = 25000 $battle = 15000 $restart = 480000 ;-------------------------; While 1 ShellExecute($WoT,"" @desktopDir) WinActivate($WoT) sleep($loading) send("{ENTER}") sleep(2000) MouseClick("left", 679, 42, 2) MouseClick("left", 681, 42, 2) sleep($battle) WinClose($win) sleep($restart) WEnd
Last edited by stanislavmil; 08-21-2013 at 01:49 PM.
Opt("MouseCoordMode", 1)
;Misc;
$WoT = "WoT"
$win = "W.o.T. Client"
;-------------------------;
;Times;
$loading = 25000
$battle = 15000
$restart = 480000
;-------------------------;
While 1
ShellExecute($WoT,"" @desktop
Dir)
WinActivate($WoT)
sleep($loading)
send("{ENTER}")
sleep(2000)
MouseMove(679,42)
Sleep(2000)
MouseClick("left")
MouseClick("left")
sleep($battle)
WinClose($win)
sleep($restart)
WEnd
---------------------------------------------------------
Does the cursor display when you sleep() after moving it?
edit: assuming the window is in the same place and (679,24) is still valid point.
Do the clicks work in your code - the button gets clicked on? Just the cursor won't display?
Opt("MouseCoordMode", 1)
;Misc;
$WoT = "WoT"
$win = "W.o.T. Client"
;-------------------------;
;Times;
$loading = 25000
$battle = 15000
$restart = 480000
;-------------------------;
While 1
ShellExecute($WoT,"" @desktop
Dir)
WinActivate($WoT)
sleep($loading)
send("{ENTER}")
sleep(2000)
MouseMove(679,42)
Sleep(2000)
MouseClick("left",Default,Default, 2,0)
sleep($battle)
WinClose($win)
sleep($restart)
WEnd
Last edited by abuckau907; 08-21-2013 at 03:27 PM.
'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
--
Ok thanks for your help dude but it still doesnt move on its own.
But today I found this script and tried it out.
It does not include auto login but requires you to be logged in. So when I run it the mouse movement works but doesnt with mine script.
If you want me to record my screen when trying it so you can see what happens I could do it.