Jump to content

script partially working


Recommended Posts

the mouse click at the bottom doesnt seem to work not really sure the other code is right either

#include "misc.au3"

While 1 = 1

if _ispressed("0d") then exitloop; press the ENTER key to exit the loop

$coord1 = PixelSearch( 538, 463, 626, 479, 0xE7E7E7 )

If Not @error Then

MouseClick("left", $coord1[0], $coord1[1], 1)

EndIf

;sleep(1000)

$FindDock = PixelSearch(766, 41, 781, 49, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock[0], $FindDock[1], 1)

Else

$FindDock2 = PixelSearch(784, 212, 797, 221, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock2[0], $FindDock2[1], 1)

EndIf

EndIf

$FindDock3 = PixelSearch(803, 386, 817, 394, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock3[0], $FindDock3[1], 1)

Else

$FindDock4 = PixelSearch(819, 559, 834, 567, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock4[0], $FindDock4[1], 1)

EndIf

EndIf

WEnd

MouseClick("left", 1124, 591, 1, 0)

Send("Welcome testing 123!!!")

Send("{ENTER}")

Edited by foolove
Link to comment
Share on other sites

Tried this getting error in expression on ElseIf line

$FindDock = PixelSearch(766, 41, 781, 49, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock[0], $FindDock[1], 1)

ElseIf

$FindDock2 = PixelSearch(784, 212, 797, 221, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock2[0], $FindDock2[1], 1)

ElseIf

$FindDock3 = PixelSearch(803, 386, 817, 394, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock3[0], $FindDock3[1], 1)

Else

$FindDock4 = PixelSearch(819, 559, 834, 567, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock4[0], $FindDock4[1], 1)

EndIf

EndIf

EndIf

EndIf

Link to comment
Share on other sites

  • Moderators

foolove,

When using _IsPressed you will only detect the {ENTER} key being pressed if it is actually pressed at the moment your script calls the function. Did you keep it pressed long enough? :graduated:

By the way if you are using _IsPressed in a loop like that, you should open user32.dll and pass the handle as explained in the Help file. :)

However if you want to avoid keeping the {ENTER} key pressed for such a long time then I suggest using a HotKey along these lines:

HotKeySet("{ENTER}", "On_ExitLoop")

$fFlag = True

While $fFlag ; This keeps the loop active untilt you set the flag to False
    Sleep(10)
WEnd

MsgBox(0, "Hi", "Here")

Func On_ExitLoop()
    $fFlag = False
EndFunc

As to the rest of your script, it seems to work as far as I can tell. I do not have the same image as you to test the PixelSearch returns, but substituting dummy position and error values makes it work as I expect. What do you think is going wrong? ;)

M23

P.S. When you post code please use Code tags. Put [autoit] before and [/autoit] after your posted code. ;)

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

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

  • Recently Browsing   0 members

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