Et cela sera lancer sur mon serveur un fois par jour je le ferais probablement a l'aide d'un Scheduler
Voila je suis assez novice en programmation et j'aurais besoin de conseille ou d'un rappel d'oublie
Le scripte fonctionne mais je crois que visuellement c'est pas trop ça
Et j'avoue avoir fait du copie coller d'autre scripte trouver sur internet.
Code : Tout sélectionner
Global $site = ""
Global $copy = ""
Global $try = ""
ClipPut("") ;Clear the clipboard, so we can check for data when we write to it
Global $textcheck = "" ;We'll put new clipboard data in this variable
Global $Paused
HotKeySet("{ESC}", "Terminate")
Func _WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc
Func Terminate()
Exit 0
EndFunc
Func Site()
ShellExecute("chrome.exe", "http://xxxxxxxxx1","","")
;~ ShellExecute("chrome.exe", "http://xxxxxxxxx2","","")
_WinWaitActivate("[CLASS:Chrome_WidgetWin_1]","", 5)
Sleep(5000)
WinSetState("[CLASS:Chrome_WidgetWin_1]", "",@SW_MAXIMIZE)
EndFunc
Func PUB()
While WinExists("Oops! Google Chrome could not find xxxxxxxxx1 - Google Chrome","") or WinExists("Oops! Google Chrome could not find xxxxxxxxx2 - Google Chrome","") or WinExists("Félicitations! - Google Chrome","") or WinExists("AdF.ly - shrink your URLs and get paid! - Google Chrome") or WinExists("LinkBucks.com - Get your share! - Google Chrome","") or WinExists("AdFly - The URL shortener service that pays you! Earn money for every visitor to your links. - Google Chrome","")
If WinExists("Oops! Google Chrome could not find xxxxxxxxx1 - Google Chrome","") or WinExists("Oops! Google Chrome could not find xxxxxxxxx2 - Google Chrome","") Then
MouseClick("left",81,48,1) ;Refresh
Sleep(5000)
$try += 1
EndIf
if WinExists("Félicitations! - Google Chrome","") then
MouseClick("left",1663,12,1)
Sleep(5000)
$try += 1
EndIf
if WinExists("AdF.ly - shrink your URLs and get paid! - Google Chrome") then
Sleep(7500)
MouseClick("left",1546,100,1) ;Skip Adf.ly
Sleep(5000)
$try += 1
EndIf
If WinExists("LinkBucks.com - Get your share! - Google Chrome","") Then
Sleep(6500)
MouseClick("left",1627,90,1) ;Skip LinkBucks.com
Sleep(5000)
$try += 1
EndIf
If WinExists("AdFly - The URL shortener service that pays you! Earn money for every visitor to your links. - Google Chrome","") Then
MouseClick("left",127,20,1) ;Click first tab
$try += 1
EndIf
if $try = 5 Then ;if 5 trys relaunch site
Site()
EndIf
WEnd
EndFunc
Func copy_check()
;Get window title, in case we need it
$window_title = WinGetTitle("[active]")
if $window_title == "" Then
SoundPlay(@WindowsDir & "\media\Windows XP Error.wav",1)
Exit
EndIf
WinActivate($window_title)
ClipPut("") ;Clear the clipboard, so we can check for data when we write to it
$readtext = "" ;We'll put new clipboard data in this variable
For $i = 1 to 8 Step 1
$rand = random (1, 4, 1)
Send ("{CTRLDOWN}")
;Try various methods until we get text on the clipboard
Switch $rand
Case 1
Send("{INS}")
Case 2
ControlSend($window_title, "", "", "{INS}")
Case 3
Send("c")
Case 4
ControlSend($window_title, "", "", "c^")
EndSwitch
Send ("{CTRLUP}")
$readtext = ClipGet() ;Any text on the clipboard?
If $readtext <> "" Then
Sleep(ToolTip('Text copied with success', 780, 480, '', Default, Default)*0+1000)
return $readtext
EndIf
If $i = 4 Then
WinActivate($window_title)
Sleep(100)
EndIf
Next
return $readtext
EndFunc
Site()
PUB()
If WinExists("xxxxxxxxx1 - Google Chrome") or WinExists("xxxxxxxxx2 - Google Chrome") then
While 1
Sleep(50)
MouseClick("left",116,263,1) ;Click on page to check Ads
PUB()
If WinExists("xxxxxxxxx1 - Google Chrome") then
Sleep(2000)
PUB()
Sleep(1500)
PUB()
Sleep(1000)
PUB()
WinWaitActive("xxxxxxxxx1 - Google Chrome")
Local $site = "xxxxxxxxx1"
ElseIf WinExists("xxxxxxxxx2 - Google Chrome") then
Sleep(2000)
PUB()
Sleep(1500)
PUB()
Sleep(1000)
PUB()
WinWaitActive("xxxxxxxxx2 - Google Chrome")
Local $site = "xxxxxxxxx2"
EndIf
If WinExists("xxxxxxxxx1 - Google Chrome") or WinExists("xxxxxxxxx2 - Google Chrome") then
Sleep(3500)
MouseClick("left",838,504,1) ;Click 1
MouseClick("left",855,580,1) ;Click Entre
Sleep(3000)
MouseClickDrag ("left",1051,555,628,555) ;Select Text to copy
copy_check()
Local $copy = "paste"
EndIf
$textcheck = ClipGet()
If $textcheck <> "" Then ExitLoop
WEnd
EndIf
if $copy = "paste" Then
WinSetState("[CLASS:Chrome_WidgetWin_1]", "",@SW_MINIMIZE) ;Minimize Chrome
Sleep(50)
ShellExecute("prog.exe")
Sleep(50)
WinActivate("prog")
_WinWaitActivate("prog", "")
Sleep(50)
WinMove("prog", "", 0, 0)
Sleep(50)
ControlClick ( "prog", "", "[CLASS:TbsSkinButton; INSTANCE:2]" ) ;Click Edit
if $site = "xxxxxxxxx1" Then
MouseClickDrag("left",601,442,333,443) ;Select "xxxxxxxxx1" Text to paste
ElseIf $site = "xxxxxxxxx2" Then
MouseClickDrag("left",665,483,307,481) ;Select "xxxxxxxxx2" Text to paste
EndIf
Send("^v")
ControlClick ( "prog", "", "[CLASS:TbsSkinButton; INSTANCE:5]" ) ;Click Save
Sleep(50)
_WinWaitActivate("prog","")
ControlClick ( "prog", "", "[CLASS:TButton; INSTANCE:1]" ) ;Click OK
_WinWaitActivate("prog","")
ControlClick ( "prog", "", "[CLASS:TbsSkinButton; INSTANCE:4]" ) ;Click Exit
Sleep(ToolTip('New Text was put in prog', 780, 480, '', Default, Default)*0+1000)
EndIf

