Jump to content
Sign in to follow this  
AndreasNWWWWW

How can i make an array of different mouseclick locations?

Recommended Posts

AndreasNWWWWW
; Press Esc to terminate script, Pause/Break to "pause"
#include <MsgBoxConstants.au3>
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
Send("{pause}")

;;;; Body of program would go here;;;;
Local $i = 1
Local $x = 1
while $i <= 1

While $x <= 10
    ToolTip($x, 0, 0)
; Søker opp den gule kula
$location = PixelSearch (0, 0, 1673, 984,0xFFDD4D, 2, 1)
If IsArray ($location) = 0 Then
     ExitLoop
EndIf

If IsArray ($location) = 1 Then
    MouseMove( $location[0], $location[1],20)
    if Not @error Then;hvis den gule kula er funnet, søker opp det røde



$location = PixelSearch ($location[0], $location[1], $location[0],973 ,0xEA401F, 10, 1)
If IsArray ($location) = 1 Then

    MouseMove( $location[0], $location[1],20)

    if Not @error Then

        MsgBox(1,"funnet røde","funnet røde")
        EndIf
    Else
        MsgBox(1,"IKKE FUNNET røde","ingenting funnet")
        ExitLoop



EndIf

EndIf

EndIf

WEnd

$i = $i + 1
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc
;2B282F
;2B282D

Hi, i'm wondering how i can easily make an array of different mouseclick positions 

i'm making a small program for a game, however i haven't touched autoit in a few years,and now i am stuck.

the code looks like crap, but all i could do at this moment.

what i'm looking for is a table of 7 different positions.

so when it exit loops at my current placeholder Msgbox(1,IKKE FUNNET")

i want it to try the next coordinate in line.

i.e i have 7 coordinates

[X,Y] - [1,1][1,2][1,3] and so on.

starts with coordinate [1,1] if nothing is found, it tries [1,2] until it's done.

Share this post


Link to post
Share on other sites
AndreasNWWWWW

so it runs the program for one loop at one positions, until nothing is found then clicks a different position and runs the loop again

Share this post


Link to post
Share on other sites
JLogan3o13

@AndreasNWWWWW you seem to have walked right by our forum rules on your way in. I suggest you read them now, especially the part on game automation/interaction, and you will see why this topic is locked. You will not receive any help on this subject.

Please also be mindful of this point:

Quote

Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above

Hope to see you again with a legitimate question.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


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

×