It is currently 23 Mar 2018, 16:37
Text Size

Using Autohotkey with Magic Online

Discuss anything concerning this site and its contents

Moderator: CCGHQ Admins

Using Autohotkey with Magic Online

Postby SteB » 01 May 2017, 12:15


i don't know if this is the right section of this forum for this kind of question, but i haven't found any that would suit it more so i've picked this one.

I'm trying to write a autohotkey script that uses the autohotkey 'imagesearch' function to get some more advanced macros for mtgo v4. However there seem to be some kind of issues that prevent that. See my description in the official ahk forum (spam protection doesn't allow me to link):

i was fiddling around with the imageSearch function today. As mentioned in the title i want to use it with Magic Online v4 by Wizards of the Coast.

At first i wrote some simple scripts and tried to match some images on a few random websites to get familiar with the functionality, which worked without any issues. So i moved on to my actual task.
I screencapped the attached image, which shows the gameplay screen. (note: this is jpg image to reduce the file size, for the script i worked with png images)

I tried to match several interface elements, controls and card images but non of that worked.
Something strange happend to which at first made it to appear as if the script is working. I got positiv hits from the script, but not from the position where the images appear in the game screen. The script matched the preview thumbnails in the directory where i stored the imageFiles and the script. After i realized that i noticed that this even works when the magic online gamewindow overlaps or even covers the windows explorer window entierely. In that case the script still matches the preview thumbnails in the explorer window behind the game window.
So it appears that ahk seems to ignore the magic online window for some reason when using image search.

I ried if the game window is able to recive clicks and that seems to work without issues.

here is my script:
(the area i try to match is just the entire area shown by my 2 monitors)
Code: Select all

    ; ImageSearch, FoundX, FoundY, 40,40, 300, 300, C:\My Images\test.bmp
    ; CoordMode Pixel  ; Interprets the coordinates below as relative to the screen rather than the active window.
    ImageSearch, FoundX, FoundY, 0, 0, 3120, 1050, symbol.png
    if ErrorLevel = 2
        MsgBox Could not conduct the search.
    else if ErrorLevel = 1
        MsgBox Icon could not be found on the screen.
        MsgBox The icon was found at %FoundX%x%FoundY%.

    MouseMove FoundX, FoundY
I already tried:
*) running the script in admin mode
*) compling the script and running the exe
*) running the exe in admin mode

Does anybody now what else I could try here?
//edit: link: (remove _ in c_om)
https://autohotkey.c_om/boards/viewtopi ... 18&t=31200

Has anyone here have any expirience with Authohotkey and Mtgo by chance? I figured that this forum might be a place where i could get lucky since at least in the past it would have been read by the kind of people that know about autohotkey :)
Posts: 1
Joined: 01 May 2017, 12:05
Has thanked: 0 time
Been thanked: 0 time

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 2 guests

Login Form