xnx Posted May 3, 2015 Share Posted May 3, 2015 (edited) hello fellas! my first question to this board will be:how can i reach a database which is NOT in the scriptdir but in another folder in the parental folder of the scriptdir? example: \Folder1\ \Folder1.1 (here is the script) \Folder1.2 (here is the database.ini file) Global $Counter = IniReadSection(@ScriptDir & "\..\Folder1.2\Database.ini", "Counter")seems not to work hope for your ideas Edited May 3, 2015 by xnx Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 3, 2015 Moderators Share Posted May 3, 2015 xnx,Welcome to the AutoIt forums.The default folder is the one in which the script resides, so you need to move back up one level and then define the new path. This works for me:Global $Counter = IniReadSection("..\Folder1.2\Database.ini", "Counter")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...
xnx Posted May 3, 2015 Author Share Posted May 3, 2015 (edited) didnt work for me. is there any navigation tutorial i should read?i understood it like you - go one level up by ..\ and go into folder wanted and choose file. give me error: Line 9482 (File "..........."):Error: Subscript used on non-accessible variable. when i bring database back to script Dir and go in by Global $Counter = IniReadSection(@ScriptDir & "\Database.ini", "Counter")then it works again without error message... very strange - i dont get it xD sitting here since hours on that problem Edited May 3, 2015 by xnx Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 3, 2015 Moderators Share Posted May 3, 2015 xnx,That error has nothing to do with the path itself - you are trying to access an array element within a variable which is not an array. I tested the code I posted (which I always do unless otherwise stated) and it read the .ini file in a sibling folder without problem. I suggest you post your whole script with a copy of the .ini file so we can dig deeper and find out why it is not working.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...
xnx Posted May 3, 2015 Author Share Posted May 3, 2015 (edited) ok - back to beginning I got it. thank you! but another issue i have a directory structure:Code\ _inject_DC\ _inject_DC.au3 (my SubRoutine script) Database\ Database.ini (my database) MainRoutine.au3 (my script) my MainRoutine uses this code to access Database.ini:IniWrite(@ScriptDir & "\Database\Database.ini", "Counter", "Aktuell", $Count) Global $aArray = IniReadSection(@ScriptDir & "\Database\Database.ini", "Account" & $Count)my SubRoutine uses this code to access Database.ini:Global $Counter = IniReadSection("..\Database\Database.ini", "Counter") Global $Count = $Counter[1][1] Global $aArray = IniReadSection("..\Database\Database.ini", "Account" & $Count) Global $CharacterName = $aArray[6][1] everything works fine now. write/read wonderful!each script for itself works fine as well but when i start mainroutine which automatically starts subroutine byRun(@ScriptDir & "\_inject_DC\" & ("_inject_DC") & $Count & (".exe"))it crashes - if i start it manually by clicking it, it runs perfect.what is wrong o0 Edited May 3, 2015 by xnx Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 3, 2015 Moderators Share Posted May 3, 2015 xnx,Looking at what you posted there is a "_inject_DC" too many in that line. When debugging, it is always a good idea to look at the strings you pass to Run to make sure you are passing what you think you are - often you find you are not.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...
xnx Posted May 3, 2015 Author Share Posted May 3, 2015 (edited) sorry my bad "SubRoutine.au3" was example. it originally is "_inject_DC.au3" as SubRoutine my bad so this aint the problem :S Line 4338 (File "\....\_inject_DC\_inject_DC1.exe")"error: subscript used on non-accessible variable." while the error-message the "_inject_DC1.exe" is in taskmanager - so it is found already... this is so weird! Edited May 3, 2015 by xnx Link to comment Share on other sites More sharing options...
xnx Posted May 3, 2015 Author Share Posted May 3, 2015 ShellExecute(@ScriptDir & "\_inject_DC\_inject_DC1.exe")RunWait(@ScriptDir & "\_inject_DC\_inject_DC1.exe")Run(@ScriptDir & "\_inject_DC\_inject_DC1.exe")all of them dont work.C:\Users\...\Desktop\Wächter + Database + DC\_inject_DC\_inject_DC1.exethis is the copy-paste directory of the file i want to run...it is so weird, that it works perfect while starting manually but sending error when started via script Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 3, 2015 Moderators Share Posted May 3, 2015 xnx,Sending your full script to a Mod when it is a gamebot is not a good idea. Please read the Forum rules- particularly the bit about not discussing game automation - before you post again. Thread locked.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...
Recommended Posts