Sign in to follow this  
Followers 0
Odlid

MouseClicks not Working in Flash Game

6 posts in this topic

#1 ·  Posted (edited)

I'm having issues automating a flash game called Dofus. Wondering if anyone has any suggestions. First.....this is not an Autoit installation issue nor a a 'need help programming' request. I've been able to successfully do all of these things in a non-flash game (Freecell). Here are my two issues:

Gaining Focus

The following should maximize the Dofus window and make that window have focus. It does neither:

WinActive("Dofus ")

WinSetState("Dofus ", "", @SW_RESTORE)

WinSetState("Dofus ", "", @SW_MAXIMIZE)

I got the "Dofus " from Autoit Window Info. Yes, I've tried it without the trailing spaces.

Mouse Clicking

Let's assume that I have the Dofus window open on the screen then I fire up a compiled Autoit script. I get these actions working:

  • Mouse movement using Opt("MouseCoordMode", 1)
  • Pixel Color Checking using Opt("PixelCoordMode", 1)
  • MouseGetPos

However none of the following cause a left mouseclick on the Dofus screen:

MouseClick("left")

MouseClick("primary")

ControlClick("Dofus ", "", "","left",1, 100, 100)

MouseClick("left",100,100,1,0)

MouseClick("primary",100,100,1,0)

Global $hWnd

$hWnd = WinGetHandle("Dofus ")

_MouseClick($hWnd, "left", 100, 100, 1, 0)

Func _MouseClick($hWnd, $button, $x, $y, $times=1, $delay=250)

If $hWnd = 0 Then

SetError(-1)

Return

EndIf

Local $ix

Local $lParam = _MakeLong($x, $y)

Local $user32 = DllOpen("user32.dll")

$button = StringLower($button)

For $ix = 1 To $times

DllCall($user32, "int", "PostMessage", "hwnd", $hWnd, "int", 0x200, "int", 0, "long", $lParam)

DllCall($user32, "int", "PostMessage", "hwnd", $hWnd, "int", 0x201, "int", 1, "long", $lParam)

DllCall($user32, "int", "PostMessage", "hwnd", $hWnd, "int", 0x202, "int", 0, "long", $lParam)

If $ix < $times Then Sleep($delay)

Next

If $user32 <> -1 Then DllClose($user32)

EndFunc

Func _MakeLong($LoWord, $HiWord)

Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))

EndFunc

I only have Vista machines but I've tried this on three separate ones with various mouse drivers - in no case did I get this to work.

Additional factoid. MouseMove works until I manually move the mouse. Then MouseMove no longer works over the Dofus screen.

Dofus can be found here. Dofus is a flash game but it is really a server side game with a flash front end. The front end seems to render graphics and handle network communications with the Dofus servers. I'm not messing at all with the client code here - I'm strictly trying to animate some boring repetitive tasks that require repetitive key clicks.

Any ideas?

Edited by Odlid

Share this post


Link to post
Share on other sites



Well first of all dofus has many fake things and tricks in it which kinda screws Cheat Engine, WPE pro and including autoit v3 and many more, dofus is to be said "UNHACKABLE" by their OWN staff. If you want to actully have a auto clicker just download one -----> MACRO ita a 15 day trial but theres a trick that you can do to keep it forever, just keep reverting the date back to wen it was downloaded by changeing you date and time to wen u downloaded. Also i play dofus and i honstly use this program because farming and alchemist is a pain in the ass. Well i know i didnt help but u cant really do nothin :)

Share this post


Link to post
Share on other sites

Hmm. If this program can force a keystroke then why can't I do so out of Autoit?

I wonder if you can make a generic 'keyclick' program, call it from Autoit, and have the generic program click on the screen. I can position the cursor just fine (as long as i don't touch the mouse manually...)

Share this post


Link to post
Share on other sites

So...are there any suggestions on how to get a mouse click into this program from Autoit? I could use your help....

Share this post


Link to post
Share on other sites

So...are there any suggestions on how to get a mouse click into this program from Autoit? I could use your help....

Well i think your out of luck i dont really think there is any way to do that, i looked on youtube and stuff but all i could see is these same or close to this replys over and over again :) "Dofus is one of Ankama games and they have put alot of work in thier secruity rather than their games and have made thier game unhackable by disabling or redirecting many "cheating" programs [Cheatengine, WPE pro , Autoit sadly and much more trust me(those r the main 3 used)] into somewhere else which causes art money, program crashing and program disabling which is what is happening to autoit, because its not working right. So the only thing u can do is exclude autoit from dofus for now and just do theporgram alone.Usefull for farming but wen a scarecrow pops up i gotta press esc so i can take control all over agin. If you need to contact me the best way is my emailsince i dont check my profile on this site or just contact me in dofus lolz :party: my name is "Infectiondisease" my main char i go on is Dark-Shadowxz

Sorry i couldn't help....

Share this post


Link to post
Share on other sites

Hi,

I know it's a big up, but I have a question about this. I wrote an AutoIt script to automate tasks in Dofus. It worked perfectly on my old OS, Windows XP. But I changed to Vista one week ago, and since, I couldn't get my script to click in this window. So I was wondring how could Ankama Games could detect and prevent iti, because it work fine for random flash games found on the Internet.

If you found some mistakes, it may be because I'm French.

Anyway, thank you for your answers.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0