7h331337 Posted July 31, 2008 Share Posted July 31, 2008 if i have this in a ini [ty] hi=hillo and i get this to retrev it $var = hi IniRead("my brain.ini", "ty", $var, "????") this should work but isnt can any 1 tel me y Link to comment Share on other sites More sharing options...
TehWhale Posted July 31, 2008 Share Posted July 31, 2008 See if this works! IniWrite(@ScriptDir&"\my brain.ini", "ty", "hi", "hillo" Local $HiVariable = "hi" $ReadIni = IniRead(@ScriptDir&"\my brain.ini", "ty", $HiVariable, "????") MsgBox(0, "$ReadIni Return:", "$ReadIni Returns: "& $ReadIni) Link to comment Share on other sites More sharing options...
7h331337 Posted July 31, 2008 Author Share Posted July 31, 2008 See if this works! IniWrite(@ScriptDir&"\my brain.ini", "ty", "hi", "hillo" Local $HiVariable = "hi" $ReadIni = IniRead(@ScriptDir&"\my brain.ini", "ty", $HiVariable, "????") MsgBox(0, "$ReadIni Return:", "$ReadIni Returns: "& $ReadIni)i just figured out y my ini was in rong place lol thanks any way for ure help Link to comment Share on other sites More sharing options...
Vindicator209 Posted July 31, 2008 Share Posted July 31, 2008 You want to read the ini into a variable, so $var = IniRead() That way, your $var will be whatever it picked up from you INI file. because by just doing this: $var = "hi" you are already defining $var as 'hi" and you are doing nothing with IniRead("my brain.ini", "ty", $var, "????") ^all you are doing there is reading the file, but not doing anythign with it $var = IniRead("my brain.ini", "ty","hi", "????") although, if you DID mean to use $var as your section, you still need to read it to a variable $var = hi $var2 = IniRead("my brain.ini", "ty", $var, "????") [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
7h331337 Posted July 31, 2008 Author Share Posted July 31, 2008 (edited) ok here is my script CODE #include <GUIConstants.au3> #include <EditConstants.au3> $Form1 = GUICreate("Form1", 325, 343, 269, 155) $a = GUICtrlCreateEdit("", 16, 16, 289, 233) $b = GUICtrlCreateEdit("", 16, 256, 201, 73) $Button1 = GUICtrlCreateButton("Button1", 232, 264, 73, 65, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then Exit EndIf $msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", GUICtrlRead($) If $nMsg = $Button1 Then ControlSetText("7H3 -", "", "RichEdit20W1", "") ControlClick("7H3 - ", "", "Button1") GUICtrlSetData($b, "") sleep(7000) $msn = ControlGetText("7H3 - ", "", "RichEdit20W1") GUICtrlSetData($a, $msn) $string = StringSplit($msn, @CRLF) sleep(500) If $string[0] >= 9 Then tooltip($string[9]) $ini = IniRead(@scriptdir & "/my brain.ini", "tv", $string[9], "????") $msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", $ini) GUICtrlSetData($b, $ini) ControlClick("7H3 - ", "", "Button1") GUICtrlSetData($b, "") EndIf EndIf WEnd here is what is in the ini CODE [tv] hi=hillo can any one tell me wy its not working i jost get ???? bk wen i try Edited July 31, 2008 by 7h331337 Link to comment Share on other sites More sharing options...
TehWhale Posted July 31, 2008 Share Posted July 31, 2008 #include <GUIConstants.au3>#include <EditConstants.au3>$Form1 = GUICreate("Form1", 325, 343, 269, 155)$a = GUICtrlCreateEdit("", 16, 16, 289, 233)$b = GUICtrlCreateEdit("", 16, 256, 201, 73)$Button1 = GUICtrlCreateButton("Button1", 232, 264, 73, 65, 0)GUISetState(@SW_SHOW)While 1$nMsg = GUIGetMsg()If $nMsg = $GUI_EVENT_CLOSE ThenExitEndIf$msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", GUICtrlRead($)If $nMsg = $Button1 ThenControlSetText("7H3 -", "", "RichEdit20W1", "")ControlClick("7H3 - ", "", "Button1")GUICtrlSetData($b, "")sleep(7000)$msn = ControlGetText("7H3 - ", "", "RichEdit20W1")GUICtrlSetData($a, $msn)$string = StringSplit($msn, @CRLF)sleep(500)If $string[0] >= 9 Thentooltip($string[9])$ini = IniRead(@scriptdir & "/my brain.ini", "tv", $string[9], "????")$msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", $ini)GUICtrlSetData($b, $ini)ControlClick("7H3 - ", "", "Button1")GUICtrlSetData($b, "")EndIfEndIfWEndWrong slash! Link to comment Share on other sites More sharing options...
7h331337 Posted July 31, 2008 Author Share Posted July 31, 2008 i changed the / to \ still not working Link to comment Share on other sites More sharing options...
bogQ Posted July 31, 2008 Share Posted July 31, 2008 i changed the / to \ still not workingcan you pls tell whats not workingits not reading ini secrot, its not setting data, its not reading data? TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.  Link to comment Share on other sites More sharing options...
TehWhale Posted July 31, 2008 Share Posted July 31, 2008 Did some more testing, and it's because when you have your script, when you click the button, it clears the text from that box, and later reads it, and if its greater than or equal to 9 then it writes, but since the box is cleared, it is 0 so it writes nothing! Link to comment Share on other sites More sharing options...
7h331337 Posted July 31, 2008 Author Share Posted July 31, 2008 i changed it to CODE #include <GUIConstants.au3> #include <EditConstants.au3> $Form1 = GUICreate("Form1", 325, 343, 269, 155) $a = GUICtrlCreateEdit("", 16, 16, 289, 233) $b = GUICtrlCreateEdit("", 16, 256, 201, 73) $Button1 = GUICtrlCreateButton("Button1", 232, 264, 73, 65, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then Exit EndIf $msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", GUICtrlRead($) If $nMsg = $Button1 Then ControlClick("7H3 - ", "", "Button1") GUICtrlSetData($b, "") sleep(7000) $msn = ControlGetText("7H3 - ", "", "RichEdit20W1") GUICtrlSetData($a, $msn) $string = StringSplit($msn, @CRLF) ControlSetText("7H3 -", "", "RichEdit20W1", "") sleep(500) If $string[0] >= 9 Then tooltip($string[9]) $ini = IniRead(@scriptdir & "\my brain.ini", "tv", $string[9], "????") $msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", $ini) GUICtrlSetData($b, $ini) ControlClick("7H3 - ", "", "Button1") GUICtrlSetData($b, "") EndIf EndIf WEnd still wont work by the way its for msn Link to comment Share on other sites More sharing options...
7h331337 Posted July 31, 2008 Author Share Posted July 31, 2008 i figured it out u wont believe how stupid it was in named my ini mybrain.ini but on the script i called it my brain.ini big thanks to all that helped Link to comment Share on other sites More sharing options...
Vindicator209 Posted July 31, 2008 Share Posted July 31, 2008 (edited) try removing the space between my and brain, mayby use an underscore my_brain.ini I've experienced problems with space before, and it's the only thing I can think of at this point set up "check points" by placing tooltipsor msgboxes here and there to see where the script starts to fail, perhaps it is MSN that is the problem? EDIt: damn, you beat me to your own answer, haha Edited July 31, 2008 by VindicatorOmega [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
7h331337 Posted July 31, 2008 Author Share Posted July 31, 2008 try removing the space between my and brain, mayby use an underscore my_brain.iniI've experienced problems with space before, and it's the only thing I can think of at this pointset up "check points" by placing tooltipsor msgboxes here and there to see where the script starts to fail, perhaps it is MSN that is the problem?EDIt: damn, you beat me to your own answer, hahalol Omega i never check the simple stuff i wish i did no lol i feel so dumb 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