LotusCobra Posted February 5, 2013 Posted February 5, 2013 (edited) I'm trying to program a simple program for self use in Magic Online. I followed a few simple tutorials to get accustomed to the syntax (used to C++) and I've hit a bit of a brick wall with the simplest of functions. I cannot seem to get the program to click anywhere on the game window. I don't get any errors or anything, it just doesn't do anything. (Seemingly) I'm using a GUI button to call this incredibly simple function: Func GoToCollection() MouseClick("Left",240,1021, 2) EndFunc My GUI code: GUICreate("Test Window",500,500) GUISetState(@SW_SHOW) $startbutton = GUICtrlCreateButton("Start", 8, 8, 60) While 1 $msg = GUIGetMsg() Select Case $msg = $startbutton WinActivate("Magic Online", "") Sleep(1000) Call(GoToCollection()) Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop EndSelect WEnd Obviously, I've double and triple decked that the mouse coordinates are correct before posting, so it's not something as silly as that, but I imagine it's something rather simple that I'm overlooking, but I can't seem to figure it out via Google searches. The window switch works, but then nothing happens. I've tried it without the function call and just doing it in the switch, I've tried clicking a lot of different buttons but none of them will click. Any idea what I'm overlooking here? Edited February 5, 2013 by LotusCobra
MrChiliCheese Posted February 5, 2013 Posted February 5, 2013 Have a look in the help file at Opt / MouseCoordMode. My guess is that you got the values with WinInfo. Within the default setting the mouse is moved to the absolut screen coordinates. Try this in the beginning of your script: Opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client
water Posted February 5, 2013 Posted February 5, 2013 Welcome to Autoit and the forum! Unfortunately you've missed to read the forum rules (link is in the lower right corner of this page). Game automation isn't allowed here. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
LotusCobra Posted February 5, 2013 Author Posted February 5, 2013 (edited) Have a look in the help file at Opt / MouseCoordMode. My guess is that you got the values with WinInfo. Within the default setting the mouse is moved to the absolut screen coordinates. Try this in the beginning of your script: Opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client Hmm, tried it in all 3 modes and none of them seemed to change anything. Welcome to Autoit and the forum! Unfortunately you've missed to read the forum rules (link is in the lower right corner of this page). Game automation isn't allowed here. Even when it's widely supported by the game? The game's entire economy is run by bots. (And it's mostly seen as a good thing) Edited February 5, 2013 by LotusCobra
water Posted February 5, 2013 Posted February 5, 2013 The Mods handle the rules rather strict when it comes to game automation. Let's see what the Mods say ... My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Moderators Melba23 Posted February 5, 2013 Moderators Posted February 5, 2013 LotusCobra,water is quite right - please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. We have no interest in what goes on elsewhere - here we do not support bots. Follow the rules or leave. Thread locked. MrChiliCheese,If a post is obviously game-related (and "for self use in Magic Online" is a pretty good clue) best not to offer any help. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts