Jump to content
Sign in to follow this  
HanSieT

Some help wanted

Recommended Posts

HanSieT

Hi all,

This is our first post but we need some help finishing our script.

We are trying to make an autologinscript for our program but cant figure out howto put an extra option to the script.

First i tell something about the script we are trying to make.

We are making an autologin and search player script for Pokerstars ( might sound funny but u got to start somewhere )

We made it so far that we can use

$Name = InputBox("Question", "Who do u want to find on Pokerstars?")
to enter a name and find the player if he/she is online.

What we actually want to do is make a dropdownbox containing names of friends that play so we can click their name and make PS( AutoIt ) find them.

Is there a way to make this work.

We checked out the gui example but we cant seem to figure out howto use that example for our script.

Is there anyone who can point us in the right direction.

Thanks in advance

//Hans & Roger

Edited by HanSieT

Share this post


Link to post
Share on other sites
Nahuel

That will depend on how you are retreiving the user list. Here's an example using a list in a file.

#include <File.au3>
#include <Array.au3>
#include <GUIConstants.au3>

;read file and load it to array
Dim $aUsers
_FileReadToArray("users.txt",$aUsers)

;Create window
$Form1 = GUICreate("Users", 300, 139)
$Combo1 = GUICtrlCreateCombo(" -Select User- ", 40, 23, 229, 125)
$Check = GUICtrlCreateButton("Check Status", 96, 76, 113, 35, $BS_DEFPUSHBUTTON)

;Load users into combobox
For $i=1 To $aUsers[0]
    GUICtrlSetData($Combo1,$aUsers[$i] & "|")
Next

;Show GUI
GUISetState(@SW_SHOW)

;Main Loop
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Check
            MsgBox(0,"",GUICtrlRead($Combo1))
    EndSwitch
WEnd

Users.txt:

jhon
anna
jack
mario
tim
fred
julie
jamie
Edited by Nahuel

Share this post


Link to post
Share on other sites
HanSieT

That will depend on how you are retreiving the user list. Here's an example using a list in a file.

#include <File.au3>
#include <Array.au3>
#include <GUIConstants.au3>

;read file and load it to array
Dim $aUsers
_FileReadToArray("users.txt",$aUsers)

;Create window
$Form1 = GUICreate("Users", 300, 139)
$Combo1 = GUICtrlCreateCombo(" -Select User- ", 40, 23, 229, 125)
$Check = GUICtrlCreateButton("Check Status", 96, 76, 113, 35, $BS_DEFPUSHBUTTON)

;Load users into combobox
For $i=1 To $aUsers[0]
    GUICtrlSetData($Combo1,$aUsers[$i] & "|")
Next

;Show GUI
GUISetState(@SW_SHOW)

;Main Loop
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Check
            MsgBox(0,"",GUICtrlRead($Combo1))
    EndSwitch
WEnd

Users.txt:

jhon
anna
jack
mario
tim
fred
julie
jamie
Hi Nahuel ,

Thanks for the post but we cant seem to figure out how to make the outcome ( us choosing the player) fit in our script so when we clicked the search button the players name will appear into the box.

Maybe its an idea to post our script here so u can see what we mean.

The script as it is now is used with Inputbox and instead of that we want to use the dropdownbox with GUI.

; Who am i looking for
$Name = InputBox("Question", "Who do u want to find on Pokerstars?")
; Try to start PS
Run ("H:\Program Files\PokerStars\PokerStarsUpdate.exe") 
; Wait for networkconnection
sleep(6000)
; click login
MouseClick ( "left" , 954, 694 , 1 )
sleep(1000)
; click oke on login
MouseClick ( "left" , 643, 563 , 1 )
sleep(1000)
; Search player part 1
MouseClick ( "left" , 581, 209 , 1 )
sleep(1000)
; Search player part  2
MouseClick ( "left" , 608, 386,  1 )
sleep(1000)
MouseClick ( "left" , 664 , 442, 1 )
Sleep(1000)
Send ($Name)
MouseClick ( "left" , 633 , 542 ,1)

Instead of using the Send ($name) we want to use the dropdownbox before login in so we can choose the player we want to play with.

We are kinda new to the whole autoit scripting and made the script as it is now ( and we are pretty proud we made it this far lol )

The GUI scripting is just above our average i guess.

Some help would be welcome

Thanks

//Hans & Roger

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×