Advertisement
cmiN

auto-mass

May 8th, 2012
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.58 KB | None | 0 0
  1. #cs
  2. # Send mass messages through Yahoo! Messenger to IDs from a text file.
  3. # 08.05.2012 cmiN
  4. #ce
  5.  
  6.  
  7. ; constants
  8. Const $MESS = "Yahoo! Messenger" ; messenger window title (default for v11.5)
  9. Const $DLAY = 200 ; delay in miliseconds, for spam protection ... who knows
  10.  
  11.  
  12. Func send_message($id, $message)
  13.     Send($id)
  14.     Send("{Enter}")
  15.     WinWaitActive($id) ; comment this if you're not sure that the target id
  16.     ;Sleep($DLAY) ; have the same alias and of course uncomment this to let the window appear
  17.     Send($message)
  18.     Send("{Enter}")
  19.     Sleep($DLAY)
  20.     Send("{Esc}")
  21. EndFunc
  22.  
  23.  
  24. Func main()
  25.     ; path to message file
  26.     ;$path = "msg.txt"
  27.     $path = InputBox("Input", "Enter path to message file.")
  28.     If $path == "" Then Exit
  29.     $file = FileOpen($path, 0)
  30.     If $file == -1 Then Exit
  31.     $message = FileRead($file)
  32.     FileClose($file)
  33.     ; path to IDs file
  34.     ;$path = "ids.txt"
  35.     $path = InputBox("Input", "Enter path to IDs file.")
  36.     If $path == "" Then Exit
  37.     $file = FileOpen($path, 0)
  38.     If $file == -1 Then Exit
  39.     ; process
  40.     MsgBox(0, "Info", "Sending '" & $message & "' to all IDs." & @LF & "Launch the client and press OK to start!")
  41.     $handle = WinActivate("Yahoo! Messenger") ; make messenger window active
  42.     If Not $handle Then
  43.         MsgBox(16, "Error", $MESS & " window not found.")
  44.         Exit
  45.     EndIf
  46.     While 1
  47.         $line = FileReadLine($file)
  48.         If @error == -1 Then ExitLoop
  49.         send_message($line, $message)
  50.     WEnd
  51.     FileClose($file)
  52.     MsgBox(0, "Info", "Finished.")
  53. EndFunc
  54.  
  55.  
  56. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement