| View previous topic :: View next topic |
| Author |
Message |
lnmax
Joined: 26 Feb 2010 Posts: 4
|
Posted: Fri Feb 26, 2010 8:06 pm Post subject: AHK pokerstars Help! |
|
|
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! |
|
| Back to top |
|
 |
Fatal_Error
Joined: 24 Jul 2009 Posts: 13
|
Posted: Fri Feb 26, 2010 11:18 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
jl34567
Joined: 03 Jan 2010 Posts: 262
|
Posted: Fri Feb 26, 2010 11:31 pm Post subject: |
|
|
| Check the 2+2 forum.....if they can't help......send me a message. |
|
| Back to top |
|
 |
lnmax
Joined: 26 Feb 2010 Posts: 4
|
Posted: Sat Feb 27, 2010 5:00 am Post subject: |
|
|
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 ... |
|
| Back to top |
|
 |
jl34567
Joined: 03 Jan 2010 Posts: 262
|
Posted: Mon Mar 01, 2010 2:48 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
lnmax
Joined: 26 Feb 2010 Posts: 4
|
Posted: Mon Mar 01, 2010 2:54 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
jl34567
Joined: 03 Jan 2010 Posts: 262
|
Posted: Mon Mar 01, 2010 2:56 am Post subject: |
|
|
| Let me open PokerStars really quick. |
|
| Back to top |
|
 |
jl34567
Joined: 03 Jan 2010 Posts: 262
|
Posted: Mon Mar 01, 2010 3:05 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
lnmax
Joined: 26 Feb 2010 Posts: 4
|
Posted: Mon Mar 01, 2010 3:19 am Post subject: |
|
|
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.
 |
|
| Back to top |
|
 |
jl34567
Joined: 03 Jan 2010 Posts: 262
|
|
| Back to top |
|
 |
doyle
Joined: 14 Nov 2007 Posts: 325 Location: London, England
|
Posted: Wed Mar 03, 2010 9:51 am Post subject: |
|
|
| Table Ninja? |
|
| Back to top |
|
 |
jl34567
Joined: 03 Jan 2010 Posts: 262
|
Posted: Wed Mar 03, 2010 9:59 am Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
doyle
Joined: 14 Nov 2007 Posts: 325 Location: London, England
|
Posted: Wed Mar 03, 2010 10:06 am Post subject: |
|
|
For what purpose do you need to do this?
I have scripted for PS, and am familiar with its behaviour. |
|
| Back to top |
|
 |
|