Jump to content

What am I doing Wrong?


Recommended Posts

I am trying to make a game, but I have run into a small problem, I want the "Money" To change to the value of the Starting Amount Input Box, here is my code:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Fileversion=1
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Betters UP!", 615, 438, 192, 124)
GUISetIcon("C:\Users\Family Computer\Pictures\ico\Trophy-bronze.ico", -1)
GUISetBkColor(0xC0C0C0)
$Welcom = GUICtrlCreateLabel("Welcome to Betters UP!", 160, 40, 288, 36)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x800000)
$Trophy1 = GUICtrlCreateIcon("C:\Users\Family Computer\Pictures\ico\Trophy-bronze.ico", -1, 64, 40, 49, 41)
$HowtoPlay = GUICtrlCreateButton("How to Play (Ctrl - H)", 480, 40, 121, 17)
GUICtrlSetColor(-1, 0x800000)
GUICtrlSetTip(-1, "Click Here to Get Help!")
$StartOff = GUICtrlCreateButton("First of all, Click Here to Choose how much money you want to start of with.", 40, 112, 545, 25)
GUICtrlSetColor(-1, 0x800000)
$Money = GUICtrlCreateLabel("Money", 40, 160, 36, 17)
GUICtrlSetColor(-1, 0x800000)
$Money1 = GUICtrlCreateLabel("$$$$$$$$", 88, 160, 52, 17)
GUICtrlSetColor(-1, 0x800000)
$BET = GUICtrlCreateInput("", 176, 216, 281, 21)
GUICtrlSetColor(-1, 0x800000)
$HowMuch = GUICtrlCreateLabel("How much do you want to bet?", 24, 216, 152, 17)
GUICtrlSetColor(-1, 0x800000)
$NumberInput = GUICtrlCreateLabel("What number do you think it will be?(1-10)", 16, 272, 202, 17)
GUICtrlSetColor(-1, 0x800000)
$Number = GUICtrlCreateInput("", 216, 272, 209, 21)
GUICtrlSetColor(-1, 0x800000)
$Go = GUICtrlCreateButton("GO!", 400, 296, 65, 65)
GUICtrlSetColor(-1, 0x800000)
Dim $Form1_AccelTable[1][2] = [["^h", $HowtoPlay]]
GUISetAccelerators($Form1_AccelTable)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  Case $HowtoPlay
   MsgBox(0,"How to Play","This game is a Betting game, thus it involves money. First of all, Choose your starting Money, then choose how much you want to bet, and last of all, write the number you think will appear (1-10), if you are wrong, you lose the original bet, if you win, your Bet Amount is doubled and added to your Overall Money Total")
  Case $StartOff
   $MM = InputBox("Starting Off Money","Please Enter only Numbers:" ,10)
  Case $Money1
  Case $Go
EndSwitch
WEnd
Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list]
Link to comment
Share on other sites

Case $StartOff
   $MM = InputBox("Starting Off Money","Please Enter only Numbers:" ,10)
  GuiCtrlSetData($Money1, $MM)

Is this what you want??

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...