DeathnLife Posted December 30, 2006 Share Posted December 30, 2006 I got a script that settings from an ini file - it does this fine. Then I have a GUI displaying some information from this ini - fine. You then edit the input boxes and click login, at this point it should be rewriting the ini file with new information - I'm nor sure what goes wrong here Now when i next open it, the fields are 4, 6, 8, 10 and 12 - not text strings. Really, I don't understand what I'm doing wrong. Please help me! expandcollapse popup#include <GUIConstants.au3> $iniuser=IniRead("settings.ini", "login", "username", "Login") $inipass=IniRead("settings.ini", "login", "password", "Password") $inichar=IniRead("settings.ini", "login", "character", "1") $inipath=IniRead("settings.ini", "paths", "sropath", "C:\Program Files\Silkroad") $inibot=IniRead("settings.ini", "paths", "botpath", "C:\Program Files\bot") Opt("GUIOnEventMode", 1) $window=GUICreate("Login", 216,128) GUICtrlCreateLabel("Login:",5,7,30,20) $login=GUICtrlCreateInput($iniuser,70,5,85,20,-1) GUICtrlCreateLabel("Password:",5,34,50,20) $password=GUICtrlCreateInput($inipass, 70,30,85 , 20,-1) GUICtrlCreateLabel("Char Nr:",5,58,50,20) $character=GUICtrlCreateInput($inichar,70,55,20,20,-1) GUICtrlCreateLabel("Silkroad Dir:",5,84,60,20) $sropath=GUICtrlCreateInput($inipath,70,80,142,20,-1) GUICtrlCreateLabel("Silkroad Dir:",5, 109,60,20) $botpath=GUICtrlCreateInput($inibot,70,105,142,20,-1) $okbutton=GUICtrlCreateButton("Login",170,10,40) GUICtrlSetOnEvent($okbutton,"OKButton") $exitbutton=GUICtrlCreateButton("Exit",170,42,40) GUICtrlSetOnEvent($exitbutton,"EXITButton") GUISetOnEvent($GUI_EVENT_CLOSE,"CLOSEClicked") GUISetState(@SW_SHOW) While 1 Sleep(50) WEnd Func OKButton() IniWrite("settings.ini", "login", "username", $login) Iniwrite("settings.ini", "login", "password", $password) Iniwrite("settings.ini", "login", "character", $character) Iniwrite("settings.ini", "paths", "sropath", $sropath) Iniwrite("settings.ini", "paths", "botpath", $botpath) EndFunc Func EXITButton() MsgBox("","Goodbye", "Thank you for using my login script.",3) Exit EndFunc Func CLOSEClicked() Exit EndFunc Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 30, 2006 Share Posted December 30, 2006 You must do a GUICtrlRead to get the text in the input Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 30, 2006 Share Posted December 30, 2006 I noticed you don't have a path for your ini files like C:\settings.iniis there a reason for thisthat basically means it creates it in whatever directory its currently running in, kinda like doing an @ScriptDir & "\settings.ini" Link to comment Share on other sites More sharing options...
DeathnLife Posted December 30, 2006 Author Share Posted December 30, 2006 Can you please put GUICtrlRead into my script please? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 30, 2006 Share Posted December 30, 2006 (edited) Look in the Help File it's quite simple. or have googe do it for you, for simple stuff just refer to the help file , so they actually learn. Edited December 30, 2006 by Thatsgreat2345 Link to comment Share on other sites More sharing options...
The Kandie Man Posted December 30, 2006 Share Posted December 30, 2006 (edited) expandcollapse popup#include <GUIConstants.au3> $iniuser=IniRead("settings.ini", "login", "username", "Login") $inipass=IniRead("settings.ini", "login", "password", "Password") $inichar=IniRead("settings.ini", "login", "character", "1") $inipath=IniRead("settings.ini", "paths", "sropath", "C:\Program Files\Silkroad") $inibot=IniRead("settings.ini", "paths", "botpath", "C:\Program Files\bot") Opt("GUIOnEventMode", 1) $window=GUICreate("Login", 216,128) GUICtrlCreateLabel("Login:",5,7,30,20) $login=GUICtrlCreateInput($iniuser,70,5,85,20,-1) GUICtrlCreateLabel("Password:",5,34,50,20) $password=GUICtrlCreateInput($inipass, 70,30,85 , 20,-1) GUICtrlCreateLabel("Char Nr:",5,58,50,20) $character=GUICtrlCreateInput($inichar,70,55,20,20,-1) GUICtrlCreateLabel("Silkroad Dir:",5,84,60,20) $sropath=GUICtrlCreateInput($inipath,70,80,142,20,-1) GUICtrlCreateLabel("Silkroad Dir:",5, 109,60,20) $botpath=GUICtrlCreateInput($inibot,70,105,142,20,-1) $okbutton=GUICtrlCreateButton("Login",170,10,40) GUICtrlSetOnEvent($okbutton,"OKButton") $exitbutton=GUICtrlCreateButton("Exit",170,42,40) GUICtrlSetOnEvent($exitbutton,"EXITButton") GUISetOnEvent($GUI_EVENT_CLOSE,"CLOSEClicked") GUISetState(@SW_SHOW) While 1 Sleep(50) WEnd Func OKButton() IniWrite("settings.ini", "login", "username", GUICtrlRead($login)) Iniwrite("settings.ini", "login", "password", GUICtrlRead($password)) Iniwrite("settings.ini", "login", "character", GUICtrlRead($character)) Iniwrite("settings.ini", "paths", "sropath", GUICtrlRead($sropath)) Iniwrite("settings.ini", "paths", "botpath", GUICtrlRead($botpath)) EndFunc Func EXITButton() MsgBox("","Goodbye", "Thank you for using my login script.",3) Exit EndFunc Func CLOSEClicked() Exit EndFunc Use it like that, when you create controls, the controls handle is returned. It is simply a number. You have to use the GUICtrlRead function to actually read the data that is in the control. EDIT: It seems all three of us read the page and started posting at around the same time. Edited December 30, 2006 by The Kandie Man "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
DeathnLife Posted December 30, 2006 Author Share Posted December 30, 2006 Thank you very much. Works fine. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 30, 2006 Share Posted December 30, 2006 I see this is for SilkRoad just letting you know, it has GG and this probably won't work well it might yeah for the login screen but if you planning on a bot it wont work. Link to comment Share on other sites More sharing options...
DeathnLife Posted December 30, 2006 Author Share Posted December 30, 2006 You may also see I'm using iSROBot with this. (uses it's own GameGuard bypass) 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