Skip to content

Commit

Permalink
Merge pull request #14 from Deatho0ne/master
Browse files Browse the repository at this point in the history
ServerCall - Update
  • Loading branch information
dhusemann authored Jun 4, 2022
2 parents b1ebe16 + 0f0254e commit 4db51f7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions IdleCombos.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2144,15 +2144,19 @@ Hg_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 @@ -2891,4 +2895,4 @@ while (clipContents ~= regexpPattern) {
}
foundCodeString := RegExReplace(foundCodeString, "`r`n$")
return foundCodeString
}
}

0 comments on commit 4db51f7

Please sign in to comment.