Jump to content

some problem with ini read


Cloudsx
 Share

Recommended Posts

so you meen this

#include <GUIConstants.au3>

$cash = iniread("rechours", "Ressources", "Cash", 0)
msgbox(0, "", "Your Cash is: " & $cash)

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

GUICtrlCreatePic("Cash.jpg",25,10,20,20)
$Label = GuiCtrlCreateLabel($cash,50,15)
GUICtrlCreatePic("iron.jpg",115,10,20,20)
GUICtrlCreatePic("ederuim.jpg",200,10,20,20)
GUICtrlCreatePic("electricity.jpg",275,10,20,20)
Link to comment
Share on other sites

now i have this code

#include <GUIConstants.au3>

IniWrite("rechours.ini", "Resources", "Cash", 2500)
IniWrite("rechours.ini", "recources", "Iron", 500)
IniWrite("rechours.ini", "recources", "ederuim", 0)
IniWrite("rechours.ini", "recources", "electricity", 0)
$Cash = iniread("rechours", "rechours", "Cash",0)
msgbox(0, "", "Your Cash is: " & $Cash)

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

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

but i have use the label and it must show what i made in the ini cash 2500 but it show 0

Link to comment
Share on other sites

i have $cash = iniread("rechours.ini"

but still he say it is 0 but i did somehting els and that will hopefully work

but now how can i change th cash if a sniper is buyed from 200 cash and 5 iron how can i let it say 2300 cash and 495 iron

Edited by Cloudsx
Link to comment
Share on other sites

i have $cash = iniread("rechours.ini"

but still he say it is 0

Change

$Cash = iniread("rechours", "rechours", "Cash",0)

to

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

You may also want to check your iniwrite lines for typos.

Edited by BigDod


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

Link to comment
Share on other sites

thanks it work now it says 2500 cash and 500 iron

but now how can i change th cash if a sniper is buyed from 200 cash and 5 iron how can i let it say 2300 cash and 495 iron

I am not sure where to put it but here is a clue

IniWrite("rechours.ini", "Resources", "Cash", $cash-500)


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

Link to comment
Share on other sites

now i have this

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

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...