andygo Posted December 15, 2011 Share Posted December 15, 2011 (edited) hello, please take a look:i use a vlc-plugin within my script, to remote and watch tv from my dreambox.the plugin causes some lines i can see in the SciTE console.how can i get / store these outputs to a $variable when the script is compiled? Edited December 22, 2011 by andygo Link to comment Share on other sites More sharing options...
UEZ Posted December 15, 2011 Share Posted December 15, 2011 Compile your script with #AutoIt3Wrapper_Change2CUI=y and the output should be seen in the cmd box. You can pipe the output to a file. Is this what you are looking for? Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Xenobiologist Posted December 15, 2011 Share Posted December 15, 2011 Oder ein zweites Skript, dass die Console ausliest. Siehe Beispiel ConsoleRead. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
andygo Posted December 15, 2011 Author Share Posted December 15, 2011 sorry, i can't figure it out... even not with your hints. maybe you can modify the following little example to make it work? #AutoIt3Wrapper_Change2CUI=y #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <Constants.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> global $text, $services, $ii, $array2[2], $count2, $chars, $info, $pm, $oVLC, $oPlaylist, $oAudio, $vp, $oVLC, $Event_Now_Extended_Description, $msg $gui = GUICreate("E2C", 512, 363) $oVLC = ObjCreate("VideoLAN.VLCPlugin.2") if NOT IsObj($oVLC) then exit msgbox(16, "error", "embedding failed. vlc must be installed correctly.") $oPlaylist = $oVLC.playlist $oAudio = $oVLC.audio GUICtrlCreateObj($oVLC, 0, 0, 512, 288) GUISetState() $oPlaylist.add("file:///"&@TempDir & "xy.jpg"); file dont have to exsist. $oPlaylist.playitem(0) while 1 sleep(20) If $msg = $GUI_EVENT_CLOSE then ExitLoop $msg = GUIGetMsg() wend Link to comment Share on other sites More sharing options...
andygo Posted December 21, 2011 Author Share Posted December 21, 2011 no solution for that? Link to comment Share on other sites More sharing options...
Country73 Posted December 21, 2011 Share Posted December 21, 2011 Have you tried what UEZ suggested? Did it not work as a CUI? If you try to fail and succeed which have you done?AutoIt Forum Search Link to comment Share on other sites More sharing options...
UEZ Posted December 21, 2011 Share Posted December 21, 2011 (edited) Might be another possibility: expandcollapse popup;~ #AutoIt3Wrapper_Change2CUI=y #include <constants.au3> #OnAutoItStartRegister "OnAutoItStart" Global $__Restart = False If Not $CmdLine[0] Then _ScriptRestart() Global $timer = TimerInit() While Sleep(50) ConsoleWrite(Random(0, 20000, 1) & @LF) If TimerDiff($timer) > 2000 Then ExitLoop WEnd Exit Func OnAutoItStart() Sleep(50) Local $pid = ConsoleRead(1) If @extended Then While ProcessExists($pid) Sleep(100) WEnd EndIf EndFunc ;==>OnAutoItStart Func _ScriptRestart($fExit = 1) Local $pid If Not $__Restart Then If @Compiled Then $pid = Run(@ScriptFullPath & ' ' & $CmdLineRaw & "1", @ScriptDir, @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD) Else $pid = Run(@AutoItExe & ' "' & @ScriptFullPath & ' " ' & $CmdLineRaw & "1", @ScriptDir, @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD) EndIf If @error Then Return SetError(@error, 0, 0) EndIf StdinWrite($pid, @AutoItPID) EndIf $__Restart = 1 Local $line If $fExit Then While ProcessExists($pid) $line &= StdoutRead($pid) Wend MsgBox(0, "STDOUT read:", $line) Exit EndIf Return 1 EndFunc ;==>_ScriptRestart It will write some random numbers to the console while it reads the console output. Thanks to Yashied for the restart code! Br, UEZ Edited December 21, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
andygo Posted December 21, 2011 Author Share Posted December 21, 2011 Might be another possibility: ... It will write some random numbers to the console while it reads the console output. Thanks to Yashied for the restart code! Br, UEZ a kind of loader, nice idea. i tried it with the exe of my compiled script: #include <constants.au3> Local $pid $pid = Run(@ScriptDir&"myscript.exe" & ' ' & $CmdLineRaw & "1", @ScriptDir, @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD) Local $line While ProcessExists($pid) $line &= StdoutRead($pid) Wend MsgBox(0, "STDOUT read:", $line) Exit script.exe starts, i performe some actions and then finish the script. all i get from the loader is an empty msgbox. so that means to me that the vlc-plugin-debuglines are invisible for stdoutread.... hopefully i am not to stupid for that Link to comment Share on other sites More sharing options...
UEZ Posted December 21, 2011 Share Posted December 21, 2011 Try it with #AutoIt3Wrapper_Change2CUI=yMeanwhile I will start my vm where VLC is installed...Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
UEZ Posted December 21, 2011 Share Posted December 21, 2011 (edited) Your example script in post#4 crashes -> !>23:42:15 AutoIT3.exe ended.rc:-1073741819.Probably caused by $oVLC = ObjCreate("VideoLAN.VLCPlugin.2")Probably best is to compile your script with #AutoIt3Wrapper_Change2CUI=yand run your script in cmd:yourscript.exe > vlc_output.txtBr,UEZ Edited December 21, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
andygo Posted December 21, 2011 Author Share Posted December 21, 2011 (edited) Your example script in post#4 crashes -> !>23:42:15 AutoIT3.exe ended.rc:-1073741819.Probably caused by $oVLC = ObjCreate("VideoLAN.VLCPlugin.2")Probably best is to compile your script with #AutoIt3Wrapper_Change2CUI=yand run your script in cmd:yourscript.exe > vlc_output.txtBr,UEZdid it exactly like this. but: still nothing.... i really thank you for spending your timeand would understand if you couldn't further give attention to this.it''s no world-sunset, i just like to understand... Edited December 21, 2011 by andygo Link to comment Share on other sites More sharing options...
Clark Posted December 22, 2011 Share Posted December 22, 2011 Is it possibly writing to stderr rather than stdout? Link to comment Share on other sites More sharing options...
UEZ Posted December 22, 2011 Share Posted December 22, 2011 (edited) did it exactly like this. but: still nothing.... i really thank you for spending your time and would understand if you couldn't further give attention to this. it''s no world-sunset, i just like to understand... Try: v 2> out.txt Br, UEZ Edited December 22, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
andygo Posted December 22, 2011 Author Share Posted December 22, 2011 (edited) Is it possibly writing to stderr rather than stdout? YES MAN!!!! Indeed it did!!!! Thanks a lot with the following script i get the data i want: #include <constants.au3> Local $pid $pid = Run(@ScriptDir&"myscript.exe" & ' ' & $CmdLineRaw & "1", @ScriptDir, @SW_SHOW, $STDERR_CHILD) Local $line While ProcessExists($pid) $line &= StderrRead($pid) Wend MsgBox(0, "Console:", $line) Exit when we have come this far: is it possible to clear the consoles output ? Edited December 22, 2011 by andygo Link to comment Share on other sites More sharing options...
UEZ Posted December 22, 2011 Share Posted December 22, 2011 ah, yes, 2> is the error output... Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
andygo Posted December 22, 2011 Author Share Posted December 22, 2011 Try: v 2> out.txt Br, UEZ thank you too, this also contains the data i need Link to comment Share on other sites More sharing options...
andygo Posted December 22, 2011 Author Share Posted December 22, 2011 for those who are intrested, here is my complete solution:i start my mainscript via loader (with some parameters), loader runs invisible parallel to the mainscript.it checks just the last line of the StderrRead-Stream and stores it via iniwrite.$pid = Run(@AppDataDir&"mainscript.exe "&@AutoItPID&" "&$ip&" "&GUICtrlRead($vdo), @AppDataDir, @SW_SHOW, $STDERR_CHILD) GUIDelete($pregui) While ProcessExists($pid) $ct = StderrRead($pid) $ct = StringTrimLeft($ct, StringInStr($ct, "[", 0, -1)-1) $ct = StringLeft($ct, StringInStr($ct, @LF)-1)&"+ "&StringInStr($ct, @CR) if StringInStr($ct, "[") > 0 and IniRead ( @AppDataDir & "vlc"&@AutoItPID&".ini", "receiver", "console", "" ) <> $ct then iniwrite(@AppDataDir & "vlc"&@AutoItPID&".ini", "receiver", "console", $ct) endif sleep(125) Wend Exitthen in the mainscript, i evaluate the loader's data via iniread:if $CmdLine[3] = 1 then _Timer_SetTimer($gui,100,"addup");VLC DEBUG func addup($a, $b, $c, $d) $tmp = IniRead ( @AppDataDir & "vlc"&$CmdLine[1]&".ini", "receiver", "console", "" ) if GUICtrlRead($cinfo) <> $tmp then GUICtrlSetData ($cinfo, $tmp) _GUICtrlEdit_AppendText($c16, @CRLF & $tmp) endif endfuncthe rest is pure cosmetic. on my mainwindow i show just the latest iniread, in a separate windowi collect all data:thanks again all involved of this thread Link to comment Share on other sites More sharing options...
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