help me make a script like this:

Ask gaming related questions (AHK v1.1 and older)
User avatar
legend maxfreak
Posts: 73
Joined: 03 Sep 2017, 04:35

help me make a script like this:

19 Sep 2017, 16:55

As this thread is about a game, thread moved to the 'Gaming' section. Thx for following the rules :)

Pls, Help me create a script for this, pics in the attachments below:
In the first pic after searching for the words with my anagram solver I then pasted in the game.
Then in the second, new words were added, I search again and wanted to paste, so help me create a script than won't allow the results in my first search to appear when pasting the second time cos words can't be repeated twice in the game.
Attachments
Screenshot_2017-09-18-19-24-28.png
Screenshot_2017-09-18-19-24-28.png (66.38 KiB) Viewed 2118 times
Screenshot_2017-09-18-19-24-40.png
Screenshot_2017-09-18-19-24-40.png (71.41 KiB) Viewed 2118 times
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: help me make a script like this:

22 Sep 2017, 18:13

There are too many unknowns to even get started with - do You have access to that phone thingy, where You are making the searches and so on.
So, answering the question directly: make an array and fill it with results You want to omit next time, then use it to exclude them. Solution depends on how it all works, but You'll likely want to loop through the new result checking for entries from the array.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
User avatar
legend maxfreak
Posts: 73
Joined: 03 Sep 2017, 04:35

Re: help me make a script like this:

23 Sep 2017, 02:20

SirRFI wrote:There are too many unknowns to even get started with - do You have access to that phone thingy, where You are making the searches and so on.
So, answering the question directly: make an array and fill it with results You want to omit next time, then use it to exclude them. Solution depends on how it all works, but You'll likely want to loop through the new result checking for entries from the array.
I'm still a novice ahk user, but whenever I search, everything is copied to my clipboard, so I think making an array to fill with results to be omitted and looping will be connected to the clipboard, so pls help me create the both(array and looping), I have the pc version of this scrabble game but dont know how to screenshot with pc so i used the android version to screenshot.
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: help me make a script like this:

23 Sep 2017, 20:50

I don't know how you would get the letters or run them through the anagram solver (connecting to a website?)

But I would do a StringReplace on your first list, assuming your list is separated by NewLine (`n) and/or Carriage Return (`r) or spaces. Replace that delimiter with a comma (,). You can then use the command If var in. What we'll do is do a Loop, Parse on the second list and check one at a time if each word is in the comma-delimited list. If it is, then just use Continue command. If it is not, then append it to a "shortened second list" variable. I'd recommend using the same delimiter as the original list -- what you use to submit an answer. Then just submit that shortened second list ot the game.

If there are more rounds with more letters added, transform your shortened second list into a comma-delimited list with StringReplace, and then use both comma-delimited lists in the If var in command to compare the third list against in yet another Loop, Parse.

(You don't need to loop parse the first list, as the point of the loop parsing is to rule out duplicates.)

Hope that helps.
Last edited by Exaskryz on 27 Sep 2017, 13:56, edited 1 time in total.
User avatar
legend maxfreak
Posts: 73
Joined: 03 Sep 2017, 04:35

Re: help me make a script like this:

24 Sep 2017, 03:25

I'm a novice in making a script sir, help me create the script please sir.
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: help me make a script like this:

24 Sep 2017, 20:02

I think I've given enough information for a start. Give it a go as best you can -- there are multiple approaches you could take, not just mine -- and then I (and probably other people) would be happy to guide you on what changes you need to make.

I can't write all your code as I don't even know how you access the letters to begin with. That part you'd figure out.

I also don't know how you're doing your anagram solving to find answers.

But the commands you can use for filtering out repeat answers like I said would be:

StringReplace (Edit: I had an incorrect URL initially, now fixed!)
If var in
Loop, Parse
Last edited by Exaskryz on 27 Sep 2017, 13:55, edited 1 time in total.
User avatar
legend maxfreak
Posts: 73
Joined: 03 Sep 2017, 04:35

Re: help me make a script like this:

25 Sep 2017, 14:22

My anagram solver searches for the words I input into it, brings out results then I copy all to clipboard cos the anagram has the option "copy all to clipboard" so help create a 2 in 1 script with clipboard texts modifications. one will be for stringreplace and the other will be for the loop, parse sir.
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: help me make a script like this:

27 Sep 2017, 13:54

Here are some of the pieces you need. But work out the logic and include other pieces I did not provide to fit it all together. For instance, knowing if you are on your second turn or third turn.

commaList_1:=StrReplace(clipboard, A_Space, `,) ; the ` is an escape character for a literal comma

Code: Select all

Loop, Parse, clipboard, %A_Space% ; the clipboard should be for round 2
If A_LoopField in %commaList_1%
   Continue
else
   shortList_2:=A_LoopField . A_Space
clipboard:=shortList_2
Send ^v
return
I am assuming space is your delimiter in this game. It might be newline (`n) or it might be something else. That part you need to figure out based on what your program outputs.

Again,these are just hints to putting together the script you need. The next steps have to be taken by you.
User avatar
Cuadrix
Posts: 236
Joined: 07 May 2017, 08:26

Re: help me make a script like this:

28 Sep 2017, 04:08

From what I understood, you basically want to remove all used words and not include them next time you paste?
User avatar
legend maxfreak
Posts: 73
Joined: 03 Sep 2017, 04:35

Re: help me make a script like this:

28 Sep 2017, 10:53

Cuadrix wrote:From what I understood, you basically want to remove all used words and not include them next time you paste?
Exactly, sir.
User avatar
legend maxfreak
Posts: 73
Joined: 03 Sep 2017, 04:35

Re: help me make a script like this:

28 Sep 2017, 13:21

Yeah, exactly.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 69 guests