Code: Select all
#NoEnv
SetWorkingDir %A_ScriptDir%
CoordMode, Mouse, Window
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
#WinActivateForce
SetControlDelay 0
SetWinDelay 0
SetKeyDelay 0
SetMouseDelay 0
SetBatchLines -1
; These global variables make it easier to change things like directory locations
DupaTxt = C:\Users\dellpcwik9\Desktop\dupa.txt
Dupa2Txt = C:\Users\dellpcwik9\Desktop\dupa2.txt
Dupa2Bat = C:\Users\dellpcwik9\Desktop\dupa2.bat
F2::
Click, 1121, 366 Left, ,
Click, 1121, 366 Left, , ; here will mark a number at first
Click, 1121, 366 Left, ,
Sleep, 50
send ^c ; send i to clipboard
Sleep, 20
If clipboard contains +49,0049,+49 , 0049 ,+32,0032,+32 ,0032 ,+33,0033,+33 ,0033 ,+352,00352,+352 ,00352 ,+41,0041,+41 ,0041 ,0039 ,+39,0039,+39 ,+31,0031,+31 ,0031 ,+43,0043,+43 ,0043 ,+44,0044,+44 ,0044 ,+420,00420,+420 ,00420 ,+45,0045,+45 ,0045 ,+47,0047,+47 ,0047 ,+352,00352,+352 ,00352 ,
Send !^s ;if number will contain the above-metioned numbers then will call imidiately by "frecall using number from clipboard
else
{
FileDelete, %DupaTxt%
Fileappend, %Clipboard%, %DupaTxt% ; if dont have 0049/+49 etc...will copy number to doc.txt and deleting spacebars if are
file := FileOpen(DupaTxt, "r")
Haystack := file.Read()
file.Close()
Searchtext := A_Space
ReplaceText := "-"
NewNumber := StrReplace(Haystack, Searchtext, ReplaceText)
FileDelete, %DupaTxt%
Fileappend, %NewNumber%, %DupaTxt%
Sleep, 20
Sleep, 50
Click, 335, 349 Left, , ;here will mark country for example "DE"
Click, 335, 349 Left, ,
Sleep, 50
send ^c ; here will add country to clipboard
Sleep, 50
If clipboard contains DE, DE ,
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:0049, %DupaTxt% ;here will add number and directional of number
Goto, DoCall
}
If clipboard contains AT, AT ,
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:0043, %DupaTxt%
Goto, DoCall
}
If clipboard contains CZ, CZ ,
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:00420, %DupaTxt%
Goto, DoCall
}
If clipboard contains FR, FR ,
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:0033, %DupaTxt%
Goto, DoCall
}
If clipboard contains NL, NL ,
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:0031, %DupaTxt%
Goto, DoCall
}
If clipboard contains BE
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:0032, %DupaTxt%
Goto, DoCall
}
If clipboard contains GB
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:0044, %DupaTxt%
Goto, DoCall
}
If clipboard contains DK
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:0045, %DupaTxt%
Goto, DoCall
}
If clipboard contains IT
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:0039, %DupaTxt%
Goto, DoCall
}
If clipboard contains LU
{
FileAppend, `n, %DupaTxt%
FileAppend, start "C:\Program Files (x86)\FreeCall.com\FreeCall\FreeCall.exe" Callto:00352, %DupaTxt%
Goto, DoCall
}
If clipboard contains HU, HU ,
Goto, DontCall
If clipboard contains BG, BG , ;change side will not call
Goto, DontCall
If clipboard contains RO
Goto, DontCall
If clipboard contains SI
Goto, DontCall
If clipboard contains LV
Goto, DontCall
If clipboard contains RS
Goto, DontCall
If clipboard contains SK
Goto, DontCall
If clipboard contains HR
Goto, DontCall
If clipboard contains BA
Goto, DontCall
If clipboard contains MD
Goto, DontCall
If clipboard contains PT
Goto, DontCall
}
return
DontCall:
Click, 172, 229,
Sleep, 1000
Click, 356, 290,
return
DoCall:
FileDelete, %Dupa2Bat%
FileReadLine, r1, %DupaTxt%, 1
FileReadLine, r2, %DupaTxt%, 2
StringTrimLeft, r1, r1, 1
ifnotexist, %Dupa2Txt%
{
Fileappend, %r2%%r1%, %Dupa2Txt%
FileMove, %Dupa2Txt%, %Dupa2Bat%
run, %Dupa2Bat%
}
return
In any case, see if the cleaned up code still has the problem you are describing and get back to me.