Two Plus Two Newer Archives

Two Plus Two Newer Archives (http://archives1.twoplustwo.com/index.php)
-   Software (http://archives1.twoplustwo.com/forumdisplay.php?f=47)
-   -   simple script for stars: help please (http://archives1.twoplustwo.com/showthread.php?t=553582)

runhot 11-24-2007 03:45 PM

simple script for stars: help please
 
i need to fix a pretty simple script for stars.
when i right click a sngs, its suposed to enter 2.5x the bb in the raise box. and it stopped working.

will ship $5 if you can fix it. just the right click, everythin gelse stil works

====================================


;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.


#NoEnv
#Persistent
#SingleInstance force
#Include %a_scriptDir%
#Include Functions.ahk

interval = 100 ; period between refreshes

Loop
{
AutoRegister()
NoMsgBox()
Sleep %interval%
}

F1::tile()
return
tile()
{SetTitleMatchMode, 1
WinWait, PokerStars Lobby
WinActivate, PokerStars Lobby
WinWaitActive, PokerStars Lobby
WinMenuSelectItem, PokerStars Lobby,,View,Tile
}

F2:: ;__Closes tournament lobbies
CloseTournamentLobby()
return



F3:: ;__Pushes all-in
NumpadMult::
MouseGetPos,,, curWin
ControlSetText, PokerStarsSliderEditorClass1, 999999, ahk_id%curWin%
return




~RButton::
F4::
WinGet,id,,A
WinGetTitle, title, ahk_id%id%

IfInString, title, No Limit Hold'em
{
Slash := Instr(title, "/") + 2
Space := Instr(title, " ", false, Slash)
BBLength := Space - Slash
StringMid, Bigblind, title, Slash, BBLength
Transform, RaiseAmount, Round, Bigblind * 2.5

MouseGetPos,,, curWin
ControlSetText, PokerStarsSliderEditorClass1, %RaiseAmount%, ahk_id%curWin%
}
return


Autoregister()
{SetTitleMatchMode 2
IfWinExist, Tournament Registration
{
WinActivate
Control, Check
ControlClick, OK
Sendraw keys {Space}
}
}
CloseTournamentLobby()
{
Loop {
SetTitleMatchMode 2
IfWinExist, Lobby,, PokerStars Lobby
WinClose
else
break
}
}

NoMsgBox()
{
IfWinExist, PokerStars, OK
WinClose
IfWinExist, PokerStars, Internal
Sleep 500
WinClose, PokerStars, Internal

IfWinExist, PokerStars, Check
{
ControlClick, Check
Sendraw keys {Space}
}

return
}

runhot 11-24-2007 08:38 PM

Re: simple script for stars: help please
 
can someone help w/ this please?

_dave_ 11-24-2007 09:04 PM

Re: simple script for stars: help please
 
[ QUOTE ]

can someone help w/ this please?


[/ QUOTE ]

If no-one else has, I'll post a fix here shortly just as soon as I work it out. Maybe about ~1hour, just started coding for the evening, and this is on my to-do list.

_dave_ 11-24-2007 09:24 PM

Re: simple script for stars: help please
 
This *might* work

;---------------------------------
~RButton::
F4::
;WinGet,id,,A
MouseGetPos,,, curWin
WinGetTitle, title, ahk_id%curWin%

IfInString, title, No Limit Hold'em
{
Slash := Instr(title, "/") + 2
Space := Instr(title, " ", false, Slash)-2
BBLength := Space - Slash
StringMid, Bigblind, title, Slash, BBLength
Transform, RaiseAmount, Round, Bigblind * 2.5

MouseGetPos,,, curWin
ControlSetText, PokerStarsSliderEditorClass1, %RaiseAmount%, ahk_id%curWin%
}
return
;---------------------------------

note the -2 on the line "Space := Instr(title, " ", false, Slash)-2" - it is all I added, and is a guess. This number may need editing up or down.

The last update removed the space before "- Logged in as XXXX", so I suspect your code is matching the space after the "-", leading to problems with calculations.

Just a guess, I've not yet fixed my own code [img]/images/graemlins/frown.gif[/img]

dave.

EDIT: Your original code *should* stll work once Antes are introduced (mine does) - you will probably need to check if(Instr(title, "Ante")) {use old method}

Paul B. 11-24-2007 10:27 PM

Re: simple script for stars: help please
 
Okay this is my old code, and I have no idea why I wrote it the way I did. Just get the BBLength by seeing how many spaces from the right the slash is (subtract from the total length), then use StringRight. Use msgbox %BBLength% to debug.

runhot 11-24-2007 10:45 PM

Re: simple script for stars: help please
 
paul i have no idea what ur saying. i dont speak this language .. not even a little bit. if you could tell me in idiot terms, how to fix it, i would appreiate it.

_dave_ 11-24-2007 10:47 PM

Re: simple script for stars: help please
 
I assume copy/paste of my example does not work?

runhot 11-24-2007 10:55 PM

Re: simple script for stars: help please
 
no dave its not working right.. instead of 1000 it puts in 10

_dave_ 11-24-2007 11:00 PM

Re: simple script for stars: help please
 
[ QUOTE ]

no dave its not working right.. instead of 1000 it puts in 10


[/ QUOTE ]

Is there Antes?

I will post my own code in 10 mins or so...

runhot 11-24-2007 11:03 PM

Re: simple script for stars: help please
 
also can i somehow change F1 from tile to a custom layout somehow? thanks dave.

whats ur ps, i gotta ship u teh monies

runhot 11-24-2007 11:29 PM

Re: simple script for stars: help please
 
[ QUOTE ]
Is there Antes?


[/ QUOTE ]

yes there were antes

_dave_ 11-24-2007 11:38 PM

Re: simple script for stars: help please
 
[ QUOTE ]
[ QUOTE ]
Is there Antes?


[/ QUOTE ]

yes there were antes

[/ QUOTE ]

That makes sense with my above edit then [img]/images/graemlins/smile.gif[/img]

please try:

;---------------------------------
~RButton::
F4::
;WinGet,id,,A
MouseGetPos,,, curWin
WinGetTitle, title, ahk_id%curWin%

IfInString, title, No Limit Hold'em
{
Slash := Instr(title, "/") + 2
if (Instr(title, "Ante"))
{
Space := Instr(title, " ", false, Slash)
}
else
{
Space := Instr(title, " ", false, Slash)-2
}
BBLength := Space - Slash
StringMid, Bigblind, title, Slash, BBLength
Transform, RaiseAmount, Round, Bigblind * 2.5

MouseGetPos,,, curWin
ControlSetText, PokerStarsSliderEditorClass1, %RaiseAmount%, ahk_id%curWin%
}
return
;---------------------------------

Hopefully that does the job [img]/images/graemlins/smile.gif[/img]

_dave_ 11-24-2007 11:41 PM

Re: simple script for stars: help please
 
[ QUOTE ]
also can i somehow change F1 from tile to a custom layout somehow?

[/ QUOTE ]

Yeas, just change the word "Tile" to whatever you want to pick from the view menu - say.. "Custom Layout: my 12 table setup" - it depends how you named your layouts:



F1::tile()
return
tile()
{SetTitleMatchMode, 1
WinWait, PokerStars Lobby
WinActivate, PokerStars Lobby
WinWaitActive, PokerStars Lobby
WinMenuSelectItem, PokerStars Lobby,,View,Custom Layout: my 12 table setup
}

runhot 11-24-2007 11:44 PM

Re: simple script for stars: help please
 
dave for the right click, its still seems to be off b y a factor of ten

_dave_ 11-25-2007 12:09 AM

Re: simple script for stars: help please
 
[ QUOTE ]
dave for the right click, its still seems to be off b y a factor of ten

[/ QUOTE ]

OK, I just actually sat in a SNG [img]/images/graemlins/smile.gif[/img]

should be -1 not -2 [img]/images/graemlins/smile.gif[/img]


;-------------------------------------------
~RButton::
F4::
;WinGet,id,,A
MouseGetPos,,, curWin
WinGetTitle, title, ahk_id%curWin%

IfInString, title, No Limit Hold'em
{
Slash := Instr(title, "/") + 2
if (Instr(title, "Ante"))
{
Space := Instr(title, " ", false, Slash)
}
else
{
Space := Instr(title, " ", false, Slash)-1
}
BBLength := Space - Slash
StringMid, Bigblind, title, Slash, BBLength
Transform, RaiseAmount, Round, Bigblind * 2.5

MouseGetPos,,, curWin
ControlSetText, PokerStarsSliderEditorClass1, %RaiseAmount%, ahk_id%curWin%
}
return
;-------------------------------------------


All times are GMT -4. The time now is 12:41 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.