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.
MouseClickDrag problem (Pokemon Go selling pokemons script)
- Brazolek123
- Posts: 187
- Joined: 06 Jun 2016, 16:02
Re: MouseClickDrag problem (Pokemon Go selling pokemons script)
Have u tried changing CoordMode?
Re: MouseClickDrag problem (Pokemon Go selling pokemons script)
Thanks for your reply, no I haven't. Care to elaborate or even better change the code? Ty!
Re: MouseClickDrag problem (Pokemon Go selling pokemons script)
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:
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.
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---
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.
Re: MouseClickDrag problem (Pokemon Go selling pokemons script)
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.
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.
- Brazolek123
- Posts: 187
- Joined: 06 Jun 2016, 16:02
Re: MouseClickDrag problem (Pokemon Go selling pokemons script)
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
Who is online
Users browsing this forum: No registered users and 26 guests