AutoIt. Kann ich das..

08/14/2015 07:15 OnlyGood#1
Kann ich diesen Befehl als "Randombefehl" ausführen also, dass er die Maus in einer der Koordinaten zufällig bewegt?


MouseMove ( 878, 654, 3 [908, 654, 3 [943, 654, 3 [973, 654, 3 [999, 654, 3]]]])


Danke.
08/14/2015 08:27 visualcode#2
Hab mir grade mal die MouseMove() Referenz angeschaut, es sieht so aus, als würde dein Code so nicht funktionieren, aber du könntest jeweils für x und y eine Variable anlegen, diese zufällig mit Zahlen definieren (irgende Random() Funktion) und diese Variablen dann anstelle der x,y Angaben von MouseMove() einfügen.

Aber sag mal bescheid ob dein Code funktioniert, kanns mir nämlich schlecht vorstellen.

Mfg visualcode
08/14/2015 09:09 summoner01#3
Is this what you are looking for? If the mouse is at these coordinates, then it will do something.

Code:
#include <Array.au3>

Global $COORDINATE1[2] = ["878", "654"]
Global $COORDINATE2[2] = ["908", "654"]
Global $COORDINATE3[2] = ["943", "654"]
Global $COORDINATE4[2] = ["973", "654"]
Global $COORDINATE5[2] = ["999", "654"]

While 1

$CUR_POS = MouseGetPos()

	Select

		Case $CUR_POS[0] = $COORDINATE1[0] And $CUR_POS[1] = $COORDINATE1[1]

			MsgBox(0, " ", $CUR_POS[0] & ", " & $CUR_POS[1])

		Case $CUR_POS[0] = $COORDINATE2[0] And $CUR_POS[1] = $COORDINATE2[1]

			MsgBox(0, " ", $CUR_POS[0] & ", " & $CUR_POS[1])

		Case $CUR_POS[0] = $COORDINATE3[0] And $CUR_POS[1] = $COORDINATE3[1]

			MsgBox(0, " ", $CUR_POS[0] & ", " & $CUR_POS[1])

		Case $CUR_POS[0] = $COORDINATE4[0] And $CUR_POS[1] = $COORDINATE4[1]

			MsgBox(0, " ", $CUR_POS[0] & ", " & $CUR_POS[1])

		Case $CUR_POS[0] = $COORDINATE5[0] And $CUR_POS[1] = $COORDINATE5[1]

			MsgBox(0, " ", $CUR_POS[0] & ", " & $CUR_POS[1])

	EndSelect
WEnd
08/14/2015 17:43 Daifoku#4
Quote:
Originally Posted by summoner01 View Post
Is this what you are looking for? If the mouse is at these coordinates, then it will do something.
nice effort but he only wants to randomly move the mouse to some given coordinates.

Putting all coordinates into an array and using _ArrayShuffle should be fine for his use [Only registered and activated users can see links. Click Here To Register...]
08/20/2015 23:31 WJNeeson#5
Möglichkeit 1 mit der _ArrayShuffle Funktion (benötigt allerdings die inkludierte Array.au3)

Code:
#include <Array.au3>

Global $xy[5][2] = [[878, 654], [908, 654], [943, 654], [973, 654], [999, 654]]

_ArrayShuffle($xy)

$x = $xy[0][0]
$y = $xy[0][1]
In dem Fall kannst du die 2D Array natürlich weglassen und eine 1D Array verwenden, da die y Koordinaten immer dieselben sind, vielleicht möchtest du das auch irgendwann nochmal ändern, deshalb hab ichs so gelassen.

_ArrayShuffle wirft einfach deine Array einmal durcheinander und du nimmst dann mit $xy[0][0] und $xy[0][1] das erste Paket aus deiner Array.


gibt natürlich noch Möglichkeit 2, mit der Random Funktion

Code:
$random = Floor(Random(0, 5))

Global $xy[5][2] = [[878, 654], [908, 654], [943, 654], [973, 654], [999, 654]]

$x = $xy[$random][0]
$y = $xy[$random][1]
dabei wird einfach ein Zahlenwert zwischen 0 und 5 rausgeworfen, welcher immer abgerundet wird (erhälst also nur 0-4) und nimmt anschließend einen Wert entsprechend der zufällig generierten Zahl aus deiner Array.