Jump to content
Sign in to follow this  

Transfering Varables into Program from GUI

Recommended Posts

The programing part has been fun........something about starting out with rough draft that works and then rewriting it with less lines and making it bullet proof.

But then comes the Menu or Gui for other users to change defaults in this case.

Allowing Radio Buttons or Check Box to set Variables to run in your script after the Gui is closed.

Something in the ball park of setting the variable in a declared state to use on down line in the program when its called on.

I could be looking at this all wrong....so get ready for a good laugh..........but I do need some help !

ps. Just a few notes about my programing habbits.....I like and really have to put MsgBox in most of my scripts to make sure that the variables are coming out the way I want them to I have left these in so you can

see what variables I want to take down to my program.

#region --- GuiBuilder code Start ---

; Script generated by AutoBuilder 0.6 Prototype

Global $la ;Rem Loss Ammount to be used in the money management part of the script to follow Gui

Global $wa ;Rem Win Ammount to be used in the money management part of the script to follow GUI

Global $wbb ;Rem Wait for Big Blind

#include <GuiConstants.au3>

$wa6 = .40

$la6 = .40

$wa2 = .50

$la2 = .40

$wa3 = .60

$la3 = .40

$wa4 = .75

$la4 = .40

$wa5 = 2

$la5 = .40

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

$mainwindow = GuiCreate("Event Manager", 412, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Button_12 = GuiCtrlCreateButton("Start", 320, 280, 60, 30)

GUICtrlSetOnEvent($Button_12, "Startbutton")

$Radio_1 = GuiCtrlCreateRadio("40% Win - 40% Loss Leave Table", 180, 100, 200, 20)

GUICtrlSetOnEvent($Radio_1, "FortyForty")

GUICtrlSetState ($Radio_1,$GUI_CHECKED)

$Radio_2 = GuiCtrlCreateRadio("50%Win - 40% Loss Leave Table", 180, 130, 200, 20)

GUICtrlSetOnEvent($Radio_2, "FiftyForty")

$Radio_3 = GuiCtrlCreateRadio("60%Win - 40% Loss Leave Table", 180, 160, 200, 20)

GUICtrlSetOnEvent($Radio_3, "SixtyForty")

$Radio_4 = GuiCtrlCreateRadio("75%Win - 40% Loss Leave Table", 180, 190, 200, 20)

GUICtrlSetOnEvent($Radio_4, "SeventyFiveForty")

$Radio_5 = GuiCtrlCreateRadio("100% Win - 40% Loss Leave Table", 180, 220, 200, 20)

GUICtrlSetOnEvent($Radio_5, "OneHundredForty")

$Group_6 = GuiCtrlCreateGroup("Money Manager", 170, 80, 220, 180)

;Rem here goes where we would set the two varables for the money manager at that amount

$Radio_7 = GuiCtrlCreateRadio("7 Players Sit Out", 20, 100, 100, 20)

GUICtrlSetOnEvent($Radio_7, "MissingThree")

GUICtrlSetState ($Radio_7,$GUI_CHECKED)

$Radio_8 = GuiCtrlCreateRadio("6 Players Sit Out", 20, 130, 110, 20)

GUICtrlSetOnEvent($Radio_8, "MissingFour")

$Radio_9 = GuiCtrlCreateRadio("5 Players Sit Out", 20, 160, 120, 20)

GUICtrlSetOnEvent($Radio_9, "MissingFive")

$Group_10 = GuiCtrlCreateGroup("Short Table", 10, 80, 150, 110)

$Radio_11 = GuiCtrlCreateRadio("Wait for Big Blind", 20, 280, 120, 20)

GUICtrlSetOnEvent($Radio_11, "BigBlind")




While 1

Sleep(1000) ; Idle around


#endregion --- GuiBuilder generated code End ---

Func Startbutton()

Exit;Please look at this is this the correct way to leave a script or to start another script


Func CLOSEClicked()

If @GUI_WINHANDLE = $mainwindow Then

MsgBox(0, "Event", "You are closing the window Script will not be in effect!")





Func BigBlind()

$wbb = 1

MsgBox(0, "Big Blind Position Active", $wbb);Rem would like to take this on to the program



;Rem now these are the Money Manager Variables I would like to set Only one will be set to $la and $wa

Func FortyForty()

$la = $la6

$wa = $wa6

MsgBox(0,"Win Amount", $wa)

MsgBox(0,"Default", $la)


Func FiftyForty()

$la = $la2

$wa = $wa2

MsgBox(0,"Win Amount", $wa)

MsgBox(0,"Default", $la)


Func SixtyForty()

$la = $la3

$wa = $wa3

MsgBox(0,"Win Amount", $wa)

MsgBox(0,"Default", $la)


Func SeventyFiveForty()

$la = $la4

$wa = $wa4

MsgBox(0,"Win Amount", $wa)

MsgBox(0,"Default", $la)


Func OneHundredForty()

$la = $la5

$wa = $wa5

MsgBox(0,"Win Amount", $wa)

MsgBox(0,"Default", $la)


;Rem number of players count I would like to carry over the values of $m3, or $m4 or $m5

Func MissingThree()

$m3 = 3

MsgBox(0,"7 Players Sit Out", $m3)


Func MissingFour()

$m4 = 4

MsgBox(0,"6 Players Sit Out", $m4)


Func MissingFive()

$m5 = 5

MsgBox(0,"5 Players Sit Out", $m5)


Now at this point I would like to continue with the above variables into a script that would be right below this line........plus also close the above Gui until the next time the program is ran.

Thanks zz

Share this post

Link to post
Share on other sites


where is the question? You could write the values into a file, registry or just call the second script with command line parameters.

Hope that helps.

So long,


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...