Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tracked = {
- SPBFUT = {
- RIZ4 = {},
- SiZ4 = {}
- },
- SPBOPT = {
- RI95000BL4 = {}
- },
- TQBR = {
- SBER = {},
- VTBR = {}
- }
- }
- stopped = false
- f = nil
- function myLog(entry)
- f:write(os.date())
- f:write(" ")
- if type(entry) == "table" then
- for i = 1, #entry do
- if entry[i] == nil then
- f:write("<nil>")
- else
- f:write(entry[i])
- end
- end
- else
- f:write(entry)
- end
- f:write("\n")
- f:flush()
- end
- function repr(p)
- return p.param_value .. " (" .. p.param_image .. ") [type=" .. p.param_type .. "]"
- end
- function OnInit()
- f = io.open(getScriptPath() .. "\\track-params.txt", "w")
- end
- function OnParam(class_code, sec_code)
- if tracked[class_code] and tracked[class_code][sec_code] then
- local t = tracked[class_code][sec_code]
- for _, param in ipairs({"status", "tradingstatus", "stepprice"}) do
- local r = repr(getParamEx(class_code, sec_code, param))
- if r ~= t[param] then
- myLog({sec_code, "@", class_code, ": ", param, ": ", t[param], " -> ", r})
- t[param] = r
- end
- end
- end
- end
- function OnStop(signal)
- stopped = true
- end
- function main()
- while not stopped do
- sleep(100)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement