Jump to content

Path parsing differs between users


YMI
 Share

Recommended Posts

Hi,

I'm building an AutoIt application with a friend, and my system parses paths differently than his system.

For example, my system treats "" the same way as "" (very common in programming languages), but his system doesn't (my files are found while his won't).

Another problem I've encountered is differences regarding relative paths. For example, we're use the ImageSearch module.

My file structure is:

mainmain_app.au3:

#include <modules\Utils.au3>

SearchWrapper() 

mainmodulesUtils.au3

#include <ImageSearch.au3>

Func SearchWrapper()
    _ImageSearchArea(...)
EndFunc 

mainmodulesImageSearchDLL.dll

mainmodulesImageSearch.au3

.
.
.
Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance)
    ...
    $result = DllCall("modules\ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage)
    ...
.
.
.

On my system, the first parameter to DllCall must be "modulesImageSearchDLL.dll", or it fails. On my friend's system it fails unless we set it to "ImageSearchDLL.dll" (without the "modules" prefix).

When I checked, both @ScriptDir and @WorkingDir contain the main directory (both on my system and my friend's), so relative paths should behave the same.

The code is identical, as we're using version control and can easily identify any differences in the code.

I'm using AutoIt v3.3.12.0 and he uses v3.3.10.2 (might be the root cause).

Does anyone know what can cause such a difference in behaviour?

Thanks a lot!

Link to comment
Share on other sites

If it works for you, why not compile it to an EXE and give it to him?  Then it would be guaranteed to work.  Otherwise, maybe you both should use the same version of autoit?

 

1. This will be distributed to the masses, so I can't guarantee that everyone who downloads my app will have the same AutoIt version as I do.

2. This app is open source, so even if I do compile it, people might get the code and suddenly it'll stop working for them.

Link to comment
Share on other sites

The problem is that the files are in the same folders, but one system responds to one relative path and another system responds to a different relative path (on an identical file tree).

Link to comment
Share on other sites

Well it is weird..

n my system, the first parameter to DllCall must be "modulesImageSearchDLL.dll", or it fails. On my friend's system it fails unless we set it to "ImageSearchDLL.dll" (without the "modules" prefix).

That suggests the files are in separate folders  I have never heard the like.

I would simple instruct my users to download the correct version of AutoIt.

I know that does not solve the issue, but I'm stumped, perhaps someone else can shed some light.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

you could try to use this sintax:

#include <.\modules\Utils.au3>

added "." in front of path, that means starting point is current directory (of the running script)

or even this sintax:

$result = DllCall(@ScriptDir & "\modules\ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)

that means starting point is @script dir.

or also this should work:

$result = DllCall(".\modules\ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Ghomfights.au3

$usepotion = 1
$xratio = 1
$yratio = 1
Global Const $default_resolutionX = 1366
Global Const $default_resolutionY = 768
Global Const $x_ratio = @DesktopWidth / $default_resolutionX
Global Const $y_ratio = @DesktopHeight / $default_resolutionY

Func wizard()
      HotKeySet("{F1}", "_Close")
    Sleep(500)
    MouseMove(Round(902 * $x_ratio), Round(192 * $y_ratio)) ; Move mouse straight
    Sleep(500)
    ; Buffs
     Send("1")
    Sleep(30)
    Send("2")
    Sleep(35)
    Send("3")
    Sleep(40)
    Send("{SHIFTDOWN}")
    Sleep(200)

I knew there was something you were overlooking.  The forum rules.

Game bot.  Reported.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

  • Moderators

YMI,

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation - and then you will understand why you will get no more help and this thread will now be locked. :naughty:

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