DebugConsoleInitialize() ; start console window if not yet started
str .= "`n" ; add line feed
DllCall("WriteFile", "uint", h_Stdout, "uint", &str, "uint", StrLen(str), "uint*", BytesWritten, "uint", NULL) ; write into the console
WinSet, Bottom,, ahk_id %h_stout% ; keep console on bottom
}
DebugConsoleInitialize()
{
global h_Stdout ; Handle for console
static is_open = 0 ; toogle whether opened before
if (is_open = 1) ; yes, so don't open again
return
is_open := 1
; two calls to open, no error check (it's debug, so you know what you are doing)
DllCall("AttachConsole", int, -1, int)
DllCall("AllocConsole", int)
dllcall("SetConsoleTitle", "str","Paddy Debug Console") ; Set the name. Example. Probably could use a_scriptname here
h_Stdout := DllCall("GetStdHandle", "int", -11) ; get the handle
WinSet, Bottom,, ahk_id %h_stout% ; make sure it's on the bottom
WinActivate,Lightroom ; Application specific; I need to make sure this application is running in the foreground. YMMV
return
}
;抓取Trade信息
FindTradeInfo(Clip)
{
GuiControlGet, League
mItem := GetNameAndType(clip)
MouseGetPos, Px,Py
if mItem.ItemType = false
{
msgbox, 复制错误
return
}
data := {"query":{"status":{"option":"any"} ,"stats":[{"type":"and","filters":[]}]},"filters":{"trade_filters":{"filters":{"indexed":{"option":"1day"}},"disabled":False}},"sort":{"price":"asc"}}