Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 23:38

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



AutoIt. Kann ich das..

Discussion on AutoIt. Kann ich das.. within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2014
Posts: 35
Received Thanks: 1
AutoIt. Kann ich das..

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.
OnlyGood is offline  
Old 08/14/2015, 08:27   #2
 
visualcode's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 55
Received Thanks: 14
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
visualcode is offline  
Old 08/14/2015, 09:09   #3
 
summoner01's Avatar
 
elite*gold: 0
Join Date: Sep 2007
Posts: 500
Received Thanks: 146
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
summoner01 is offline  
Thanks
1 User
Old 08/14/2015, 17:43   #4
 
elite*gold: 0
Join Date: Mar 2010
Posts: 360
Received Thanks: 132
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
Daifoku is offline  
Old 08/20/2015, 23:31   #5
 
WJNeeson's Avatar
 
elite*gold: 1445
Join Date: Sep 2011
Posts: 199
Received Thanks: 177
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.
WJNeeson is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
{AutoIt}wie kann man Start-->ausführen cmd
09/26/2010 - AutoIt - 2 Replies
ich möchte mit autoit bei der cmd etwas reinschreiben geht das mit controlsen? wenn ja könntet ihr mir erklären was man bei den parametern angeben muss mit der Fenster Id und den titel des fensters-->ich kapiere die parameter von controlsend nicht
Kann mir eine helfen(Autoit)
05/20/2010 - AutoIt - 10 Replies
will mir für game ein trainer machen mit autoit was aber net wie man float und text adressen in trainer benutzten kann 4byte ist kein prob
[AutoIt]Wie kann ich mit AutoIt...
08/30/2009 - AutoIt - 4 Replies
Hey @ all, ich habe mal eine Frage: Kann man mit AutoIt, ein Fenster zuweisen? Wenn ich nun zB möchte, der Bot"X" nur auf Fenster "A" läuft aber nicht auf "B", wie kann ich das machen?? Pls kein Spamm, und bitte zu AutoIt posten. (C++ könnt Ihr sonst auch noch dazu posten wenn Ihrs wisst aber bitte in erster Liene auf AutoIt eingehen)!!!



All times are GMT +1. The time now is 23:40.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.