Jump to content

whizter

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by whizter

  1. Hey, thanks for the UDF, good work. But I have problems with a specific json source -> http://data.mtgox.com/api/1/BTCUSD/depth I can't extract the values. First I used the other JSON UDF from Gabriel Boehme and I have exactly the same problems. I get an empty array with ~500 elements when I get into the asks or bids arrays. This is what I'm doing to get the data: Func getArrayFromJson($URI,$reqAuth,$post="") $result = Jsmn_Decode(goxRequest($URI,_Iif($reqAuth>0,getNonce()&$post,""))) $result = Jsmn_ObjTo2DArray($result) If (Not IsArray($result) Or UBound($result) = 0) Then MsgBox(0,"Error: "&$URI,$result) Return 0 Else If(NOT IsArray($result[2][1])) Then MsgBox(0,$URI,$result[2][1]) Return 0 EndIf Return $result[2][1] EndIf EndFunc It works on every other API without problems, just not with this one.
  2. Yes I already thought of that. I have a main loop, but I can't check there because various functions are called from there that take some time to compute (and I want my start/stop button to react immediately), and in that timespan my button wouldn't work then. It would be like using a msgloop. That's the problem, and now I think there's no real solution to it. EDIT: I got an idea now, what about switching GUIOnEventMode on the fly and start a msgloop instead of my waiting loop? Well, I will test this tomorrow, going to bed now.
  3. well, I didn't solve the problem itself but I think this is an acceptable solution, it can be started using the button but it can only be stopped using the hotkey, which is ok for me: Func togglePause() $paused = Not $paused If ($paused) Then GUICtrlSetData($btnStart, "Start: [F8]") GUICtrlSetState ($btnStart,$GUI_ENABLE) EndIf While $paused Sleep(50) WEnd GUICtrlSetData($btnStart, "Stop: [F8]") GUICtrlSetState ($btnStart,$GUI_DISABLE) EndFunc ;==>togglePause
  4. hotkeys are working fine. but it seems like every event is ignored as long as I'm inside the function that the last event called. Is there a solution to this problem?
  5. hi I need some help. I'm trying to get this to work, but everything seems to fail. This is what I have: 1) a button ("Start (F8)") 2) a hotkey ("{F8}") 3) Opt("GUIOnEventMode", 1) I can't use a msg loop cause of blocking functions! HotKeySet("{F8}", "togglePause") $btnStart = GUICtrlCreateButton("Start (F8)", 217, 101, 135, 44, $WS_GROUP) GUICtrlSetFont(-1, 14, 800, 0, "Verdana") GUICtrlSetOnEvent(-1, "togglePause") Func togglePause() $paused = Not $paused If ($paused) Then GUICtrlSetData($btnStart, "Start (F8)") EndIf While $paused Sleep(50) WEnd GUICtrlSetData($btnStart, "Stop (F8)") EndFunc If I click Start/Stop twice then every button stops responding, I can't close the form etc. Using the Hotkey I have no problems. I don't understand why this isn't working, is there a way to get this working without a msgloop?
×
×
  • Create New...