YMI Posted August 9, 2014 Share Posted August 9, 2014 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 More sharing options...
YMI Posted August 9, 2014 Author Share Posted August 9, 2014 On further investigation, it seems like x86 and x64 might something to do with it (at least partially). Link to comment Share on other sites More sharing options...
YMI Posted August 14, 2014 Author Share Posted August 14, 2014 Anyone? Link to comment Share on other sites More sharing options...
wisem2540 Posted August 14, 2014 Share Posted August 14, 2014 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? Link to comment Share on other sites More sharing options...
YMI Posted August 14, 2014 Author Share Posted August 14, 2014 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 More sharing options...
JohnOne Posted August 14, 2014 Share Posted August 14, 2014 I really do not understand this, if you are writing the code then you determine what is in what folder. If a user feels he can change that then that user should change it all the time. 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 More sharing options...
YMI Posted August 14, 2014 Author Share Posted August 14, 2014 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 More sharing options...
JohnOne Posted August 14, 2014 Share Posted August 14, 2014 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 More sharing options...
Blue_Drache Posted August 17, 2014 Share Posted August 17, 2014 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 Link to comment Share on other sites More sharing options...
YMI Posted August 17, 2014 Author Share Posted August 17, 2014 (edited) It's still work in progress (this being a stable tag), but I'm attaching the code:<snip> Edited August 18, 2014 by Melba23 Code link removed Link to comment Share on other sites More sharing options...
Gianni Posted August 17, 2014 Share Posted August 17, 2014 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) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
YMI Posted August 18, 2014 Author Share Posted August 18, 2014 I tried adding "." and it didn't work. I'll try @ScriptDir, although I think I tried it already. Link to comment Share on other sites More sharing options...
Blue_Drache Posted August 18, 2014 Share Posted August 18, 2014 (edited) 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 August 18, 2014 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 18, 2014 Moderators Share Posted August 18, 2014 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. 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