CosmosTunes Posted November 21, 2006 Share Posted November 21, 2006 (edited) Hi all, I'm working on a WoQ2 Bot. The Bot runs well but I got some trouble with the mouseclick() function. The click doesnt work allways. Seems like the programm doesnt click arround 2 times of 10 trys... The problem is that i want to write moving functions in the next time but if the mouseclick doesnt work the moving functions will not work with 100 % guarantee. Is there any solutions to get a 100 % working click ? I hope someone can help me Here is a example file how i tested the mouseclick... ; search and click on npc $coord = searchForColor(50, 50, 700, 400, 13507642) if IsArray($coord) Then MouseMove($coord[0], $coord[1], 0) Sleep(100) MouseClick("left"); <<<< this doesnt work alltime :( EndIf ;=================================================================================================== == ; This function will search for a color and gives a array back ;=================================================================================================== == Func searchForColor($XStart, $YStart, $XEnd, $YEnd, $SearchColor) ;------------------------------------------------------------------------------------------------- ; Parameters for this function: ; - $XStart -> Coord for left ; - $YStart -> Coord for top ; - $XEnd -> Coord for right ; - $YEnd -> Coord for bottom ; - $SearchColor -> find this clor ;------------------------------------------------------------------------------------------------- $Coord = PixelSearch( $XStart, $YStart, $XEnd, $YEnd, $SearchColor, 25) If Not @error Then LogEvent(9, "searchForColor -> Color: " & $SearchColor & " found! X and Y are:", $Coord[0] & "," & $Coord[1]); for debug Else LogEvent(9, "searchForColor -> Color: " & $SearchColor & " not found!"); for debug $Coord = @error EndIf Return $Coord EndFunc Edited November 21, 2006 by CosmosTunes Link to comment Share on other sites More sharing options...
/dev/null Posted November 21, 2006 Share Posted November 21, 2006 MouseClick("left"); <<<< this doesnt work alltime how do you know it does not work? __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
CosmosTunes Posted November 21, 2006 Author Share Posted November 21, 2006 because i used this test script many times in the game. he allways find the npc where he should click. the script move the mouse over him. but it doesnt click allways on it arround 8 of 10 trys... Link to comment Share on other sites More sharing options...
CosmosTunes Posted November 23, 2006 Author Share Posted November 23, 2006 is there no solution for a secure mouseclick() ? Link to comment Share on other sites More sharing options...
NeoFoX Posted November 23, 2006 Share Posted November 23, 2006 Well... You have atm Mouseclick("Left") try: Mouseclick("Left", $coord[0], $coord[1]) This to be sure the mouse click is on those coordinates... Neo [center][font="Arial"]--- The Neo and Only --- [/font][font="Arial"]--Projects---[/font]Image to Text converterText to ASCII converter[/center] Link to comment Share on other sites More sharing options...
CosmosTunes Posted November 23, 2006 Author Share Posted November 23, 2006 the problem is not the position. he script is on the right position. and i tryed this before too. The problem ist that he dont press click sometimes Link to comment Share on other sites More sharing options...
NeoFoX Posted November 23, 2006 Share Posted November 23, 2006 But if the problem is the click, how do you know that the mouse is in the right position? You have now this: MouseMove($coord[0], $coord[1], 0) Sleep(100) MouseClick("left") You could drop these lines for: MouseClick("Left", $coord[0], $coor[1]) Perhaps that the mousemove isn't that fast to be in $coord[0] and $coord[1] in 0,1 sec... Neo [center][font="Arial"]--- The Neo and Only --- [/font][font="Arial"]--Projects---[/font]Image to Text converterText to ASCII converter[/center] Link to comment Share on other sites More sharing options...
Punkie Posted November 23, 2006 Share Posted November 23, 2006 I had this problem a few months ago (my first experience with AutoIt) and discovered the same thing. The solution I found was MouseClick("primary") worked all the time. Link to comment Share on other sites More sharing options...
CosmosTunes Posted November 24, 2006 Author Share Posted November 24, 2006 I had this problem a few months ago (my first experience with AutoIt) and discovered the same thing. The solution I found was MouseClick("primary") worked all the time. i know that the mouse position is not my problem because the mouse courser is on the right position. maybe you got write that the mouse speed is not enough. i will try MouseClick("primary", $coord[0], $coor[1]) tonight. I hope this problem fix it. thx for the reply. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now