Cloudsx Posted April 29, 2006 Share Posted April 29, 2006 I an making a game if i run the scrip then i see then you must choose a picture of the list then you press load to load your picture so if you stop with the game for 1 hour and you going to play again and then i want to see the picture and dont want to load it again do i need an .ini file for it or not do some one know that please help me with that Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 29, 2006 Share Posted April 29, 2006 I an making a game if i run the scrip then i see then you must choose a picture of the list then you press load to load your pictureso if you stop with the game for 1 hour and you going to play again and then i want to see the picture and dont want to load it againdo i need an .ini file for it or notdo some one know that please help me with thatYou will have to save the information somewhere, of course, and an INI file or the registry are good places. Read the AutoIT help file and check out the IniRead()/IniWrite() and RegRead()/RegWrite() functions. Once you get a script written, you can post it here, even if it doesn't work. We'll help you get it goingBut it always starts with the help file (which is also the command reference for AutoIT). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Cloudsx Posted April 29, 2006 Author Share Posted April 29, 2006 yes i already use the helpfile and the iniread i can explane it now better if i start the game from begin then you must choose a picture then you searc you picture and load it then i want that the picture been save that you never have to change your picture only if you want to change her is my little script with iniread #include <GUIconstants.au3> MsgBox(4096,"Choose your picture", "choose you picture you want to use for the game") $Player=FileOpenDialog ("choose your picture","C:\","(*.*)") GUICreate ("elcaponis" ,400,400) GUISetState(@SW_SHOW) GUICtrlCreatePic ($Player,25,70,64,64);you should be adjust at size your image $Player=IniRead("Player.ini", "Player", "C:\") i hope that i explane it now better Link to comment Share on other sites More sharing options...
Zedna Posted April 29, 2006 Share Posted April 29, 2006 at line before FileOpenDialog try to read name of picture from INI/registry and then only if name is not defined then invoke FileOpenDialog and save choosen picture name to INI/registry that's all Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Cloudsx Posted April 29, 2006 Author Share Posted April 29, 2006 i am sorry but my english is a bit bad what did you meen Link to comment Share on other sites More sharing options...
Zedna Posted April 29, 2006 Share Posted April 29, 2006 i am sorry but my english is a bit bad what did you meen #include <GUIconstants.au3> ;~ MsgBox(4096,"Choose your picture", "choose you picture you want to use for the game") $picname = RegRead("HKEY_CURRENT_USER\SOFTWARE\My player", "Picture name") If $picname = '' Then $picname=FileOpenDialog ("choose your picture","C:\","(*.*)") If @error Then Exit; Cancel RegWrite("HKEY_CURRENT_USER\SOFTWARE\My player", "Picture name", "REG_SZ", $picname) EndIf GUICreate ("My player" ,400,400) GUISetState(@SW_SHOW) GUICtrlCreatePic ($picname,25,70,64,64) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ChrisL Posted April 29, 2006 Share Posted April 29, 2006 Based on wht you posted before, it would be something like this... #include <GUIconstants.au3> $Player=IniRead("Player.ini", "Player", "PlayerName","NotSet"); Reads the player from the ini file ;if the ini file does not exist or no entry then load the file open dialogue. If $Player = "NotSet" then MsgBox(4096,"Choose your picture", "choose you picture you want to use for the game") $Player=FileOpenDialog ("choose your picture","C:\","(*.*)") EndIf IniWrite ("Player.ini", "Player", "PlayerName", $Player);write the player back to the ini file GUICreate ("elcaponis" ,400,400) GUISetState(@SW_SHOW) GUICtrlCreatePic ($Player,25,70,64,64);you should be adjust at size your image [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Cloudsx Posted April 29, 2006 Author Share Posted April 29, 2006 thansk this work 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