#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.8.1
 Author:         EinfachSö

 Script Function:
	Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <ImageSearch.au3>

;Variablen

$lo=0
$ru=0
$set1=0
$q1=0
$q2=0
$w1=1
$x1=0
$y1=0
$x2=0
$y2=0
$x3=0
$x31=0
$x32=0
$x33=0
$x34=0
$y3=0
$y31=0
$y32=0
$y33=0
$y34=0
$x4=0
$x41=0
$x42=0
$x43=0
$x44=0
$y4=0
$y41=0
$y42=0
$y43=0
$y44=0
$x5=0
$x51=0
$x52=0
$x53=0
$x54=0
$y5=0
$y51=0
$y52=0
$y53=0
$y54=0
$x6=0
$x61=0
$x62=0
$x63=0
$x64=0
$y6=0
$y61=0
$y62=0
$y63=0
$y64=0
$x7=0
$x71=0
$x72=0
$x73=0
$x74=0
$y7=0
$y71=0
$y72=0
$y73=0
$y74=0
$x8=0
$x81=0
$x82=0
$x83=0
$x84=0
$y8=0
$y81=0
$y82=0
$y83=0
$y84=0
$x9=0
$y9=0

;Script

HotKeySet( "^{F6}", "start")
HotKeySet( "^{F7}", "pause")
HotKeySet( "^{F8}", "stop")

Func stop()
   Exit
EndFunc

Func pause()
   While 1
	  Sleep(100)
   WEnd
EndFunc

Func start()
   
   While 1
	  
	  Sleep(1000)
	  $minus=_ImageSearch("minus.png", 1, $x1, $y1, 0)
	  
	  If $minus=1 Then
		 
		 Do
			$next=_ImageSearch("next.png", 1, $x2, $y2, 0)
			Sleep(1)
			$q1=$q1 +1
		 Until $next=1 Or $q1=3000
		 
		 If $q1=3000 Then
			MsgBox( 1, "Error", "Es konnte der Button >Weiter Banner laden< nicht gefunden werden. Bot bitte neu starten!")
		 EndIf
		 
		 If $next=1 Then
			MouseClick( "left", $x2, $y2)
		 EndIf
		 
		 $next=0
		 $q1=0
		 
	  ElseIf $minus=0 Then
		 
		 While $w1
			$2000=_ImageSearch("2k.png", $x3, $y3, 0)
			$800=_ImageSearch("800.png", $x4, $y4, 0)
			$900=_ImageSearch("900.png", $x5, $y5, 0)
			$975=_ImageSearch("975.png", $x6, $y6, 0)
			$1125=_ImageSearch("1125.png", $x7, $y7, 0)
			$1400=_ImageSearch("1400.png", $x8, $y8, 0)
			Sleep(100)
			
			If $2000=1 Then
			   $20001=_ImageSearchArea("5sek.png", 1, $x3-36, $y3+21, $x3+88, $y3+53, $x31, $y31, 0)
			   $20002=_ImageSearchArea("20sek.png", 1, $x3-36, $y3+21, $x3+88, $y3+53, $x32, $y32, 0)
			   $20003=_ImageSearchArea("25sek.png", 1, $x3-36, $y3+21, $x3+88, $y3+53, $x33, $y33, 0)
			   $20004=_ImageSearchArea("30sek.png", 1, $x3-36, $y3+21, $x3+88, $y3+53, $x34, $y34, 0)
			   
			   If $20001=1 Or $20002=1 Or $20003=1 Or $20004=1 Then
				  MouseClick( "left", $x3-210, $y3+18)
				  
				  If $20001=1 Then
					 Sleep(9000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $20002=1 Then
					 Sleep (24000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $20003=1 Then
					 Sleep(29000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $20004=1 Then
					 Sleep(34000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  EndIf
				  
				  $20001=0
				  $20002=0
				  $20003=0
				  $20004=0
			   EndIf
			   
			   $2000=0
			EndIf
			
			Sleep(100)
			
			If $800=1 Then
			   $8001=_ImageSearchArea("5sek.png", 1, $x4-36, $y4+21, $x4+88, $y4+53, $x41, $y41, 0)
			   $8002=_ImageSearchArea("20sek.png", 1, $x4-36, $y4+21, $x4+88, $y4+53, $x42, $y42, 0)
			   $8003=_ImageSearchArea("25sek.png", 1, $x4-36, $y4+21, $x4+88, $y4+53, $x43, $y43, 0)
			   $8004=_ImageSearchArea("30sek.png", 1, $x4-36, $y4+21, $x4+88, $y4+53, $x44, $y44, 0)
			   
			   If $8001=1 Or $8002=1 Or $8003=1 Or $8004=1 Then
				  MouseClick( "left", $x4-210, $y4+18)
				  
				  If $8001=1 Then
					 Sleep(9000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $8002=1 Then
					 Sleep (24000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $8003=1 Then
					 Sleep(29000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $8004=1 Then
					 Sleep(34000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  EndIf
				  
				  $8001=0
				  $8002=0
				  $8003=0
				  $8004=0
			   EndIf
			   
			   $800=0
			EndIf
			
			Sleep(100)
			
			If $900=1 Then
			   $9001=_ImageSearchArea("5sek.png", 1, $x5-36, $y5+21, $x5+88, $y5+53, $x51, $y51, 0)
			   $9002=_ImageSearchArea("20sek.png", 1, $x5-36, $y5+21, $x5+88, $y5+53, $x52, $y52, 0)
			   $9003=_ImageSearchArea("25sek.png", 1, $x5-36, $y5+21, $x5+88, $y5+53, $x53, $y53, 0)
			   $9004=_ImageSearchArea("30sek.png", 1, $x5-36, $y5+21, $x5+88, $y5+53, $x54, $y54, 0)
			   
			   If $9001=1 Or $9002=1 Or $9003=1 Or $9004=1 Then
				  MouseClick( "left", $x5-210, $y5+18)
				  
				  If $9001=1 Then
					 Sleep(9000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $9002=1 Then
					 Sleep (24000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $9003=1 Then
					 Sleep(29000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $9004=1 Then
					 Sleep(34000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  EndIf
				  
				  $9001=0
				  $9002=0
				  $9003=0
				  $9004=0
			   EndIf
			   
			   $900=0
			EndIf
			
			Sleep(100)
			
			If $975=1 Then
			   $9751=_ImageSearchArea("5sek.png", 1, $x6-36, $y6+21, $x6+88, $y6+53, $x61, $y61, 0)
			   $9752=_ImageSearchArea("20sek.png", 1, $x6-36, $y6+21, $x6+88, $y6+53, $x62, $y62, 0)
			   $9753=_ImageSearchArea("25sek.png", 1, $x6-36, $y6+21, $x6+88, $y6+53, $x63, $y63, 0)
			   $9754=_ImageSearchArea("30sek.png", 1, $x6-36, $y6+21, $x6+88, $y6+53, $x64, $y64, 0)
			   
			   If $9751=1 Or $9752=1 Or $9753=1 Or $9754=1 Then
				  MouseClick( "left", $x6-210, $y6+18)
				  
				  If $9751=1 Then
					 Sleep(9000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $9752=1 Then
					 Sleep (24000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $9753=1 Then
					 Sleep(29000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $9754=1 Then
					 Sleep(34000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  EndIf
				  
				  $9751=0
				  $9752=0
				  $9753=0
				  $9754=0
			   EndIf
			   
			   $975=0
			   
			EndIf
			
			Sleep(100)
			
			If $1125=1 Then
			   $11251=_ImageSearchArea("5sek.png", 1, $x7-36, $y7+21, $x7+88, $y7+53, $x71, $y71, 0)
			   $11252=_ImageSearchArea("20sek.png", 1, $x7-36, $y7+21, $x7+88, $y7+53, $x72, $y72, 0)
			   $11253=_ImageSearchArea("25sek.png", 1, $x7-36, $y7+21, $x7+88, $y7+53, $x73, $y73, 0)
			   $11254=_ImageSearchArea("30sek.png", 1, $x7-36, $y7+21, $x7+88, $y7+53, $x74, $y74, 0)
			   
			   If $11251=1 Or $11252=1 Or $11253=1 Or $11254=1 Then
				  MouseClick( "left", $x7-210, $y7+18)
				  
				  If $11251=1 Then
					 Sleep(9000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $11252=1 Then
					 Sleep (24000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $11253=1 Then
					 Sleep(29000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $11254=1 Then
					 Sleep(34000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  EndIf
				  
				  $11251=0
				  $11252=0
				  $11253=0
				  $11254=0
			   EndIf
			   
			   $1125=0
			EndIf
			
			Sleep(100)
			
			If $1400=1 Then
			   $14001=_ImageSearchArea("5sek.png", 1, $x8-36, $y8+21, $x8+88, $y8+53, $x81, $y81, 0)
			   $14002=_ImageSearchArea("20sek.png", 1, $x8-36, $y8+21, $x8+88, $y8+53, $x82, $y82, 0)
			   $14003=_ImageSearchArea("25sek.png", 1, $x8-36, $y8+21, $x8+88, $y8+53, $x83, $y83, 0)
			   $14004=_ImageSearchArea("30sek.png", 1, $x8-36, $y8+21, $x8+88, $y8+53, $x84, $y84, 0)
			   
			   If $14001=1 Or $14002=1 Or $14003=1 Or $14004=1 Then
				  MouseClick( "left", $x8-210, $y8+18)
				  
				  If $14001=1 Then
					 Sleep(9000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $14002=1 Then
					 Sleep (24000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $14003=1 Then
					 Sleep(29000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  ElseIf $14004=1 Then
					 Sleep(34000)
					 Send("{CTRLDOWN}")
					 Send("w")
					 Send("{CTRLUP}")
				  EndIf
				  
				  $14001=0
				  $14002=0
				  $14003=0
				  $14004=0
			   EndIf
			   
			   $1400=0
			EndIf
			
			Sleep(100)
			
			If $2000=0 And $800=0 And $900=0 And $975=0 And $1125=0 And $1400=0 Then
			   $w=0
			EndIf
			
		 WEnd
		 
		 $w1=1
		 
		 Do
			$next1=_ImageSearch("next.png", 1, $x9, $y9, 0)
			Sleep(1)
			$q2=$q2 +1
		 Until $next1=1 Or $q2=3000
		 
		 If $q2=3000 Then
			MsgBox( 1, "Error", "Es konnte der Button >Weiter Banner laden< nicht gefunden werden. Bot bitte neu starten!")
		 EndIf
		 
		 If $next1=1 Then
			MouseClick( "left", $x9, $y9)
		 EndIf
		 
		 $next1=0
		 $q2=0
	  EndIf
   WEnd
EndFunc

While 1
   Sleep(100)
WEnd