AutoHotkey Community

It is currently May 27th, 2012, 4:34 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: AHK pokerstars Help!
PostPosted: February 26th, 2010, 9:06 pm 
Offline

Joined: February 26th, 2010, 9:05 pm
Posts: 4
Good afternoon!
Somebody can help me.
In PokerStars At registration in tournament the window "Tournament Registration" opens.
Help as means AUTOHOTKEY to intercept the text an example: "Buy-in: $2 + $0.20 Entry free"? Through WinSpy an ego not probably to read.
It is necessary for my program.
I will throw off a few money to that who will help!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 12:18 am 
Offline

Joined: July 24th, 2009, 5:48 pm
Posts: 13
If the text of your game is in a photo format, it can be "intercepted" by taking a screenshot of said text, cropping text to an imagefile.bmp, and then using ImageSearch to locate said text. Downside to this method is you would have to take a screenshot for every possibly combination of text displayed in this fashion and write a bit of code for it.

For example, you can take a creenshot of "Buy-in: $2 + 40.20 Entry free" crop it, and place the image file with your script file in the same folder. ahk code as follows:

Code:
Loop
{
   ImageSearch,,, x1, y1, x2, y2, *10, %A_ScriptDir%\ImageFile.BMP ;replace x1, y1, x2, y2 with the screen coordinates to search for your image.
   IF(ErrorLevel=0)
   {
      ;Insert your autohotkey actions in here.
   }
}


Probably a very bad way of doing this but it works.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 12:31 am 
Offline

Joined: January 3rd, 2010, 6:33 am
Posts: 262
Check the 2+2 forum.....if they can't help......send me a message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 6:00 am 
Offline

Joined: February 26th, 2010, 9:05 pm
Posts: 4
Thank you very much!

I wrote the following code:
Code:
CoordMode Pixel, Relative
Loop {
WinWait, Tournament Registration
WinActivate
WinSet, Transparent, off
ImageSearch, FoundX, FoundY, 0, 0, 380, 330, buyin.bmp
if ErrorLevel = 2
    {
    MsgBox Could not conduct the search.
    }
else if ErrorLevel = 1
    {
    WinClose
    ;MsgBox Bankroll!!!.
    }
else
    {
    ;MsgBox The icon was found at %FoundX%x%FoundY%.
    }

}

But the problem!
If the window is already open, and we run the script it all works!
And if you first run the script, and then opens a window where we look for the picture that does not work!
Please advice ...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2010, 3:48 am 
Offline

Joined: January 3rd, 2010, 6:33 am
Posts: 262
MAybe the window needs a little bit of time to load.....try the addition I made below.......try adjusting the sleep time if it doesnt work. I had a similar issue with a mousemove where a pixel changed color when the mouse was over it.....If I didn't do a sleep after i moved the cursor to the pixel, it wouldnt catch the color change. I only needed a sleep 20.....so play with it , find out what works.

CoordMode Pixel, Relative
Loop {
WinWait, Tournament Registration
WinActivate
WinWaitActive<<<<<<<<<<<<<<<<<<<<<<<<<<[b]try this
Sleep, 100[/b]<<<<<<<<<<<<<<<<<<<<<<<<<<<
WinSet, Transparent, off
ImageSearch, FoundX, FoundY, 0, 0, 380, 330, buyin.bmp
if ErrorLevel = 2
{
MsgBox Could not conduct the search.
}
else if ErrorLevel = 1
{
WinClose
;MsgBox Bankroll!!!.
}
else
{
;MsgBox The icon was found at %FoundX%x%FoundY%.
}

}

There are a ton of good scripts for stars. What you're trying to do probably already exists.

I'm writing one for the Merge Network riight now.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2010, 3:54 am 
Offline

Joined: February 26th, 2010, 9:05 pm
Posts: 4
I have already consulted, the problem was in it.

Yes probably similar script already exists, but to find to me it was not possible (

Can you found?

All the same to use imagesearch it is not so good, it is necessary as to receive the text.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2010, 3:56 am 
Offline

Joined: January 3rd, 2010, 6:33 am
Posts: 262
Let me open PokerStars really quick.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2010, 4:05 am 
Offline

Joined: January 3rd, 2010, 6:33 am
Posts: 262
I know HEM and PT can query the PokerStars server....and pull info out.

If you can findd out how to query the server, the rest should be easy.

I'm not sure exactly what you're trying to do, so I can't help with the looking for a script that does this.

If you let me know, I'll hunt around a bit.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2010, 4:19 am 
Offline

Joined: February 26th, 2010, 9:05 pm
Posts: 4
It is necessary not to allow to be registered in tournament not соответствуюшего a limit.

The screenshot has put, it is necessary to consider a limit from a window.
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 10:02 am 
Offline

Joined: January 3rd, 2010, 6:33 am
Posts: 262
Any progress on this?? I'm working on my own issues right now.

My project got noticed.

http://www.pokersoftware.com/articles/2 ... twork.html


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 10:51 am 
Offline

Joined: November 14th, 2007, 2:47 pm
Posts: 335
Location: London, England
Table Ninja?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 10:59 am 
Offline

Joined: January 3rd, 2010, 6:33 am
Posts: 262
Haha......It's a preliminary layout......but I mean a GUI with a bunch of hotkeys can only look so many ways.....and add to that that it's for poker and how many ways are there really to lay it out?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 11:06 am 
Offline

Joined: November 14th, 2007, 2:47 pm
Posts: 335
Location: London, England
For what purpose do you need to do this?

I have scripted for PS, and am familiar with its behaviour.


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: Bing [Bot], Mickers, rbrtryn and 70 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