Help Needed for

Ask gaming related questions (AHK v1.1 and older)
pedroabs
Posts: 9
Joined: 04 Oct 2017, 23:09

Help Needed for

04 Oct 2017, 23:29

Good day everyone!

I am new to using AHK and I’m a noob in coding. I just followed the documentations in making a code that I plan to use in a game but I am stuck in a function that is part of the code.

There is a text box in the game used to filter the contents. My code looks like this:

Code: Select all

filter(x) { ; filter using the filter text box
click_point(1075, 400) ; click_point(x, y) is a function I made to perform mouse movement to the coordinate and click with delays so the game can have time to respond.
click_point(963, 396)
sendinput x ; x should be a variable that will be entered in the filter
sleep, 500
sendinput {Enter}
sleep, 500
return
}
When I write in the script this:

Code: Select all

filter(abc-gx)
; the script performs the right clicking sequence but writes in the text box the letter x instead of abc-gx.

What did I do wrong and how should this be done?

I am using this function so it is simplified. Only needs 1 line for each time I use filter in the game.

Thank you in advance.
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Help Needed for

05 Oct 2017, 01:07

Update this line to this:

Code: Select all

sendinput % x ; x should be a variable that will be entered in the filter
(% will deref the variable so you can send its value)
HTH
pedroabs
Posts: 9
Joined: 04 Oct 2017, 23:09

Re: Help Needed for

05 Oct 2017, 01:31

Thank you very much for the help. I will update the script when I am home later. :)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 67 guests