Jump to content
Sign in to follow this  
YMI

Path parsing differs between users

Recommended Posts

YMI

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!

Share this post


Link to post
Share on other sites
YMI

On further investigation, it seems like x86 and x64 might something to do with it (at least partially).

Share this post


Link to post
Share on other sites
wisem2540

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?

Share this post


Link to post
Share on other sites
YMI

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.

Share this post


Link to post
Share on other sites
YMI

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

Share this post


Link to post
Share on other sites
JohnOne

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.

Share this post


Link to post
Share on other sites
Blue_Drache

Can we get more of the script since it's open source?  There may be something else that you're overlooking that's important.


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

Share this post


Link to post
Share on other sites
YMI

It's still work in progress (this being a stable tag), but I'm attaching the code:

<snip>

Edited by Melba23
Code link removed

Share this post


Link to post
Share on other sites
Chimp

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)

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

Share this post


Link to post
Share on other sites
YMI

I tried adding "." and it didn't work. I'll try @ScriptDir, although I think I tried it already.

Share this post


Link to post
Share on other sites
Blue_Drache

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

Share this post


Link to post
Share on other sites
Melba23

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


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×