Jump to content
mandeamarian

{AutoIt} Auto Dialer

Recommended Posts

HotKeySet("{F9}", "Terminate") ; daca apesi pe F9, se opreste scriptul... sau cel putin ar trebui

;Schimba Optiunile aici!
;-------------------------------------------------------------
;Numarele la care formezi, separate de un spatiu.
;Ex: "1234 4567 7890" etc.
Global $numbers = "012263913792983"

;De cate ori sa formez numarele intr-un ciclu
Global $cycles = 10

;Timpul de asteptare intre formari, intr-un ciclu, in secunde
Global $dialtime = 3

;Cat timp sa astept intre ciclurile de formare, in secunde
Global $waittime = 600

;Bagam PIN? 0 = nu, 1 = da
Global $inputpin = 0

;Numar PIN? In format: 1 = {NUMPAD1}, 2 = {NUMPAD2} etc.
;De exemplu, pentru PIN 1234: {NUMPAD1}{NUMPAD2}{NUMPAD3}{NUMPAD4}
Global $pin = "{NUMPAD1}{NUMPAD2}{NUMPAD3}{NUMPAD4}"

;Ce facem dupa ciclul de formare? 0 = nimic, 1 = ascundem zoiper, 2 = omoaram zoiper
Global $dosomething = 0

;Unde sa scriu informatiile?
;Ex: 0 cu 0 == colt stanga sus
Global $tipx = 0
Global $tipy = 150
;-------------------------------------------------------------
;NU MAI EDITA DE AICI!

Func SleepTime($seconds)
for $i = $seconds to 0 step -1
$displaymessage = "Sleeping " & $i & " seconds"
$displaytitle = "Dialing " & $numbers
ToolTip($displaymessage, $tipx, $tipy, $displaytitle, 1, 5)
Sleep(1000)
Next
Return True
EndFunc

Func DialNumber($numbertodial)
;WinSetState("Zoiper", "", @SW_DISABLE)
ControlClick("Zoiper", "", "[CLASS:Edit; INSTANCE:1]")
ControlSetText("Zoiper", "", "[CLASS:Edit; INSTANCE:1]", $numbertodial)
ControlSend("Zoiper", "", "[CLASS:Edit; INSTANCE:1]", "{enter}")
;WinSetState("Zoiper", "", @SW_ENABLE)

If $inputpin = 1 Then
Sleep(4000)
WinActivate("Zoiper")
Opt("SendKeyDelay", 250)
Send($pin)
Send("^+3")
Opt("SendKeyDelay", 5)
EndIf

$waitcycle = $dialtime * 1000
Sleep($waitcycle)
EndFunc

Global $arr = StringSplit($numbers, " ")

$var=1

While $var=1 ; Infinite Loop

If ProcessExists("Zoiper.exe") Then
ToolTip("Zoiper exists!", $tipx, $tipy, "Checking for Zoiper", 1, 5)
Else
ToolTip("Zoiper is closed. Running...", $tipx, $tipy, "Checking for Zoiper", 3, 5)
Run(@ProgramFilesDir & "\Zoiper Communicator\Zoiper.exe")
ToolTip("Waiting for the process to be active", $tipx, $tipy, "Checking for Zoiper", 2, 5)
ProcessWait("Zoiper.exe")
WinActivate("Zoiper")
WinWaitActive("Zoiper")
EndIf

For $c = 1 to $cycles
;---------------------------------------------------------------------------

If $dosomething = 1 Then
WinSetState("Zoiper", "", @SW_SHOW)
EndIf

If IsArray($arr) Then
$iMax = UBound($arr)
For $i = 1 to $iMax - 1

$displaytext = "Cycle #" & $c & " out of " & $cycles
$displaytitle = "Dialing " & $arr[$i]
ToolTip($displaytext, $tipx, $tipy, $displaytitle, 2, 5)

DialNumber($arr[$i])

Next
Endif

;---------------------------------------------------------------------------
Next

If $dosomething = 2 Then
ToolTip("Sending the kill...", $tipx, $tipy, "Killing Zoiper", 3, 5)
ProcessClose("Zoiper.exe")
ToolTip("Waiting for it to dead...", $tipx, $tipy, "Killing Zoiper", 3, 5)
ProcessWaitClose("Zoiper.exe", 10)
ElseIf $dosomething = 1 Then
ToolTip("Hiding!.", $tipx, $tipy, "Hiding Zoiper", 3, 5)
WinSetState("Zoiper", "", @SW_HIDE)
EndIf

SleepTime($waittime)
Wend

sursa : HotKeySet("{F9}", "Terminate") ; daca apesi pe F9, se opreste scriptul... sau ce - Pastebin.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...