Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServerCall - Update #14

Merged
merged 1 commit into from
Jun 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions IdleCombos.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2129,15 +2129,19 @@ Lg_Blacksmith:
}

ServerCall(callname, parameters) {
URLtoCall := "http://ps7.idlechampions.com/~idledragons/post.php?call=" callname parameters
;servername from settings, instead of the hard coded value
URLtoCall := "http://" servername ".idlechampions.com/~idledragons/post.php?call=" callname parameters
WR := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WR.SetTimeouts("10000", "10000", "10000", "10000")
;default values on the below in ms, 0 is INF
;from https://docs.microsoft.com/en-us/windows/win32/winhttp/iwinhttprequest-settimeouts
WR.SetTimeouts(0, 60000, 30000, 120000)
Try {
WR.Open("POST", URLtoCall, false)
WR.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
WR.Send()
WR.WaitForResponse(-1)
WR.WaitForResponse()
data := WR.ResponseText
WR.Close()
}
UpdateLogTime()
FileAppend, (%CurrentTime%) Server request: "%callname%"`n, %OutputLogFile%
Expand Down Expand Up @@ -2876,4 +2880,4 @@ while (clipContents ~= regexpPattern) {
}
foundCodeString := RegExReplace(foundCodeString, "`r`n$")
return foundCodeString
}
}