Cloudsx Posted February 22, 2006 Share Posted February 22, 2006 i want this ini screen shot where you see the cash and iron and ederuim and electricity next to the pictures but if i buy something i want to see that i buy something and it have to go off the cash or iron or ederuim look to the code and to the screen shot expandcollapse popup#include <GUIConstants.au3> 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) GUICtrlCreatePic("iron.jpg",115,10,20,20) GUICtrlCreatePic("ederuim.jpg",200,10,20,20) GUICtrlCreatePic("electricity.jpg",275,10,20,20) Opt("GUICoordMode",4) $gebouwen = GUICtrlCreateButton("gebouwen",290,100,60) $militair = GUICtrlCreateButton("militair",290,125,60) $voertuigen = GUICtrlCreateButton("voertuigen",290,150,60) $onderzoek = GUICtrlCreateButton("onderzoek",290,175,60) $verdediging = GUICtrlCreateButton("verdediging",290,200,61) $overzicht = GUICtrlCreateButton("overzicht",290,225,60) GUISetState ();this wil create a button Dim $2, $3, $4, $5, $6, $7 While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then If WinActive("game") then Exit If WinActive("gebouwen") then GUIDelete( $2) If WinActive("militair") then GUIDelete( $3) if WinActive("voertuigen") then GUIDelete( $4) If WinActive("onderzoek") then GUIDelete( $5) If WinActive("verdediging") then GUIDelete( $6) If WinActive("overzicht") then GUIDelete($7) EndIf if $msg = $gebouwen Then GUI2Create() If $msg = $militair then Gui3create() if $msg = $voertuigen then Gui4create() If $msg = $onderzoek then Gui5create() If $msg = $verdediging then gui6create() If $msg = $overzicht then Gui7create() Wend Func GUI2Create() If WinExists("gebouwen") then Return $2 = GUICreate("gebouwen",350,350) GUISetState (@SW_SHOW) EndFunc Func Gui3create() If WinExists("militair") then Return $3 = GUICreate("militair",350,350) GUISetState (@SW_SHOW) EndFunc Func Gui4create() If WinExists("voertuigen") then Return $4 = GUICreate("voertuigen",350,350) GUISetState (@SW_SHOW) EndFunc Func gui5create() If WinExists("onderzoek") then Return $5 = GUICreate("onderzoek",350,350) GUISetState (@SW_SHOW) EndFunc Func gui6create() If WinExists("verdediging") then Return $6 = GUICreate("verdediging",350,350) GUISetState (@SW_SHOW) EndFunc Func gui7create() If WinExists("overzicht") then Return $7 = GUICreate("overzicht",350,350) GUISetState (@SW_SHOW) EndFunc i want that what you see in the screen shot of the notepad i want next to the Cash and iron and ederuim and electricity but it must work Link to comment Share on other sites More sharing options...
GrungeRocker Posted February 22, 2006 Share Posted February 22, 2006 inis must be sth like this:[Ressources] cash=1000 ...then just use iniread() (look it up in helpfile) [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
Cloudsx Posted February 22, 2006 Author Share Posted February 22, 2006 how is the full code of inin read with this [Ressources] cash=1000 Link to comment Share on other sites More sharing options...
GrungeRocker Posted February 22, 2006 Share Posted February 22, 2006 $cash = iniread("your.ini", "Ressources", "cash", 0) msgbox(0, "", "Your Cash is: " & $cash) [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
Cloudsx Posted February 22, 2006 Author Share Posted February 22, 2006 in the ini stand my cash is 2500 and it say in the autoit thing that is is 0 and it must diplay next to the cash token Link to comment Share on other sites More sharing options...
Valuater Posted February 22, 2006 Share Posted February 22, 2006 create a label just like i showed you before just place it next to the pic 8) Link to comment Share on other sites More sharing options...
Cloudsx Posted February 22, 2006 Author Share Posted February 22, 2006 (edited) thanks is good but if i but a militair of 100 cash will it go off the cash ??? and the ini read is good it work but it say my cash is 0 and in the ini it say 2500 Edited February 22, 2006 by Cloudsx Link to comment Share on other sites More sharing options...
Valuater Posted February 22, 2006 Share Posted February 22, 2006 1 you have to write the code to deduct the purchase ( cash ) from the label 2 at the upper portion of the script*********** $cash = iniread("your.ini", "Ressources", "cash", 0) next to a pic************** $Label = GuiCtrlCreateLabel($cash,........ 8) Link to comment Share on other sites More sharing options...
Cloudsx Posted February 22, 2006 Author Share Posted February 22, 2006 look to this code $cash = iniread("rechours", "Ressources", "Cash = 2500", 0) msgbox(0, "", "Your Cash is: " & $cash) if i change it to this $cash = iniread("rechours", "Ressources", "Cash = 2500", 2500) msgbox(0, "", "Your Cash is: " & $cash) then i get a msgbox and it say your cash is 2500 Link to comment Share on other sites More sharing options...
GrungeRocker Posted February 22, 2006 Share Posted February 22, 2006 it says its 0, 'cause of an error while reading! [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
Cloudsx Posted February 22, 2006 Author Share Posted February 22, 2006 it says its 0, 'cause of an error while reading!what you meen with error in reading Link to comment Share on other sites More sharing options...
Cloudsx Posted February 22, 2006 Author Share Posted February 22, 2006 1 you have to write the code to deduct the purchase ( cash ) from the label 2 at the upper portion of the script*********** $cash = iniread("your.ini", "Ressources", "cash", 0) next to a pic************** $Label = GuiCtrlCreateLabel($cash,........ 8) i dont under stand the ********************** Link to comment Share on other sites More sharing options...
BigDod Posted February 22, 2006 Share Posted February 22, 2006 Change $cash = iniread("rechours", "Ressources", "Cash = 2500", 0) msgbox(0, "", "Your Cash is: " & $cash) to $cash = iniread("rechours", "Ressources", "Cash", 0) msgbox(0, "", "Your Cash is: " & $cash) And try it. 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 More sharing options...
Cloudsx Posted February 22, 2006 Author Share Posted February 22, 2006 Change $cash = iniread("rechours", "Ressources", "Cash = 2500", 0) msgbox(0, "", "Your Cash is: " & $cash) to $cash = iniread("rechours", "Ressources", "Cash", 0) msgbox(0, "", "Your Cash is: " & $cash) And try it. then it will still says that it cash is 0 Link to comment Share on other sites More sharing options...
Valuater Posted February 22, 2006 Share Posted February 22, 2006 i was waiting for someone to fix the error $var = IniRead("C:\Temp\myfile.ini", "section2", "key", "NotFound") the ini read NEEDS to read an ini file $var = IniRead("C:\Temp\myfile.ini".......... 8) Link to comment Share on other sites More sharing options...
GaryFrost Posted February 22, 2006 Share Posted February 22, 2006 then it will still says that it cash is 0 No, that's the default value in case the iniread fails to get the value from the file SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
Cloudsx Posted February 22, 2006 Author Share Posted February 22, 2006 how can i show thw cash in here and next to the picture and i have to see it and if i buy something then it go off the cash or iron or ederuim #include <GUIConstants.au3> 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) $cash = iniread("rechours", "Ressources", "Cash", 0) msgbox(0, "", "Your Cash is: " & $cash) 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 More sharing options...
Valuater Posted February 22, 2006 Share Posted February 22, 2006 (edited) PUT THE LABEL THERE ( like i showed you... and told you before )not the inireadNew to AutoIt ? A Great Place To Start:==> Welcome to AutoIt 1-2-3 <==8) Edited February 22, 2006 by Valuater Link to comment Share on other sites More sharing options...
Cloudsx Posted February 22, 2006 Author Share Posted February 22, 2006 where do i have to place the label Link to comment Share on other sites More sharing options...
Valuater Posted February 22, 2006 Share Posted February 22, 2006 #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 GUICtrlCreatePic("Cash.jpg",25,10,20,20) ***** CREATE THE LABEL HERE ****** GUICtrlCreatePic("iron.jpg",115,10,20,20) GUICtrlCreatePic("ederuim.jpg",200,10,20,20) GUICtrlCreatePic("electricity.jpg",275,10,20,20) GUISetState (@SW_SHOW); will display an empty dialog Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now