AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bingo

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
MarkZ
Guest





PostPosted: Thu Jan 05, 2006 10:59 pm    Post subject: Bingo Reply with quote

Hi,

I'm trying to make a program that runs my bingo-game automatically. ( dont ask why Razz )
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 Wink
Back to top
Decarlo110



Joined: 15 Dec 2004
Posts: 303
Location: United States

PostPosted: Thu Jan 05, 2006 11:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
MarkZ
Guest





PostPosted: Thu Jan 05, 2006 11:27 pm    Post subject: Reply with quote

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.

Very Happy
Back to top
MarkZ
Guest





PostPosted: Fri Jan 06, 2006 12:55 pm    Post subject: Reply with quote

No one? Sad
Back to top
Decarlo110



Joined: 15 Dec 2004
Posts: 303
Location: United States

PostPosted: Fri Jan 06, 2006 3:59 pm    Post subject: Reply with quote

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
Code:
MsgBox Bingo!


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
View user's profile Send private message
Guest






PostPosted: Fri Jan 06, 2006 4:43 pm    Post subject: Reply with quote

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 Very Happy
Back to top
Guest






PostPosted: Fri Jan 06, 2006 4:57 pm    Post subject: Reply with quote

Decarlo110 wrote:
, since youre using the same coordinates for everything.

Yes, it searches for the numbers called in the chatarea, thats why the coordinates are the same.

Click here for a screenshot, so you have a idea how it looks like.
Back to top
Micha



Joined: 15 Nov 2005
Posts: 437
Location: Germany

PostPosted: Fri Jan 06, 2006 5:02 pm    Post subject: Reply with quote

Sorry but your link is broken
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Jan 06, 2006 5:07 pm    Post subject: Reply with quote

Yeah, im trying to upload, but can't connect to ftp Sad

Click here for the picture (on another ftp)
Back to top
MarkZ
Guest





PostPosted: Sat Jan 07, 2006 3:53 pm    Post subject: Reply with quote

Question
Back to top
scrambled



Joined: 06 Jan 2006
Posts: 12

PostPosted: Sat Jan 07, 2006 9:00 pm    Post subject: Reply with quote

New to ahk but...

do you need to click (focus) in the chat box before sending?

does the send need a comma i.e.

Code:
Send, Bingo!


Hope that helps
Back to top
View user's profile Send private message
MarkZ
Guest





PostPosted: Sun Jan 08, 2006 3:54 pm    Post subject: Reply with quote

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 Cool
Back to top
scrambled



Joined: 06 Jan 2006
Posts: 12

PostPosted: Tue Jan 10, 2006 2:19 am    Post subject: Reply with quote

Code:
if (x1 = "X" AND x2 = "X" AND x3 = "X" AND x4 = "X" AND x5 = "X")
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group