Help, i pay

Ask gaming related questions (AHK v1.1 and older)
Gonzalo94
Posts: 40
Joined: 17 Jul 2017, 12:56

Help, i pay

24 Sep 2017, 12:08

Hello, i need a script that will make a "zone" in the client of the game ") that will have the effect that when i press left button in that "zone", automatically will press f1 before that click (im not good making ahk codes)
thanks if anyone can help me, i pay if it necesary via Paypal

(the red zone= the zone where if i press left click, it will press f1 before that click)
Last edited by Gonzalo94 on 26 Sep 2017, 14:10, edited 4 times in total.
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
Location: France
Contact:

Re: Question

24 Sep 2017, 12:48

Hi Gonzalo94,

Yes. Here's some commands that seems to relevant in your case:

hotkeys
#IfWinActive
Send
CoordMode
MouseGetPos
If var [not] between LowerBound and UpperBound
my scripts
Gonzalo94
Posts: 40
Joined: 17 Jul 2017, 12:56

Re: Question

24 Sep 2017, 14:44

A_AhkUser wrote:Hi Gonzalo94,

Yes. Here's some commands that seems to relevant in your case:

hotkeys
#IfWinActive
Send
CoordMode
MouseGetPos
If var [not] between LowerBound and UpperBound
sended to you a private msg :)
Gonzalo94
Posts: 40
Joined: 17 Jul 2017, 12:56

Re: Question

24 Sep 2017, 15:02

The game is
this in the client of the game
The red are the coords where i want the effect of the left click (automatically press f1 before the left click)
Last edited by Gonzalo94 on 24 Sep 2017, 15:40, edited 1 time in total.
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
Location: France
Contact:

Re: Question

24 Sep 2017, 15:12

Ok so below a sample script. Basically it will send F1 before clicking if the mouse appears to be in the red area (0,0 - 200,200) - adjust the if betwwen lines parameters to make it fit your purposes (I made the script display the coordinates to help you find them).


Image

Code: Select all

CoordMode, Mouse, Window ; sets mouse coordinates  to be relative to either the active window
SetTitleMatchMode, 2 ; A window's title can contain WinTitle param anywhere inside it to be a match. 

#IfWinActive OS-Scape
$LButton::
MouseGetPos, x, y ; retrieves the current position of the mouse cursor
ToolTip % x . "," . y ; displays these coordinates (for test purpose)
if x between 0 and 200
	if y between 0 and 200
	{
		send, {F1}{LButton}
	return
	}
; otherwise...
send, {LButton}
return ; end of the hotkey subroutine

Hope it helps.
my scripts
Gonzalo94
Posts: 40
Joined: 17 Jul 2017, 12:56

Re: Question

24 Sep 2017, 15:40

A_AhkUser wrote:Ok so below a sample script. Basically it will send F1 before clicking if the mouse appears to be in the red area (0,0 - 200,200) - adjust the if betwwen lines parameters to make it fit your purposes (I made the script display the coordinates to help you find them).


Image

Code: Select all

CoordMode, Mouse, Window ; sets mouse coordinates  to be relative to either the active window
SetTitleMatchMode, 2 ; A window's title can contain WinTitle param anywhere inside it to be a match. 

#IfWinActive OS-Scape
$LButton::
MouseGetPos, x, y ; retrieves the current position of the mouse cursor
ToolTip % x . "," . y ; displays these coordinates (for test purpose)
if x between 0 and 200
	if y between 0 and 200
	{
		send, {F1}{LButton}
	return
	}
; otherwise...
send, {LButton}
return ; end of the hotkey subroutine

Hope it helps.

OMGGGGG THANKS!! ITS WORKS
Gonzalo94
Posts: 40
Joined: 17 Jul 2017, 12:56

Re: Question

25 Sep 2017, 14:02

A_AhkUser wrote:Ok so below a sample script. Basically it will send F1 before clicking if the mouse appears to be in the red area (0,0 - 200,200) - adjust the if betwwen lines parameters to make it fit your purposes (I made the script display the coordinates to help you find them).


Image

Code: Select all

CoordMode, Mouse, Window ; sets mouse coordinates  to be relative to either the active window
SetTitleMatchMode, 2 ; A window's title can contain WinTitle param anywhere inside it to be a match. 

#IfWinActive OS-Scape
$LButton::
MouseGetPos, x, y ; retrieves the current position of the mouse cursor
ToolTip % x . "," . y ; displays these coordinates (for test purpose)
if x between 0 and 200
	if y between 0 and 200
	{
		send, {F1}{LButton}
	return
	}
; otherwise...
send, {LButton}
return ; end of the hotkey subroutine

Hope it helps.
Thanks for the help of the other day, but i want to change now some things, idk if is posible, instead of having the click effect i want this effect that i have in my another AHK

Code: Select all

SetMouseDelay 8
~$LButton::
While GetKeyState("LButton", "P"){
    Click
    sleep,10
    }
return

F10::Suspend, On
F7::Suspend, Off
In summary, convine the script that u give to me with this, its is possible?
Regards
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
Location: France
Contact:

Re: Question

26 Sep 2017, 13:09

Hola Gonzalo,

This should work:

Code: Select all

CoordMode, Mouse, Window ; sets mouse coordinates  to be relative to either the active window
SetTitleMatchMode, 2 ; A window's title can contain WinTitle param anywhere inside it to be a match. 


#IfWinActive OS-Scape
$LButton::
SetMouseDelay 8
MouseGetPos, x, y ; retrieves the current position of the mouse cursor
ToolTip % x . "," . y ; displays these coordinates (for test purpose)
if x between 0 and 200
	if y between 0 and 200
	{
		While (GetKeyState("LButton", "P")) {
			click
		sleep,10
		}
	return
	}
send, {LButton}
return ; end of the hotkey subroutine

F10::Suspend, On
F7::Suspend, Off
my scripts
Gonzalo94
Posts: 40
Joined: 17 Jul 2017, 12:56

Re: Question

26 Sep 2017, 14:10

A_AhkUser wrote:Hola Gonzalo,

This should work:

Code: Select all

CoordMode, Mouse, Window ; sets mouse coordinates  to be relative to either the active window
SetTitleMatchMode, 2 ; A window's title can contain WinTitle param anywhere inside it to be a match. 


#IfWinActive OS-Scape
$LButton::
SetMouseDelay 8
MouseGetPos, x, y ; retrieves the current position of the mouse cursor
ToolTip % x . "," . y ; displays these coordinates (for test purpose)
if x between 0 and 200
	if y between 0 and 200
	{
		While (GetKeyState("LButton", "P")) {
			click
		sleep,10
		}
	return
	}
send, {LButton}
return ; end of the hotkey subroutine

F10::Suspend, On
F7::Suspend, Off


YOUR A GOD!!! PERFECT, YOU SOLVE ALL MY PROBLEMS

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Ineedhelplz, yuu453 and 92 guests