GraaF1337 Posted August 27, 2014 Share Posted August 27, 2014 I might be totally doing this wrong, but im kinda out of ideas here, so if one of you have an idea why this does as it does, i would be happy if you would leave a comment. I've been trying to read the nummer or letters typed into a Input, but it seems that i either get the wrong result or nothing at all. What i've tried so far: Worked but got wrong input: If i type in "12" in the InputBox it writes "4" in the "set.ini" #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("ASSET", 615, 438, 192, 124) GUISetState(@SW_SHOW) $AB = GUICtrlCreateButton("Apply", "200", "200") $AS = GUICtrlCreateInput("", "150", "150", "200") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $AB IniWrite("C:\Users\Toft\Desktop\set.ini", "AS", "ASSET", $AS) EndSwitch WEnd Didn't work at all: No matter what i type in the InputBox it wont write it into the Set.ini #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("ASSET", 615, 438, 192, 124) GUISetState(@SW_SHOW) $AB = GUICtrlCreateButton("Apply", "200", "200") $AS = GUICtrlCreateInput("", "150", "150", "200") $ASRead = GUICtrlRead($AS) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $AB IniWrite("C:\Users\Toft\Desktop\set.ini", "AS", "ASSET", $ASRead) EndSwitch WEnd Link to comment Share on other sites More sharing options...
Danyfirex Posted August 27, 2014 Share Posted August 27, 2014 Case $AB $ASRead = GUICtrlRead($AS) IniWrite("set.ini", "AS", "ASSET", "hola") Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Second Posted August 27, 2014 Share Posted August 27, 2014 #include <GUIConstantsEx.au3> $Form1 = GUICreate("ASSET", 615, 438, 192, 124) GUISetState(@SW_SHOW) $AB = GUICtrlCreateButton("Apply", "200", "200") $AS = GUICtrlCreateInput("", "150", "150", "200") $ASRead = GUICtrlRead($AS) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $AB ConsoleWrite(GUICtrlRead($AS)&@CRLF) EndSwitch WEnd You need to do guictrlread when the button is pressed, not while initializing Link to comment Share on other sites More sharing options...
GraaF1337 Posted August 27, 2014 Author Share Posted August 27, 2014 (edited) Case $AB $ASRead = GUICtrlRead($AS) IniWrite("set.ini", "AS", "ASSET", "hola") Saludos That dont work? I think you might have misunderstod me It need to write the input from the InputBox, this way you just showed me just give me a "4" no matter what i type into the inputbox #include <GUIConstantsEx.au3> $Form1 = GUICreate("ASSET", 615, 438, 192, 124) GUISetState(@SW_SHOW) $AB = GUICtrlCreateButton("Apply", "200", "200") $AS = GUICtrlCreateInput("", "150", "150", "200") $ASRead = GUICtrlRead($AS) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $AB ConsoleWrite(GUICtrlRead($AS)&@CRLF) EndSwitch WEndYou need to do guictrlread when the button is pressed, not while initializing Woaw i just tried doing the GUICtrlRead once the button is pressed still get "4" no matter what i type into the inputbox. Edited August 27, 2014 by GraaF1337 Link to comment Share on other sites More sharing options...
Danyfirex Posted August 27, 2014 Share Posted August 27, 2014 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("ASSET", 615, 438, 192, 124) GUISetState(@SW_SHOW) $AB = GUICtrlCreateButton("Apply", "200", "200") $AS = GUICtrlCreateInput("", "150", "150", "200") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $AB $ASRead = GUICtrlRead($AS) iniWrite("set.ini", "AS", "ASSET", $ASRead) EndSwitch WEnd :S Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
GraaF1337 Posted August 27, 2014 Author Share Posted August 27, 2014 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("ASSET", 615, 438, 192, 124) GUISetState(@SW_SHOW) $AB = GUICtrlCreateButton("Apply", "200", "200") $AS = GUICtrlCreateInput("", "150", "150", "200") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $AB $ASRead = GUICtrlRead($AS) iniWrite("set.ini", "AS", "ASSET", $ASRead) EndSwitch WEnd :S Ohhh woaw i forgot to remove the old GUICtrlRead ^^ Thank you very much both of you! Can be marked as solved! Link to comment Share on other sites More sharing options...
Danyfirex Posted August 27, 2014 Share Posted August 27, 2014 You can mark it as answered. saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
GraaF1337 Posted August 27, 2014 Author Share Posted August 27, 2014 Good thing i didn't Cuz i have a new problem now Now im working on making it give a error in the input is NOT 1 or 0 but i tried with "And" but it dont seem to work?. Case $AB $ASRead = GUICtrlRead($AS) If NOT $ASRead = "1" And "0" Then MsgBox("64", "ERROR:", "Error") Else iniWrite("set.ini", "AS", "ASSET", $ASRead) EndIf Also tried with "Or": Case $AB $ASRead = GUICtrlRead($AS) If NOT $ASRead = "1" Or "0" Then MsgBox("64", "ERROR:", "Error") Else iniWrite("set.ini", "AS", "ASSET", $ASRead) EndIf Link to comment Share on other sites More sharing options...
GraaF1337 Posted August 27, 2014 Author Share Posted August 27, 2014 Figured it out my self! Case $AB $ASRead = GUICtrlRead($AS) If $ASRead = "1" Then iniWrite("set.ini", "AS", "ASSET", $ASRead) Else If $ASRead = "0" Then iniWrite("set.ini", "AS", "ASSET", $ASRead) Else MsgBox("32", "Error:", "Error") EndIf EndIf 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