 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
MarkZ Guest
|
Posted: Thu Jan 05, 2006 10:59 pm Post subject: Bingo |
|
|
Hi,
I'm trying to make a program that runs my bingo-game automatically. ( dont ask why )
I want that when 5 variables are the same, it says: bingo
Something like this?
if(var1=X AND var2=X AND var3=X AND var4=X AND var5=X)
Send Bingo!{enter}
I hope someone can help me  |
|
| Back to top |
|
 |
Decarlo110
Joined: 15 Dec 2004 Posts: 303 Location: United States
|
Posted: Thu Jan 05, 2006 11:16 pm Post subject: |
|
|
Reliable assistance cannot be done unless there is direct access to the interface. Even then, achieving game automation often involves more than what it at first seems. The best you could do is mention where to obtain the freeware/trialware, and hope someone downloads it and becomes familiar with gameplay and resolves the relevant controls, etc. _________________ 1) The Open Source Definition http://www.opensource.org/docs/definition_plain.php
2) Intuitive. Logical. Versatile. Adaptable. <<AutoHotkey>> |
|
| Back to top |
|
 |
MarkZ Guest
|
Posted: Thu Jan 05, 2006 11:27 pm Post subject: |
|
|
| Code: | InputBox, x1, Titel, Tekst, ,375, 189, 0, 0,
InputBox, x2, Titel, Tekst, ,375, 189, 0, 0,
; ...etc.
InputBox, x25, Titel, Tekst, ,375, 189, 0, 0,
Loop,
{
ImageSearch, FoundXX, FoundYY, 12, 540, 1007, 667, C:\Documents and Settings\Mark\Mijn documenten\--bingobord\B%x1%.BMP
if ErrorLevel = 0
{
MouseClick, left, 384, 221,
x1=X
}
; ... etc.
ImageSearch, FoundXX, FoundYY, 12, 540, 1007, 667, C:\Documents and Settings\Mark\Mijn documenten\--bingobord\B%x25%.BMP
if ErrorLevel = 0
{
MouseClick, left, 587, 422,
x25=X
}
} |
I fill in the numbers from the bingocard.
So for example x1 is number 02.
When its called, it clicks it and makes from x1=02, x1=X
So I want when x1 x2 x3 x4 and x5 are called, that it says bingo.
 |
|
| Back to top |
|
 |
MarkZ Guest
|
Posted: Fri Jan 06, 2006 12:55 pm Post subject: |
|
|
No one?  |
|
| Back to top |
|
 |
Decarlo110
Joined: 15 Dec 2004 Posts: 303 Location: United States
|
Posted: Fri Jan 06, 2006 3:59 pm Post subject: |
|
|
| Quote: | I want that when 5 variables are the same, it says: bingo
Something like this?
if(var1=X AND var2=X AND var3=X AND var4=X AND var5=X)
Send Bingo!{enter} |
Change the second line to
I'm not sure if that's what youre looking for. From a brief reading of your code, i noticed it uses ImageSearch, so im unable to actually run it, since i dont have the image to the corresponding directory.
After studying it a little more carefully, you are trying to automate clicking, and then getting the content of the control you are clicking at. And then somehow you want to know if you have a Bingo (5 in a row). i didnt see anything in your code for checking of 5 consecutive positions (maybe thats what the InputBox's are for, but that's not really automation of the gameplay). This is not as simple as you might think.
Your first step is to determine if you can retrieve what youre clicking as text (probably not since you used ImageSearch). But it would have simplified things. After that's ruled out, then you have to correct your parameters for ImageSearch, since youre using the same coordinates for everything. After you figure out all the correct coordinates, then you have to figure out how to know if there are 5 in a row on the 5x5 grid. That by itself, is a puzzle, too.
I would suggest first writing simpler scripts which make use of ImageSearch, until youre familiar with it. Then after that, write or find a code for a 3x3 matrix without any graphics involved, to learn the concept of coding detection of "in-a-row". Then you can extend the idea to a 5x5 matrix. _________________ 1) The Open Source Definition http://www.opensource.org/docs/definition_plain.php
2) Intuitive. Logical. Versatile. Adaptable. <<AutoHotkey>> |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Jan 06, 2006 4:43 pm Post subject: |
|
|
Yes, I'm filling in the 25 numbers, in the inputboxes. So it's not entirely automated.
InputBox, x1, Titel, Tekst, ,375, 189, 0, 0,
If the first number is for example 12, x1 will be x1=12
when number 12 is called, x1=12 will be changed in x1=X
and so on.
So if x1 and x2 and x3 and x4 and x5 are a X, it has to recognize i have a bingo.
Thnks for answering  |
|
| Back to top |
|
 |
Guest
|
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 437 Location: Germany
|
Posted: Fri Jan 06, 2006 5:02 pm Post subject: |
|
|
| Sorry but your link is broken |
|
| Back to top |
|
 |
Guest
|
|
| Back to top |
|
 |
MarkZ Guest
|
Posted: Sat Jan 07, 2006 3:53 pm Post subject: |
|
|
 |
|
| Back to top |
|
 |
scrambled
Joined: 06 Jan 2006 Posts: 12
|
Posted: Sat Jan 07, 2006 9:00 pm Post subject: |
|
|
New to ahk but...
do you need to click (focus) in the chat box before sending?
does the send need a comma i.e.
Hope that helps |
|
| Back to top |
|
 |
MarkZ Guest
|
Posted: Sun Jan 08, 2006 3:54 pm Post subject: |
|
|
| MarkZ wrote: | InputBox, x1, Titel, Tekst, ,375, 189, 0, 0,
If the first number is for example 12, x1 will be x1=12
when number 12 is called, x1=12 will be changed in x1=X
and so on.
So if x1 and x2 and x3 and x4 and x5 are a X, it has to recognize i have a bingo.
|
This is my problem  |
|
| Back to top |
|
 |
scrambled
Joined: 06 Jan 2006 Posts: 12
|
Posted: Tue Jan 10, 2006 2:19 am Post subject: |
|
|
| Code: | | if (x1 = "X" AND x2 = "X" AND x3 = "X" AND x4 = "X" AND x5 = "X") |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|