yucatan Posted February 2, 2009 Posted February 2, 2009 expandcollapse popupfunc stream() GUICreate ("****"&$version, 600,200,250,200) GUICtrlCreateLabel ("Click on the Select button if u are recording ingame and u wanne upload your video to the **** server then ut become "&@CRLF&"availble for other to folow u" , 20, 20, 1000) $Button_1 = GUICtrlCreateButton("Select Demo to stream", 10, 60, 100) $Button_2 = GUICtrlCreateButton("Stop Streaming", 300, 60, 100) GUISetState(@SW_SHOW) while $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() select case $msg = $button_1 $test = "1" case $msg = $Button_2 $test = "0" EndSelect if $test = "1" then if $sfile = "" then $sfile = FileOpenDialog("Select a Cod2 Demo", @ProgramFilesDir & "\activision\Call of Duty 2\main\demos\", "Images (*.dm_1)", 1 + 4 ) $iFileOp = FileOpen($sFile, 16) ;file is open start reading size if $read1 = "" Then $read1 = FileRead($ifileop) ;this always repeat $b1 = BinaryLen($read1) $size = FileGetSize($sfile) do $teller +=1 $size1 = FileGetSize($sfile) until $size1 > $size or $teller = 200000 if $teller = 200000 then MsgBox(4096, "Test", "error") Exit EndIf $teller = "0" $iFileOp = FileOpen($sFile, 16) $read2 = FileRead($ifileop) ;this always repeat $b2 = BinaryLen($read2) $stop = "" $result = BinaryMid($read2, $b1) $result2 = BinaryLen($result) ConsoleWrite("the old len was "&$b1&" the new len is "&$b2&" the added binary data is "&$result2&@CRLF) $read1 = $read2 EndIf WEnd EndFunc when i stopt this loop i cant stop it anymore i tryed different things i just cant get it stopped... does somebody can help me on this ? i cant get it working thx alot Greetz Yucatan
Xand3r Posted February 2, 2009 Posted February 2, 2009 (edited) expandcollapse popupfunc stream() GUICreate ("****"&$version, 600,200,250,200) GUICtrlCreateLabel ("Click on the Select button if u are recording ingame and u wanne upload your video to the **** server then ut become "&@CRLF&"availble for other to folow u" , 20, 20, 1000) $Button_1 = GUICtrlCreateButton("Select Demo to stream", 10, 60, 100) $Button_2 = GUICtrlCreateButton("Stop Streaming", 300, 60, 100) GUISetState(@SW_SHOW) while 1 watch() if $test = "1" then if $sfile = "" then $sfile = FileOpenDialog("Select a Cod2 Demo", @ProgramFilesDir & "\activision\Call of Duty 2\main\demos\", "Images (*.dm_1)", 1 + 4 ) $iFileOp = FileOpen($sFile, 16) ;file is open start reading size if $read1 = "" Then $read1 = FileRead($ifileop) ;this always repeat $b1 = BinaryLen($read1) $size = FileGetSize($sfile) do watch() $teller +=1 $size1 = FileGetSize($sfile) until $size1 > $size or $teller = 5000 if $teller = 5000 then MsgBox(4096, "Test", "error") Exit EndIf $teller = "0" $iFileOp = FileOpen($sFile, 16) $read2 = FileRead($ifileop) ;this always repeat $b2 = BinaryLen($read2) $stop = "" $result = BinaryMid($read2, $b1) $result2 = BinaryLen($result) ConsoleWrite("the old len was "&$b1&" the new len is "&$b2&" the added binary data is "&$result2&@CRLF) $read1 = $read2 EndIf WEnd EndFunc Func watch() $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit case $button_1 $test = "1" case $Button_2 $test = "0" EndSelect EndFunc try it like this the number 200000 for the loop was extremely large if 5000 is too low try doing it with a timer (best choice) or just increase it Edited February 2, 2009 by TheMadman Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
yucatan Posted February 3, 2009 Author Posted February 3, 2009 expandcollapse popupfunc stream() GUICreate ("****"&$version, 600,200,250,200) GUICtrlCreateLabel ("Click on the Select button if u are recording ingame and u wanne upload your video to the **** server then ut become "&@CRLF&"availble for other to folow u" , 20, 20, 1000) $Button_1 = GUICtrlCreateButton("Select Demo to stream", 10, 60, 100) $Button_2 = GUICtrlCreateButton("Stop Streaming", 300, 60, 100) GUISetState(@SW_SHOW) while 1 watch() if $test = "1" then if $sfile = "" then $sfile = FileOpenDialog("Select a Cod2 Demo", @ProgramFilesDir & "\activision\Call of Duty 2\main\demos\", "Images (*.dm_1)", 1 + 4 ) $iFileOp = FileOpen($sFile, 16) ;file is open start reading size if $read1 = "" Then $read1 = FileRead($ifileop) ;this always repeat $b1 = BinaryLen($read1) $size = FileGetSize($sfile) do watch() $teller +=1 $size1 = FileGetSize($sfile) until $size1 > $size or $teller = 5000 if $teller = 5000 then MsgBox(4096, "Test", "error") Exit EndIf $teller = "0" $iFileOp = FileOpen($sFile, 16) $read2 = FileRead($ifileop) ;this always repeat $b2 = BinaryLen($read2) $stop = "" $result = BinaryMid($read2, $b1) $result2 = BinaryLen($result) ConsoleWrite("the old len was "&$b1&" the new len is "&$b2&" the added binary data is "&$result2&@CRLF) $read1 = $read2 EndIf WEnd EndFunc Func watch() $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit case $button_1 $test = "1" case $Button_2 $test = "0" EndSelect EndFunc try it like this the number 200000 for the loop was extremely large if 5000 is too low try doing it with a timer (best choice) or just increase it so u think when i klik on select demo to stream it starts and when i click stop streaming it does stop the loop ?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now