oOp Posted September 13, 2009 Share Posted September 13, 2009 (edited) Hallo, ich habe in meiner channelchange.vbs code einprogrammiert, welcher bei bestimmten sendern ein http request macht. Es funktioniert auch allles wunderbar, nur leider erhalte ich ab und an Timeout errors vom DVBViewer. Siehe http://yfrog.com/0oscripttimeoutj Die Einstellungen in Optionen - Scripts - Timeout scheinen keine Auswirkungen zu haben. Ist dies eventuell irgendwo anders einzustellen? Danke im voraus. Edit: Elaube ich Windows Dialos Boxen, so erhalte ich ein Popup: http://yfrog.com/be57278856j Edited September 13, 2009 by oOp Quote Link to comment
dbraner Posted September 13, 2009 Share Posted September 13, 2009 Kannst Du das Script bitte mal hier posten, oder zumindest den relevanten Teil mit den HTTP-Requests? Quote Link to comment
oOp Posted September 13, 2009 Author Share Posted September 13, 2009 sub main(aID) dim URL dim Http dim Res Dim myFSO, objFile Dim myFSO2, objFile2 Dim S Dim DEBUG DEBUG = "OFF" 'On error resume next Set objDictionary = CreateObject("scripting.dictionary") objDictionary.Add "3", "Arte SD" objDictionary.Add "0", "Eins Extra" objDictionary.Add "1", "Eins Festival" objDictionary.Add "2", "Eins Plus" objDictionary.Add "224", "Das Erste HD" objDictionary.Add "225", "ZDF HD" Set objDictionary2 = CreateObject("scripting.dictionary") objDictionary2.Add "659", "DMAX" objDictionary2.Add "982", "LuxeTV SD" objDictionary2.Add "955", "Tele5" objDictionary2.Add "462", "Nick" Set objDictionary3 = CreateObject("scripting.dictionary") objDictionary3.Add "226", "Arte HD" objDictionary3.Add "206", "Anixe HD" objDictionary3.Add "207", "Astra HD" Set myFSO = CreateObject("Scripting.FileSystemObject") Set objFile = myFSO.OpenTextFile("channel.txt", 1) S=objFile.ReadLine objFile.Close SET objFile = NOTHING SET myFSO = NOTHING Dim S2, aID2 S2 = Cstr(S) aID2 = Cstr(aID) Set myFSO2 = CreateObject("Scripting.FileSystemObject") Set objFile2 = myFSO2.OpenTextFile("channel.txt", 2, True) objFile2.Write aID objFile2.Close SET objFile2 = NOTHING SET myFSO2 = NOTHING if (objDictionary.Exists(S2) And objDictionary.Exists(aID2)) Then if DEBUG="ON" THEN MsgBox 1 END if SET objDictionary = NOTHING SET objDictionary2 = NOTHING exit sub end if if (objDictionary2.Exists(S2) And objDictionary2.Exists(aID2)) Then if DEBUG="ON" THEN MsgBox 2 END if SET objDictionary = NOTHING SET objDictionary2 = NOTHING exit sub end if if (objDictionary3.Exists(S2) And objDictionary3.Exists(aID2)) Then if DEBUG="ON" THEN MsgBox 2 END if SET objDictionary = NOTHING SET objDictionary2 = NOTHING exit sub end if if (objDictionary2.Exists(S2) = False And objDictionary2.Exists(aID2) = False And _ objDictionary.Exists(S2) = False And objDictionary.Exists(aID2) = False And _ objDictionary3.Exists(S2) = False And objDictionary3.Exists(aID2) = False) Then if DEBUG="ON" THEN MsgBox 4 END if SET objDictionary = NOTHING SET objDictionary2 = NOTHING exit sub end if if objDictionary.Exists(aID2) Then if DEBUG="ON" THEN MsgBox 5 END if URL = "http://192.168.X.X/control/zapto?41b00017034" else if objDictionary2.Exists(aID2) Then if DEBUG="ON" THEN MsgBox 6 END if URL = "http://192.168.X.X/control/zapto?44400012775" else if objDictionary3.Exists(aID2) Then if DEBUG="ON" THEN MsgBox 7 END if URL = "http://192.168.X.X/control/zapto?41b00017032" else if DEBUG="ON" THEN MsgBox 8 END if URL = "http://192.168.X.X/control/zapto?44d00016dca" end if end if end if Set Http=CreateObject("WinHttp.WinHttpRequest.5.1") 'Http.SetTimeouts 1,1,1,1 Http.Open "GET", URL, False Http.Send SET Http = Nothing SET objDictionary = NOTHING SET objDictionary2 = NOTHING end sub Quote Link to comment
oOp Posted September 13, 2009 Author Share Posted September 13, 2009 192.168.X.X hab ich umbenannt. danke fuer eure hilfe Quote Link to comment
oOp Posted September 16, 2009 Author Share Posted September 16, 2009 also vielleicht war ja der code zu schwer. einfach zu testen mit folgenden code: sub main(aID) do while (i < 10000000) i = i+1 loop end sub Quote Link to comment
nuts Posted September 16, 2009 Share Posted September 16, 2009 Mhm der DVBViewer mag wohl keine zulangen Skripte. 1. Möglichkeit: externes Skript über die channelchange.vbs aufrufen, Aktionen durchführen und über den Com-Server mit dem DVBViewer kommunizieren. 2. Möglichkeit: Die Laufzeit deines Skripts optimieren - ob man dabei soviel rausholen kann ist aber fraglich (vielleicht: switch ... case ... endswitch oder if ... elseif ... endif anstatt ständig if ... endif?) 3. Möglichkeit: bei einer bestimmten Zeitüberschreitung das Skript beenden. Quote Link to comment
Tjod Posted September 16, 2009 Share Posted September 16, 2009 Was hast du bei Timeout für ein Script in Sek. eingestellt? http://de.DVBViewer.tv/wiki/Optionen_Skrip...n_Script_in_Sek. Quote Link to comment
dbraner Posted September 16, 2009 Share Posted September 16, 2009 Mhm der DVBViewer mag wohl keine zulangen Skripte. 1. Möglichkeit: externes Skript über die channelchange.vbs aufrufen, Aktionen durchführen und über den Com-Server mit dem DVBViewer kommunizieren. 2. Möglichkeit: Die Laufzeit deines Skripts optimieren - ob man dabei soviel rausholen kann ist aber fraglich (vielleicht: switch ... case ... endswitch oder if ... elseif ... endif anstatt ständig if ... endif?) 3. Möglichkeit: bei einer bestimmten Zeitüberschreitung das Skript beenden. Ich denke, Möglichkeit 1 ist die richtige. Ein externes Script asynchron aufgerufen, d.h. das aufrufende wartet nicht auf die Beendigung. Sollte klappen. Man müsste wohl auch nur den HTTP-GET-Request auslagern, da der am zeitkritischsten sein sollte. Quote Link to comment
oOp Posted September 20, 2009 Author Share Posted September 20, 2009 ich teste das mit auslagern. danke fuer eure hilfe. Quote Link to comment
oOp Posted September 20, 2009 Author Share Posted September 20, 2009 klappt. nochmals vielen dank! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.