Wenn erste if Anweisung übereinstimmt dann abbrechen Topic is solved

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

songoku
Posts: 73
Joined: 12 Apr 2018, 13:22

Wenn erste if Anweisung übereinstimmt dann abbrechen

23 Oct 2018, 16:54

Guten Abend,
habe ein If-Anweisung, wenn der erste Anweisung übereinstimmt, dann sollen die anderen nicht mehr geprüft werden.
vielen Dank und Grüße

Code: Select all

F4::
CoordMode, Mouse , Client
MouseMove, 1255, 456
Sleep, 2000

	CoordMode, Pixel , Client
	PixelGetColor, foundColor, 762, 292, Fast RGB
	if (foundColor = 0xFF0000)
	{
	Click, right, 1053, 535
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild1url = %clipboard%
	msgbox, % bild1url
	}	

	PixelGetColor, foundColor, 846, 292, Fast RGB
	if (foundColor = 0xFF0000)
	{
	Click, right, 1053, 535
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild1url = %clipboard%
	sleep, 100

	Click, 772, 316
	sleep, 1500
	Click, right, 1053, 535
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild2url = %clipboard%
	msgbox, %bild1url% `r`n %bild2url% 
	}

	else
	{
	Click, right, 1053, 535
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild1url = %clipboard%
	sleep, 100

	Click, 772, 316
	sleep, 1500
	Click, right, 1053, 535
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild2url = %clipboard%
	sleep, 200

	Click, 863, 323
	sleep, 1500
	Click, right, 1053, 535
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild3url = %clipboard%

	
	msgbox, %bild1url% `r`n %bild2url% `r`n %bild3url%
	}



^+r::
reload
User avatar
LuckyJoe
Posts: 341
Joined: 02 Oct 2013, 09:52

Re: Wenn erste if Anweisung übereinstimmt dann abbrechen  Topic is solved

23 Oct 2018, 23:50

... meinst du so?:

Code: Select all

PixelGetColor, foundColor, 762, 292, Fast RGB
if (foundColor = 0xFF0000)
	{
	...
	}
else
	{
	PixelGetColor, foundColor, 846, 292, Fast RGB
	if (foundColor = 0xFF0000)
		{
		...
		}
		else
		{
		...
		}
Ansonsten: Exit oder ExitApp.
Herzliche Grüße aus dem Rheinland
Lucky Joe
songoku
Posts: 73
Joined: 12 Apr 2018, 13:22

Re: Wenn erste if Anweisung übereinstimmt dann abbrechen

24 Oct 2018, 18:29

vielen Dank,

Ich habe mir gestern so weiter geholfen, aber deine Methode ist professioneller. Daher, nehme ich dein Code :)


Code: Select all

CoordMode, Pixel, Client 
CoordMode, Mouse, Client

F4::

MouseMove, 684, 354
Sleep, 2000


	PixelGetColor, foundColor, 447, 196, Fast RGB
	if (foundColor = 0xFF0000)
	{
	Click, right, 730, 387
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	msgbox, % Clipboard
	goto, exit
	}	

	PixelGetColor, foundColor, 565, 212, Fast RGB
	if (foundColor = 0xFF0000)
	{



	Click, right, 730, 387
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild1 = %clipboard%
	sleep, 100^

	Click, 482, 213
	sleep, 3500
	Click, right, 730, 387
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild2 = %clipboard%
	msgbox, %bild1% `r`n %bild2% 
	}

	else
	{


	Click, right, 730, 387
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild1 = %clipboard%
	sleep, 100
	Click, 482, 213
	sleep, 3500
	Click, right, 730, 387
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild2 = %clipboard%
	sleep, 200

	Click, 562, 212
	sleep, 3500
	Click, right, 730, 387
	sleep, 200
	SendInput, d
	ClipWait, 2
	sleep, 200
	bild3 = %clipboard%

	
	msgbox, %bild1% `r`n %bild2% `r`n %bild3%
	}

exit:

Return to “Ich brauche Hilfe”

Who is online

Users browsing this forum: No registered users and 115 guests