Sign in to follow this  
Followers 0
Cloudsx

make it work

8 posts in this topic

how can i make this work

func GUI2Create()
If WinExists("gebouwen") then Return
$2 = GUICreate("gebouwen",350,400)
GUICtrlCreateButton("Cash Fabriek",25,75,75,25)
GUICtrlCreateLabel("benodigheden:",25,25,75,25)
GUICtrlCreateLabel("Cash:1000 Iron:100",25,50,75,25)
GUISetState (@SW_SHOW)
EndFunc

but i want if the button is press then that the cash and iron go off and it must going to be build so how can i show that

Share this post


Link to post
Share on other sites



can i be able to do that

Share this post


Link to post
Share on other sites

I can't speak for anyone else but I personally don't understand exactly what it is your trying to do

I know that english may be a barrier but if you could try to tell us a bit better then someone could probably help you.. I hope this doesn't come accross as offensive :o

Share this post


Link to post
Share on other sites

no your right my english is not very well so i will try to explane better

look

i make a game like a mafia game

and i have cash and iron

so if i made some thing like some buildings like a cash factory and iron factory

but if i want to buy that it will cost cash and iron

the cash factory cost 1000 cash and 125 iron if i pressed the button of the cash factory then it must going to built and the cash and the iron must going of the cash and iron what you have in your pocket

you have 2500 cash and 500 iron

so it must be then

1500 cash and 375 iron so that i want

and i want that it be possible that i have buyed the building

is this a beter explantion

Share this post


Link to post
Share on other sites

I can't speak for anyone else but I personally don't understand exactly what it is your trying to do

I know that english may be a barrier but if you could try to tell us a bit better then someone could probably help you.. I hope this doesn't come accross as offensive :o

If you read his previous Topic you will get a better understanding of what he wants.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Sorry I'm still confused.

Is this anything like what you want?

#include <GuiConstants.au3>
;you could read in these values from your ini file rather than coding them like I have
Global $Cash = 2500, $Iron = 500
Gui2create()


func GUI2Create()
If WinExists("gebouwen") then Return 0
$2 = GUICreate("gebouwen",350,400)
$Button = GUICtrlCreateButton("Cash Fabriek",25,75,75,25)
GUICtrlCreateLabel("benodigheden:",25,25,75,25)
GUICtrlCreateLabel("Cash:1000 Iron:100",25,50,75,25)
GUISetState (@SW_SHOW)


While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $Msg = $Button
        If $Cash - 1000 < 0 then 
            MsgBox (0,"Sorry", "You do not have enough Cash, you only have " & $Cash & " left")
            Else
        $Cash = $Cash - 1000
; you can write the Cash values back to your ini file here
    EndIf
        If $Iron - 100 < 0 then 
            MsgBox (0,"Sorry", "You do not have enough Iron, you only have " & $Iron & " left")
            Else
        $Iron = $iron - 100
; you can write the Iron values back to your ini file here
        Endif
        MsgBox (0,"You have", "Cash = " & $Cash & @crlf & "Iron = " & $Iron)
    Case Else
;;;
    EndSelect
WEnd
Exit
EndFunc
Edited by ChrisL

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

the script isgood but i want it go off this script

#include <GUIConstants.au3>

IniWrite("rechours.ini", "Resources", "Cash", 2500)
IniWrite("rechours.ini", "Resources", "Iron", 500)
IniWrite("rechours.ini", "Resources", "ederuim", 0)
IniWrite("rechours.ini", "Resources", "electricity", 0)


GUICreate("game",350,400); will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW); will display an empty dialog 

$Cash = iniread("rechours.ini", "Resources", "Cash",0)


$iron = iniread("rechours.ini", "Resources", "iron",0)


$ederuim = iniread("rechours.ini", "Resources", "ederuim",0)


$electricity = iniread("rechours.ini", "Resources", "electricity",0)


GUICtrlCreatePic("Cash.jpg",25,10,20,20)
$Label = GuiCtrlCreateLabel($Cash,50,15)
GUICtrlCreatePic("iron.jpg",115,10,20,20)
$label = GUICtrlCreateLabel($iron,140,15)
GUICtrlCreatePic("ederuim.jpg",200,10,20,20)
$label = GUICtrlCreateLabel($ederuim,225,15)
GUICtrlCreatePic("electricity.jpg",275,10,20,20) 
$label = GUICtrlCreateLabel($electricity, 300,15)

look to this script place it in a own script and look what i meen

the main guicreate there has the cash and iron must going off

Edited by Cloudsx

Share this post


Link to post
Share on other sites

can some one help me with that

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  
Followers 0