Jump to content

Recommended Posts

Posted (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 by LotusCobra
Posted

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
Posted

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:

  Reveal hidden contents

 

Posted (edited)

  On 2/5/2013 at 7:52 AM, 'MrChiliCheese said:

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.

  On 2/5/2013 at 8:11 AM, 'water said:

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 by LotusCobra
Posted

The Mods handle the rules rather strict when it comes to game automation. Let's see what the Mods say ...

My UDFs and Tutorials:

  Reveal hidden contents

 

  • Moderators
Posted

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. :naughty:

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

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:

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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