0
Вклад в тег
#include <AutoItConstants.au3>
$aPos = MouseGetPos()
MsgBox(4096, "Ask", 'go?')
; Режимы
$full = "{1}"
$window = "{2}"
$block = "{3}"
;сохранение позиций
$c_save1 = "{5}"
$c_save2 = "{6}"
; Запуск
$run = "{0}"
$run_trn = "{9}"
; Имя програмы
$program_name_1 = "Безымянный – Блокнот"
$program_name_2 = "Безымянный – Блокнот"
Global $pose_mouse[4]
Global $program
Global $mouse_pos1
Global $mouse_pos2
;Имя окна
Global $name_phone = 'Дистанционное управление'
;Скорость мыши
Global $speed_mouse = 7
;Скорость паузы
Global $speed_programs = 5000
;Комбинаций
Global $ctrl_x = "^x"
Global $ctrl_c = "^c"
Global $ctrl_v = "^v"
Global $ctrl_a = "^a"
Global $ctrl_s = "^s"
;Имя окна переводчика
Global $name_translater_win = "Google Переводчик - Opera"
Global $way_cut = "C:\WINDOWS\system32\SnippingTool.exe"
Global $cut_name = "Ножницы"
Global $save_wind = "[CLASS:#32770]"
Global $copy_wind = "Копирование файла"
Global $foldew_win1 = "scrn"
Global $foldew_win2 = "DCIM"
; Проверка существования окна
;If Not WinExists($foldew_win1) And WinExists($foldew_win2 ) And WinExists($name_translater_win) And WinExists($name_phone) Then
$f = WinExists($foldew_win1) + WinExists($foldew_win2 ) + WinExists($name_translater_win) + WinExists($name_phone)
If $f >= 4 Then
MsgBox(4096, "", "Окно существует - " & $f)
Else
MsgBox(4096, "", "Окно не существует - " & $f)
Exit
EndIf
HotKeySet($full, "full_fun")
Func full_fun()
$pose_mouse[0] = 0
$pose_mouse[1] = 0
$pose_mouse[2] = 9999
$pose_mouse[3] = 9999
EndFunc
HotKeySet($window, "window_fun")
Func window_fun()
$program = WinGetPos($program_name_1)
$pose_mouse[0] = $program[0]
$pose_mouse[1] = $program[1]
$pose_mouse[2] = $program[0] + $program[2]
$pose_mouse[3] = $program[1] + $program[3]
EndFunc
HotKeySet($block, "block_fun")
Func block_fun()
$program = WinGetPos($program_name_2)
$pose_mouse[0] = $program[0]
$pose_mouse[1] = $program[1]
$pose_mouse[2] = $program[0] + $program[2]
$pose_mouse[3] = $program[1] + $program[3]
EndFunc
HotKeySet($c_save1, "c_save1_fun")
Func c_save1_fun()
$mouse_pos1 = MouseGetPos()
$pose_mouse[0] = $mouse_pos1[0]
$pose_mouse[1] = $mouse_pos1[1]
EndFunc
HotKeySet($c_save2, "c_save2_fun")
Func c_save2_fun()
$mouse_pos2 = MouseGetPos()
$pose_mouse[2] = $mouse_pos2[0]
$pose_mouse[3] = $mouse_pos2[1]
EndFunc
HotKeySet($run, "run_fun")
Func run_fun()
Run($way_cut)
WinWaitActive($cut_name)
local $creen = WinGetPos($cut_name)
MouseClick("left", $creen[0] + 10, $creen[1] + 40, 1, 0)
Sleep(1000)
;Окно выбора
MouseMove($pose_mouse[0], $pose_mouse[1],0)
MouseDown ( $MOUSE_CLICK_LEFT )
MouseMove($pose_mouse[2], $pose_mouse[3],0)
MouseUp ( $MOUSE_CLICK_LEFT )
;Сохранить файл
Send($ctrl_s)
WinWaitActive($save_wind)
WinActivate($save_wind)
Send("{ENTER}")
Sleep(1000)
Send("{LEFT}{ENTER}")
Sleep(1000)
WinClose ($cut_name)
;Перекинуть ИЗ папки scrn
Local $hWnd = WinWait($foldew_win1, "", 10)
WinActivate($hWnd)
Sleep(1000)
ControlSend($hWnd, "", "[CLASS:DirectUIHWND;INSTANCE:2]", $ctrl_a)
Sleep(1000)
ControlSend($hWnd, "", "[CLASS:DirectUIHWND;INSTANCE:2]", $ctrl_c)
;Вставить В папку DCIM
Local $hWnd = WinWait($foldew_win2, "", 10)
Sleep(1000)
WinActivate($hWnd)
ControlSend($hWnd, "", "[CLASS:DirectUIHWND;INSTANCE:2]", $ctrl_v)
WinWaitActive($copy_wind )
Sleep(1000)
ControlSend($copy_wind , "", "", "{UP 2}{ENTER}")
EndFunc
;Запустить переводчик
HotKeySet($run_trn, "trans_fun")
Func trans_fun()
WinActivate($name_phone)
WinWaitActive($name_phone )
$transl = WinGetPos($name_phone)
;Активировать окно
MouseClick("left", $transl[0] + $transl[2] / 1.35, $transl[1] + $transl[3] / 1.25 , 2, $speed_mouse)
Sleep(5000)
MouseClick("left", $transl[0] + $transl[2] / 1.35, $transl[1] + $transl[3] / 1.25 , 2, $speed_mouse)
Sleep(1000)
;Поиск картиник
MouseClick("left", $transl[0] + $transl[2] / 4.5, $transl[1] + $transl[3] / 1.12 , 2, $speed_mouse)
Sleep(1000)
;Выбор
MouseClick("left", $transl[0] + $transl[2] / 2, $transl[1] + $transl[3] / 2 , 2, $speed_mouse)
Sleep(1000)
MouseClick("left", $transl[0] + $transl[2] / 2, $transl[1] + $transl[3] / 2 , 2, $speed_mouse)
Sleep(5000)
;Выбрать весь текст
MouseClick("left", $transl[0] + $transl[2] / 2, $transl[1] + $transl[3] / 1.12 , 2, $speed_mouse)
Sleep(1000)
;Выбрать текст
MouseClick("left", $transl[0] + $transl[2] / 8, $transl[1] + $transl[3] / 6 , 1, $speed_mouse)
Sleep(1000)
;Копировать текст
Send($ctrl_a)
Sleep(1000)
Send($ctrl_a)
Sleep(1000)
Send($ctrl_x)
Sleep(1000)
;Выйти
MouseClick("left", $transl[0] + $transl[2] / 9, $transl[1] + $transl[3] / 9, 2, $speed_mouse)
Sleep(1000)
;Скрыть лишнее меню
MouseClick("left", $transl[0] + $transl[2] / 2.8, $transl[1] + $transl[3] / 1.045, 2, $speed_mouse)
Sleep(1000)
;Скрыть лишнее меню
WinActivate($name_translater_win)
WinWaitActive($name_translater_win)
ControlSend($name_translater_win, "", "", $ctrl_a)
ControlSend($name_translater_win, "", "", $ctrl_v)
EndFunc
while 1
; Sleep(100)
WEnd