Jump to content

Script working on my PC but not on a friends


Recommended Posts

Hello,

global $y, $x
#RequireAdmin
Global $Paused
HotKeySet("{NUMPAD2}", "Pause")
HotKeySet("{NUMPAD8}", "End")
Opt("MouseClickDownDelay", 30)

#include <ImageSearch2015.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <UpDownConstants.au3>
#include <Misc.au3>



Sleep(6000)

Sleep(3000)
  $search1 = _WaitForImageSearch("goo.bmp", 30, 1, $x, $y, 10)
If $search1 = 1 Then
  MouseMove(1500, 1500, 10)
  Sleep(100)
  MouseClick("right")
  Sleep(300)
  EndIf

I've this script.

The problem is that it work the way it is supposed to but doesnt work on a friends pc, even tho we have the same image search in C/programms(x86)/autoit3/include 

and the same dll in system 32.

When he starts the script on the desktop without having the "goo.bmp" file on his pc, the script finds it and right clicks the given location, while for me it doesnt and i have to open the folder with the "goo.bmp" picture in it.

Im out of ideas on what could cause the problem.

Any help?

Thank you in advance

 

 

Link to comment
Share on other sites

You are using Absolute screen cords, but aren't taking into account that maybe your friend has multiple monitors, maybe they are using a different resolution, maybe what they are clicking is windowed and not maximized.

Your script is too weak to dynamically grab the proper place to click.  The fact that it even works consistently on your computer is probably nothing more than a coincidence.

 

Your best bet to getting help is to instead state what you are attempting to do.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

23 minutes ago, FrancescoDiMuro said:

@tiye0405

What is this script for?

It’s like always 😤...

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

  • Moderators

FrancescoDiMuro,

Please stop asking leading questions like that. If there is no prima facie evidence of the question being against the Forum rules (and I can see no such evidence here) then do not seek to get the OP to incriminate themselves. If you believe that there is such evidence, then report the thread and let the Mods deal with it.

caramen,

This is the second time in 2 days I have had occasion to deal with snide remarks from you - please do not make it a hat-trick. if you do not like the rules in this forum (which are set out by Jon, the site owner and author of AutoIt) then feel free to leave. If you decide to stay then accept them for what they are and refrain from harping on about them even if you are not in agreement.

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

  • Moderators

@caramen in short, about the next time you make one of these childish little comments, you're going to earn a vacation from this forum altogether. Enough of the whining.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I know you love me o:) dont worry i am not whining. I understood @Melba23 I guess it was enouth as a warning. 

 

Regards

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Hello thank you for replying. However it's not a coincidence that it works for me and as simple as it seems, this script is supposed to see the picture and click on whatever location he wants. I've used this kind of command dozens of times and it worked.

 

For him the problem is that even if the picture isnt on his pc, it still finds it and when i tried to have the mouse move to $x $y just to test, it kept shooting into the top left corner.

The most ridiculou thing is that his image search seems to find pictures that are not even existent. It even fullfills the if statement when i add a buch of random letters like "asdqwe.bmp".   

 

I thought it could be his imgsearch.au3 but I sent him mine and I also sent him the imgsearchx64.dll

 

It should be working but it doesnt give a damn and always fulfills the if statement.

global $y, $x
#RequireAdmin
Global $Paused
HotKeySet("{NUMPAD2}", "Pause")
HotKeySet("{NUMPAD8}", "End")
Opt("MouseClickDownDelay", 30)

#include <ImageSearch2015.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <UpDownConstants.au3>
#include <Misc.au3>



Sleep(6000)


  $search1 = _WaitForImageSearch("goo.bmp", 5, 1, $x, $y, 10)
If $search1 = 1 Then
  MsgBox(0, "Found", "found the picture", 5)
  ElseIf $search1 = Not 1 Then
     MsgBox(0, "Not Found", "cant find the picture", 5)
     EndIf

In this case it tells me found when i open the folder with the picture in it and not found if i dont

and keeps spamming found to him instantly no matter what.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...