AutoHotkey Community

It is currently May 27th, 2012, 6:25 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Bingo
PostPosted: January 5th, 2006, 10:59 pm 
Hi,

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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2006, 11:16 pm 
Offline

Joined: December 15th, 2004, 10:24 pm
Posts: 303
Location: United States
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>>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2006, 11:27 pm 
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.

:D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2006, 12:55 pm 
No one? :(


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2006, 3:59 pm 
Offline

Joined: December 15th, 2004, 10:24 pm
Posts: 303
Location: United States
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>>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2006, 4:43 pm 
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 :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2006, 4:57 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2006, 5:02 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
Sorry but your link is broken


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2006, 5:07 pm 
Yeah, im trying to upload, but can't connect to ftp :(

Click here for the picture (on another ftp)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2006, 3:53 pm 
:?:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2006, 9:00 pm 
Offline

Joined: January 6th, 2006, 6:22 pm
Posts: 12
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2006, 3:54 pm 
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 8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2006, 2:19 am 
Offline

Joined: January 6th, 2006, 6:22 pm
Posts: 12
Code:
if (x1 = "X" AND x2 = "X" AND x3 = "X" AND x4 = "X" AND x5 = "X")


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: hd0202 and 60 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group