Jump to content

MouseClicks not Working in Flash Game - (Locked)


Recommended Posts

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
Link to comment
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 :)

Link to comment
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...)

Link to comment
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....

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

  • 9 years later...
  • Moderators

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in - they have changed considerably since this thread was started. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

P.S. And necro-posting in threads over 9 years old is also something we frown upon.

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...