SunnBoy Posted December 18, 2009 Share Posted December 18, 2009 Hi im doing a script with input boxes. ok i got the program to save the text i put in the input boxes as an .ini file my problem is that everytime it puts an equal(=) sign infornt of it its probably an easy thing to fix but i dont know expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here $windowname = ("[San_Bow] SBot v1.49b (C)2008,2009 by bot-cave.net") ;Replace CharName with the name of your Character $sbotdirect = ("C:\Users\Marvin\Desktop\Toolbar\Silkroad\San_Bow--Bot\SBot_1.49b.exe") ;Enter the path to your sbot directory $silkroadpath = ("C:\Program Files (x86)\Silkroad\Silkroad.exe") ;Enter the path to your silkroad directory $loaderpath = ("C:\Program Files (x86)\Silkroad\Loader.exe") ;Enter the path to your loader #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Silkroad Manager", 437, 337, 192, 124) $min = GUICtrlCreateButton("Minimize", 16, 48, 75, 25, $WS_GROUP) $max = GUICtrlCreateButton("Maximize", 16, 80, 75, 25, $WS_GROUP) $show = GUICtrlCreateButton("Show", 16, 112, 75, 25, $WS_GROUP) $hide = GUICtrlCreateButton("Hide", 16, 144, 75, 25, $WS_GROUP) $startsbot = GUICtrlCreateButton("Start Sbot", 16, 176, 75, 25, $WS_GROUP) $startsilkroad = GUICtrlCreateButton("Start Silkroad", 16, 208, 75, 25, $WS_GROUP) $startsbotsro = GUICtrlCreateButton("Start Sbot + Silkroad", 16, 272, 123, 25, $WS_GROUP) $startloader = GUICtrlCreateButton("Start Silkroad + Loader", 16, 240, 123, 25, $WS_GROUP) $Label1 = GUICtrlCreateLabel("You need to Start Silkroad with Loader so all functions work!", 8, 8, 288, 17) $Label2 = GUICtrlCreateLabel("By: San_Bow", 144, 304, 68, 17) $ID_Input = GUICtrlCreateInput("", 112, 48, 121, 21) $PW_Input = GUICtrlCreateInput("", 112, 80, 121, 21) $Edit1 = GUICtrlCreateEdit("", 176, 56, 1, 9) GUICtrlSetData(-1, "Edit1") $ID = GUICtrlCreateLabel("ID", 240, 48, 15, 17) $PW = GUICtrlCreateLabel("PW", 240, 80, 22, 17) $Submit = GUICtrlCreateButton("Submit ", 272, 80, 107, 25, $WS_GROUP) $Read_ID = IniReadSection("config.ini", "Section 1") $Read_PW = IniReadSection("config.ini", "Section 2") GUISetState(@SW_SHOW) GUICtrlSetState($max,$GUI_DISABLE) GUICtrlSetState($show,$GUI_DISABLE) GUICtrlSetState($hide,$GUI_DISABLE) GUICtrlSetState($startsbot,$GUI_DISABLE) GUICtrlSetState($startsbotsro,$GUI_DISABLE) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $min min() Case $max max() Case $hide hide() Case $show show() Case $startsbot startsbot() Case $startsilkroad startsilkroad() Case $startloader startloader() Case $Submit IniWrite("config.ini", "Section 1", "ID:", GUICtrlRead ($ID_Input)) IniWrite("config.ini", "Section 2", "PW:", GUICtrlRead ($PW_Input)) EndSwitch WEnd Func min() WinSetState($windowname, "", @SW_MINIMIZE) EndFunc ;==>min Func max() WinSetState($windowname, "", @SW_MAXIMIZE) EndFunc ;==>max Func hide() WinSetState($windowname, "", @SW_HIDE) EndFunc ;==>hide Func show() WinSetState($windowname, "", @SW_SHOW) EndFunc ;==>show Func startsbot() Run($sbotdirect) EndFunc ;==>startsbot Func startsilkroad() Run($silkroadpath) EndFunc ;==>startsilkroad Func startloader() Run($loaderpath) WinWaitActive("Testosterone (C19H28O2)") Send("{Enter}") Sleep(15000) Send("{x}") Sleep(500) Send($Read_ID) Sleep(500) Send("{tab}") Send($Read_PW) Sleep(500) Send("{Enter}") Sleep(7500) EndFunc ;==>startloader Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 18, 2009 Moderators Share Posted December 18, 2009 SunnBoy,Using the built-in Ini functions will always use an =. It is the standard Windows convention as explained in the Help file:A standard ini file looks like:[sectionName]Key=ValueIf you want another delimiter, then you will have to write your own Ini functions. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SunnBoy Posted December 18, 2009 Author Share Posted December 18, 2009 oh ok thanks your right lol ok i have a problem lol again hopefully you can help me ok i have the input box now i wanted the GUI to read the box so i did $Read_ID = GUICtrlRead ($ID_Input) and $Read_PW = GUICtrlRead ($PW_Input) the $ID_Input, $PW_Input are sthe name of the input boxes ok now i want that the GUI sends the word he read in the input boxes to notepad so i did Run ($Read_ID) Sleep(500) Run($Read_PW) Sleep(1000) Run("notepad.exe") WinWaitActive ("Untitled - Notepad") Sleep(1000) Send($ID_Input & @CRLF & $PW_Input) the i run it but the only thing it puts in the file is 13 here is the whole script expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here $windowname = ("[San_Bow] SBot v1.49b (C)2008,2009 by bot-cave.net") ;Replace CharName with the name of your Character $sbotdirect = ("C:\Users\Marvin\Desktop\Toolbar\Silkroad\San_Bow--Bot\SBot_1.49b.exe") ;Enter the path to your sbot directory $silkroadpath = ("C:\Program Files (x86)\Silkroad\Silkroad.exe") ;Enter the path to your silkroad directory $loaderpath = ("C:\Program Files (x86)\Silkroad\Loader.exe") ;Enter the path to your loader #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Silkroad Manager", 437, 337, 192, 124) $min = GUICtrlCreateButton("Minimize", 16, 48, 75, 25, $WS_GROUP) $max = GUICtrlCreateButton("Maximize", 16, 80, 75, 25, $WS_GROUP) $show = GUICtrlCreateButton("Show", 16, 112, 75, 25, $WS_GROUP) $hide = GUICtrlCreateButton("Hide", 16, 144, 75, 25, $WS_GROUP) $startsbot = GUICtrlCreateButton("Start Sbot", 16, 176, 75, 25, $WS_GROUP) $startsilkroad = GUICtrlCreateButton("Start Silkroad", 16, 208, 75, 25, $WS_GROUP) $startsbotsro = GUICtrlCreateButton("Start Sbot + Silkroad", 16, 272, 123, 25, $WS_GROUP) $startloader = GUICtrlCreateButton("Start Silkroad + Loader", 16, 240, 123, 25, $WS_GROUP) $Label1 = GUICtrlCreateLabel("You need to Start Silkroad with Loader so all functions work!", 8, 8, 288, 17) $Label2 = GUICtrlCreateLabel("By: San_Bow", 144, 304, 68, 17) $ID_Input = GUICtrlCreateInput("", 112, 48, 121, 21) $PW_Input = GUICtrlCreateInput("", 112, 80, 121, 21) $Edit1 = GUICtrlCreateEdit("", 176, 56, 1, 9) GUICtrlSetData(-1, "Edit1") $ID = GUICtrlCreateLabel("ID", 240, 48, 15, 17) $PW = GUICtrlCreateLabel("PW", 240, 80, 22, 17) $Submit = GUICtrlCreateButton("Submit ", 272, 80, 107, 25, $WS_GROUP) $Read_ID = GUICtrlRead ($ID_Input) $Read_PW = GUICtrlRead ($PW_Input) GUISetState(@SW_SHOW) GUICtrlSetState($max,$GUI_DISABLE) GUICtrlSetState($show,$GUI_DISABLE) GUICtrlSetState($hide,$GUI_DISABLE) GUICtrlSetState($startsbot,$GUI_DISABLE) GUICtrlSetState($startsbotsro,$GUI_DISABLE) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $min min() Case $max max() Case $hide hide() Case $show show() Case $startsbot startsbot() Case $startsilkroad startsilkroad() Case $startloader startloader() Case $Submit IniWrite("config.ini", "Section 1", "ID:", GUICtrlRead ($ID_Input)) IniWrite("config.ini", "Section 2", "PW:", GUICtrlRead ($PW_Input)) EndSwitch WEnd Func min() Run ($Read_ID) Sleep(500) Run($Read_PW) Sleep(1000) Run("notepad.exe") WinWaitActive ("Untitled - Notepad") Sleep(1000) Send($ID_Input & @CRLF & $PW_Input) EndFunc ;==>min Func max() WinSetState($windowname, "", @SW_MAXIMIZE) EndFunc ;==>max Func hide() WinSetState($windowname, "", @SW_HIDE) EndFunc ;==>hide Func show() WinSetState($windowname, "", @SW_SHOW) EndFunc ;==>show Func startsbot() Run($sbotdirect) EndFunc ;==>startsbot Func startsilkroad() Run($silkroadpath) EndFunc ;==>startsilkroad Func startloader() Run($loaderpath) WinWaitActive("Testosterone (C19H28O2)") Send("{Enter}") Sleep(15000) Send("{x}") Sleep(500) Send($Read_ID) Sleep(500) Send("{tab}") Send($Read_PW) Sleep(500) Send("{Enter}") Sleep(7500) EndFunc ;==>startloader Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 18, 2009 Moderators Share Posted December 18, 2009 SunnBoy, i did $Read_ID = GUICtrlRead ($ID_Input) and $Read_PW = GUICtrlRead ($PW_Input) the $ID_Input, $PW_Input are sthe name of the input boxes ok now i want that the GUI sends the word he read in the input boxes to notepadSend($ID_Input & @CRLF & $PW_Input) ; Look above to see what these variables are!!!!!!!!!!! Can you see where the problem might lie? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SunnBoy Posted December 18, 2009 Author Share Posted December 18, 2009 hehehe no lol im like really new here Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 18, 2009 Moderators Share Posted December 18, 2009 SunnBoy, We all start somewhere! Glad I could I help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SunnBoy Posted December 18, 2009 Author Share Posted December 18, 2009 wait hold on... i dont get it what do i gotta change lol i changed Func min() Run ($Read_ID) Sleep(500) Run($Read_PW) Sleep(1000) Run("notepad.exe") WinWaitActive ("Untitled - Notepad") Sleep(1000) Send($Read_ID & @CRLF & $Read_PW) EndFunc ;==>min but now it opens notepad and it just puts two blanks no text Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 18, 2009 Moderators Share Posted December 18, 2009 SunnBoy,Without sight of the whole script it is hard to say exactly, but I suspect that you need to have the 2 variables in question declared as Global so that when they are created in Func $Read_ID they are also available to the rest of your script.A small tutorial on Global/Local:- Any variable that is set (that is given a value: $variable = something) in the main part of the script is automatically a Global variable.- Any variable that is set in a function is automatically a Local variable and is lost when the function ends.- You can override this with the Global/Local keywords (although SciTE is likely to complain if you use them in the wrong sense!)Best practise is to declare all variables using the Global and Local keywords so there is no ambiguity. It is also a good idea to use as few Global variables as you can get away with - although this is harder to achieve than you might think.Remember that you can pass variables as parameters to other functions - and if you use the ByRef keyword you can alter the value within a function as well.I hope this helps. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SunnBoy Posted December 18, 2009 Author Share Posted December 18, 2009 i declared them as global but the same thing keeps happening maybe you can take a look at it expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here Global $windowname = ("[San_Bow] SBot v1.49b (C)2008,2009 by bot-cave.net") ;Replace CharName with the name of your Character Global $sbotdirect = ("C:\Users\Marvin\Desktop\Toolbar\Silkroad\San_Bow--Bot\SBot_1.49b.exe") ;Enter the path to your sbot directory Global $silkroadpath = ("C:\Program Files (x86)\Silkroad\Silkroad.exe") ;Enter the path to your silkroad directory Global $loaderpath = ("C:\Program Files (x86)\Silkroad\Loader.exe") ;Enter the path to your loader #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Silkroad Manager", 437, 337, 192, 124) Global $min = GUICtrlCreateButton("Minimize", 16, 48, 75, 25, $WS_GROUP) Global $max = GUICtrlCreateButton("Maximize", 16, 80, 75, 25, $WS_GROUP) Global $show = GUICtrlCreateButton("Show", 16, 112, 75, 25, $WS_GROUP) Global $hide = GUICtrlCreateButton("Hide", 16, 144, 75, 25, $WS_GROUP) Global $startsbot = GUICtrlCreateButton("Start Sbot", 16, 176, 75, 25, $WS_GROUP) Global $startsilkroad = GUICtrlCreateButton("Start Silkroad", 16, 208, 75, 25, $WS_GROUP) Global $startsbotsro = GUICtrlCreateButton("Start Sbot + Silkroad", 16, 272, 123, 25, $WS_GROUP) Global $startloader = GUICtrlCreateButton("Start Silkroad + Loader", 16, 240, 123, 25, $WS_GROUP) Global $Label1 = GUICtrlCreateLabel("You need to Start Silkroad with Loader so all functions work!", 8, 8, 288, 17) Global $Label2 = GUICtrlCreateLabel("By: San_Bow", 144, 304, 68, 17) Global $ID_Input = GUICtrlCreateInput("", 112, 48, 121, 21) Global $PW_Input = GUICtrlCreateInput("", 112, 80, 121, 21) Global $Edit1 = GUICtrlCreateEdit("", 176, 56, 1, 9) GUICtrlSetData(-1, "Edit1") Global $ID = GUICtrlCreateLabel("ID", 240, 48, 15, 17) Global $PW = GUICtrlCreateLabel("PW", 240, 80, 22, 17) Global $Submit = GUICtrlCreateButton("Submit ", 272, 80, 107, 25, $WS_GROUP) Global $Read_ID = GUICtrlRead ($ID_Input) Global $Read_PW = GUICtrlRead ($PW_Input) GUISetState(@SW_SHOW) GUICtrlSetState($max,$GUI_DISABLE) GUICtrlSetState($show,$GUI_DISABLE) GUICtrlSetState($hide,$GUI_DISABLE) GUICtrlSetState($startsbot,$GUI_DISABLE) GUICtrlSetState($startsbotsro,$GUI_DISABLE) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $min min() Case $max max() Case $hide hide() Case $show show() Case $startsbot startsbot() Case $startsilkroad startsilkroad() Case $startloader startloader() Case $Submit IniWrite("config.ini", "Section 1", "ID:", GUICtrlRead ($ID_Input)) IniWrite("config.ini", "Section 2", "PW:", GUICtrlRead ($PW_Input)) EndSwitch WEnd Func min() Run($Read_ID) Sleep(500) Run($Read_PW) Sleep(1000) Run("notepad.exe") WinWaitActive ("Untitled - Notepad") Send($Read_ID & @CRLF & $Read_PW) EndFunc ;==>min Func max() WinSetState($windowname, "", @SW_MAXIMIZE) EndFunc ;==>max Func hide() WinSetState($windowname, "", @SW_HIDE) EndFunc ;==>hide Func show() WinSetState($windowname, "", @SW_SHOW) EndFunc ;==>show Func startsbot() Run($sbotdirect) EndFunc ;==>startsbot Func startsilkroad() Run($silkroadpath) EndFunc ;==>startsilkroad Func startloader() Run($loaderpath) WinWaitActive("Testosterone (C19H28O2)") Send("{Enter}") Sleep(15000) Send("{x}") Sleep(500) Send($Read_ID) Sleep(500) Send("{tab}") Send($Read_PW) Sleep(500) Send("{Enter}") Sleep(7500) EndFunc ;==>startloader Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 18, 2009 Moderators Share Posted December 18, 2009 SunnBoy,I did not realise you were writing a bot - I normally do not help in that case. But as I have started I will give one last piece of advice: You are setting the variables by reading the inputs immediately they are created - when they are blank. Perhaps if you read them just before you need them. So you would need:WinWaitActive ("Untitled - Notepad") $Read_ID = GUICtrlRead ($ID_Input) $Read_PW = GUICtrlRead ($PW_Input) Send($Read_ID & @CRLF & $Read_PW)Or just read the inputs directly as you do here:Case $Submit IniWrite("config.ini", "Section 1", "ID:", GUICtrlRead ($ID_Input)) IniWrite("config.ini", "Section 2", "PW:", GUICtrlRead ($PW_Input))Bye.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SunnBoy Posted December 18, 2009 Author Share Posted December 18, 2009 Hey im not writing a bot!!! just want to make sure im writing a tool that helps a bot for a game in the only way thats autmatically starting it and entering the login information! thanks for all your help 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