Jump to content

reach parental folder and get other directory within


Recommended Posts

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 by xnx
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by xnx
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

ok - back to beginning I got it. thank you! but another issue :D

 

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 by

Run(@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 by xnx
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by xnx
Link to comment
Share on other sites

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.exe
this 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

  • Moderators

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

 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...