SingleInstance force HTTP ComObjCreate WinHTTP WinHTTPRequest Loop If

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#SingleInstance force
HTTP := ComObjCreate("WinHTTP.WinHTTPRequest.5.1")
Loop,
If (GetKeyState("sc1B", "P"))
{
SendInput, ^{sc1E}
Sleep, 50
SendInput, ^{sc2E}
RegExMatch(Clipboard, "tr\[([А-я]+)\]", o)
Break
}
HTTP.Open("GET", "https://api.multillect.com/translate/json/1.0/1000?method=translate/api/translate&from=ru&to=en&text=" o1 "&sig=b814524f1706670a31f762ac2e5b8d80")
HTTP.Send()
MsgBox, % Clipboard
MsgBox, % HTTP.ResponseText