CODICE
Func StartButton()
Global $carctrlname[5] = [GUICtrlRead($car1),GUICtrlRead($car2),GUICtrlRead($car3),GUICtrlRead($car4)]
Local $h = 5
If GUICtrlRead($car5) = "Inserisci il quinto annuncio" Then
$h= $h-1
EndIf
If GUICtrlRead($car4) = "Inserisci il quarto annuncio" Then
$h= $h-1
EndIf
If GUICtrlRead($car3) = "Inserisci il terzo annuncio" Then
$h= $h-1
EndIf
If GUICtrlRead($car2) = "Inserisci il secondo annuncio" Then
$h= $h-1
EndIf
If GUICtrlRead($car1) = "Inserisci il primo annuncio" Then
MsgBox($MB_SYSTEMMODAL,"","INSERISCI ALMENO UN ANNUNCIO")
GUISetState(@SW_HIDE,$RunGui)
Exit
EndIf
For $i = 1 to $h
Local $m[17]
_FileReadToArray("C:\Users\" & @UserName & "\Dropbox\Programmi\Autoannunci\AutAnn\Data\" & $carctrlname[$i - 1] & ".txt",$m)
$chrome=WinActivate("[Class:Chrome_WidgetWin_1]")
$height=@DesktopHeight
$width=@DesktopWidth
;START
MouseClick("left",861 ,428)
;Auto
Send("{Tab}")
sleep(500)
send($m[17])
send("{enter}")
sleep(7000)
;Marca
Send("{Tab 3}")
sleep(500)
send($m[1])
sleep(4000)
;modello
Send("{Tab}")
sleep(250)
send($m[2])
sleep(1000)
;anno
Send("{Tab}")
sleep(500)
send($m[3])
sleep(500)
;Immagini
MouseClick("left",686,621)
sleep(2000)
send("C:\Users\")
send(@UserName)
send("\Dropbox\Auto")
sleep(250)
send("{enter}")
sleep(500)
send($m[16])
sleep(250)
send("{enter}")
sleep(250)
send('"c1""c2""c3""c4""c5"')
sleep(700)
send("{enter}")
;titolo-descrizione-prezzo
sleep(1000)
Send("{Tab}")
sleep(1000)
send($m[4])
sleep(500)
;descrizione
Send("{Tab}")
Send("{LCTRL A}")
sleep(500)
send($m[5])
send("{enter}")
send("Per maggiori informazioni chiamare a")
send("{enter}")
send("Stefano")
send("{enter}")
send("3332346211")
send("{enter}")
send("Danilo")
send("{enter}")
send("3927923928")
sleep(500)
;prezzo
Send("{Tab}")
sleep(1000)
send($m[6])
;km,com,allest,carb,tipo,cambio,class
Send("{Tab}")
sleep(500)
send($m[7])
sleep(500)
;cilindrata
If $m[17]="moto" Then
Send("{Tab}")
send($m[18])
EndIf
;comune
Send("{Tab}")
If $h=0 Or $h=2 Or $h=4 Then
send("Pesaro(PU)")
EndIf
If $h=1 Or $h=3 Or $h=5 Then
send("Rimini (RN)")
EndIf
sleep(1000)
;allestimento
Send("{Tab 2}")
sleep(500)
send($m[8])
sleep(500)
;carburante
If $m[17]="Auto" Then
Send("{Tab}")
sleep(500)
send($m[9])
sleep(500)
;tipologia
Send("{Tab}")
sleep(500)
send($m[10])
sleep(500)
;cambio
Send("{Tab}")
sleep(500)
send($m[11])
sleep(500)
;emissioni,post,porte,colore
Send("{Tab}")
send($m[12])
sleep(500)
;posti
Send("{Tab}")
send($m[13])
sleep(500)
;porte
Send("{Tab}")
send($m[14])
sleep(500)
;colore
Send("{Tab}")
send($m[15])
sleep(500)
EndIf
;user,pass
Send("{Tab 2}")
send($user[3])
sleep(100)
;telefono
Send("{Tab}")
send($user[4])
Send("{Tab}")
;close
If ($width=1024) Then
If ($height=768) Then
MouseClick("left",408,705)
Send("{Tab 3}")
MouseClick("left",502,409)
sleep(15000)
;down
MouseClick("left",1015,697)
MouseClick("left",1015,697)
MouseClick("left",1015,697)
sleep(1000)
MouseClick("left",843,347)
EndIf
EndIf
If ($width=1280) Then
If ($height=800) Then
MouseClick("left",538,520)
MouseClick("left",634,637)
sleep(20000)
;down
MouseClick("left",1272,724)
MouseClick("left",1272,724)
MouseClick("left",984,516)
sleep(2000)
MouseClick("left",984,153)
EndIf
EndIf
Sleep(20000)
Next
EndFunc