MouseClickDrag problem (Pokemon Go selling pokemons script)

Ask gaming related questions (AHK v1.1 and older)
inthesky2
Posts: 35
Joined: 15 Jan 2016, 03:09

MouseClickDrag problem (Pokemon Go selling pokemons script)

28 Jul 2016, 20:36

I wrote a small script that clicks at the location of the mouse (selects the pokemon), scrolls down, clicks the "transfer" button using imagesearch, clicks the "yes" button to confirm the sale using imagesearch. The problem with my script is that it isn't scrolling down using "MouseClickDrag". I have tried using Jitbit Macro Recorder and it scrolls down, however it's not very accurate like ahk.

~s::
{
Click, 2
sleep, 5000
MouseClickDrag, left, 530, 860, 530, 55 ;;;;; This is the part that is supposed to scroll down
ImageSearch, x, y, 100, 820, 382, 907, C:\Users\L\Desktop\Pokemon\transfer.png
If Errorlevel = 0
{
sleep, 2000
click

ImageSearch, x, y, 206, 584, 339, 639, C:\Users\L\Desktop\Pokemon\yes.png
If Errorlevel = 0
{
sleep, 2000
Click
}
}
}
return


All this is done inside an android emulator running on a windows 10 PC.

Image

Image

Image
User avatar
Brazolek123
Posts: 187
Joined: 06 Jun 2016, 16:02

Re: MouseClickDrag problem (Pokemon Go selling pokemons script)

28 Jul 2016, 20:45

Have u tried changing CoordMode?
inthesky2
Posts: 35
Joined: 15 Jan 2016, 03:09

Re: MouseClickDrag problem (Pokemon Go selling pokemons script)

28 Jul 2016, 20:57

Thanks for your reply, no I haven't. Care to elaborate or even better change the code? Ty!
Acuena
Posts: 20
Joined: 27 Jan 2014, 14:56

Re: MouseClickDrag problem (Pokemon Go selling pokemons script)

29 Jul 2016, 02:44

CordMode lets you specify if the coords system should be from the application or the entire screen.
You can read more about it here: https://autohotkey.com/docs/commands/CoordMode.htm

You can try:
CoordMode, Mouse, Window

Put this at the first line in you code, above all other code, like this:

Code: Select all

CoordMode, Mouse, Window
~s::
{
Click, 2
sleep, 5000
---SNIP---
You can change the last parameter to one of theese (taken from the link above):
Screen: Coordinates are relative to the desktop (entire screen).
Relative: Coordinates are relative to the active window.
Window [v1.1.05+]: Synonymous with Relative and recommended for clarity.
Client [v1.1.05+]: Coordinates are relative to the active window's client area, which excludes the window's title bar, menu (if it has a standard one) and borders. Client coordinates are less dependent on OS version and theme.
inthesky2
Posts: 35
Joined: 15 Jan 2016, 03:09

Re: MouseClickDrag problem (Pokemon Go selling pokemons script)

29 Jul 2016, 15:21

I've tried CoordMode, Mouse, Window / CoordMode, Mouse, Screen / CoordMode, Mouse, Relative -- nothing works :(

However I realized that I can't peform a mousedrag on my desktop either using something like

~F2::
MouseClickDrag, left, 2118, 499, 2250, 815


The mouse appears at the first coordinate, then moves to the second coordinate but it doesn't select folders inside those coordinates, basically there is no clicking.
User avatar
Brazolek123
Posts: 187
Joined: 06 Jun 2016, 16:02

Re: MouseClickDrag problem (Pokemon Go selling pokemons script)

30 Jul 2016, 06:04

okey, i just looked it up fast, so few things. you shouldnt assign same variable to different functions > imagesearch x, y. Also try to add:

Code: Select all

sendmode event
mouseclickdrag...
sendmode input

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 26 guests