All Activity

This stream auto-updates   

  1. Past hour
  2. as title says.. i dont want to add text to beginning or end of file i want to open a text file and pre-pend something on the beginning of EVERY other LINE (the ones without #'s and ignore also the first 4 lines) check this out #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:5448549 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448549.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006834126320-12006835068012 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448550.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006835068012-12006836991064 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448551.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006836991064-12006838592636 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448552.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006838592636-12006839630396 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448553.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006839630396-12006840960308 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448554.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006840960308-12006842139632 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448555.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006842139632-12006843484584 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448556.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006843484584-12006845024868 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448557.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006845024868-12006847775684 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448558.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006847775684-12006850449984 i want to add an IP to the beggining of every other line (except the first 4 lines) and resave the file so it will be like this FROM THIS #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:5448549 #EXTINF:12.0 C8B6E0C508FC74915BAA94D116F142165-frag5448549.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006834126320-12006835068012 ........ TO THIS (NOTE THE http://192.168.100.1:1111/ ADDED) #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:5448549 #EXTINF:12.0 http://192.168.100.1:1111/C8B6E0C508FC74915BAA94D116F142165-frag5448549.ts?token=822259&gid=C8B6E0C508FC74915BAA94D116F142165&range=12006834126320-12006835068012 ........ how can we do this is it possible ? I cant seem to find anything about this cheers
  3. Today
  4. Have you tried this UDF?
  5. Try this, and if it's not working correctly, please let us know exactly how it's not working correctly. #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <File.au3> #include <GUIListBox.au3> Main_Form() Func Main_Form() #Region ### START Koda GUI section ### Form=c:\users\elahr.vitacost\documents\autoit scripts\form1.kxf $Form1 = GUICreate("", 798, 401, 177, 114) $Label1 = GUICtrlCreateLabel("Display Request Form", 0, 8, 715, 41, $SS_CENTER) GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif") $Input1 = GUICtrlCreateInput("0", 416, 120, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) $Combo1 = GUICtrlCreateCombo("", 16, 120, 385, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $Combo2 = GUICtrlCreateCombo("", 16, 152, 385, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $Combo3 = GUICtrlCreateCombo("", 16, 184, 385, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $Combo4 = GUICtrlCreateCombo("", 16, 216, 385, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $Combo5 = GUICtrlCreateCombo("", 16, 248, 385, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $Input2 = GUICtrlCreateInput("0", 416, 152, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) $Label2 = GUICtrlCreateLabel("URL to Display", 120, 80, 139, 28, $SS_CENTER) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Label3 = GUICtrlCreateLabel("Minutes", 417, 82, 77, 28, $SS_CENTER) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Input3 = GUICtrlCreateInput("0", 416, 184, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) $Input4 = GUICtrlCreateInput("0", 416, 216, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) $Input5 = GUICtrlCreateInput("0", 416, 248, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER)) $Button1 = GUICtrlCreateButton("Open Page and Configure", 645, 120, 139, 17) $Button2 = GUICtrlCreateButton("Begin Display", 168, 293, 355, 33) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Button3 = GUICtrlCreateButton("Add or Remove URL", 205, 347, 291, 33) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Button4 = GUICtrlCreateButton("Open Page and Configure", 645, 153, 139, 17) $Button5 = GUICtrlCreateButton("Open Page and Configure", 645, 187, 139, 17) $Button6 = GUICtrlCreateButton("Open Page and Configure", 645, 217, 139, 17) $Button7 = GUICtrlCreateButton("Open Page and Configure", 645, 251, 139, 17) $Label4 = GUICtrlCreateLabel("Refresh", 536, 80, 76, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Radio1 = GUICtrlCreateRadio("", 566, 120, 17, 17) $Radio2 = GUICtrlCreateRadio("", 566, 152, 17, 17) $Radio3 = GUICtrlCreateRadio("", 566, 184, 17, 17) $Radio4 = GUICtrlCreateRadio("", 566, 217, 17, 17) $Radio5 = GUICtrlCreateRadio("", 566, 250, 17, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $oFile = @ScriptDir & "\URL_List.txt" FileOpen($oFile, 0) ; Check if file opened for reading OK If $oFile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf For $ii = 1 To 5 ; Read in lines of text until the EOF is reached For $i = 1 To _FileCountLines($oFile) $line = FileReadLine($oFile, $i) ;MsgBox(0,'',$line) If $ii = 1 Then GUICtrlSetData($Combo1, $line) If $ii = 2 Then GUICtrlSetData($Combo2, $line) If $ii = 3 Then GUICtrlSetData($Combo3, $line) If $ii = 4 Then GUICtrlSetData($Combo4, $line) If $ii = 5 Then GUICtrlSetData($Combo5, $line) Next Next FileClose($oFile) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button3 ;~ GUIDelete($Form1) <<<<<<<<<<<<<< Not needed, unless you want to have to readd everything all of the time ;~ You can hide it if you need to make it not visible while using Form2 URL_Config() EndSwitch WEnd EndFunc ;==>Main_Form Func URL_Config() Local $oFile = @ScriptDir & "\URL_List.txt" FileOpen($oFile, 0) ; Check if file opened for reading OK If $oFile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf #Region ### START Koda GUI section ### Form=C:\Users\elahr.VITACOST\Documents\AutoIT Scripts\Form2.kxf $Form2 = GUICreate("Add or Remove URL", 543, 671, 250, 14) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Form2 = ' & $Form2 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $List1 = GUICtrlCreateList("", 24, 40, 497, 344) $Label1 = GUICtrlCreateLabel("Select URL to Remove", 0, 8, 539, 32, $SS_CENTER) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Remove", 40, 392, 465, 33) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Input1 = GUICtrlCreateInput("", 24, 504, 497, 21) $Label2 = GUICtrlCreateLabel("Enter URL to Add", 0, 472, 539, 32, $SS_CENTER) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Add", 43, 532, 465, 33) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button3 = GUICtrlCreateButton("Return to Display Setup", 39, 610, 465, 33) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### For $i = 1 To _FileCountLines($oFile) $line = FileReadLine($oFile, $i) GUICtrlSetData($List1, $line) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg ;~ Case $GUI_EVENT_CLOSE ;~ Exit Case $Button1 $select = GUICtrlRead($List1) For $i = 1 To _FileCountLines($oFile) $line = FileReadLine($oFile, $i) If $line = $select Then _FileWriteToLine($oFile, $i, "", True) _GUICtrlListBox_ResetContent($List1) For $z = 1 To _FileCountLines($oFile) $oLine = FileReadLine($oFile, $z) GUICtrlSetData($List1, $oLine) Next ExitLoop EndIf Next Case $Button2 $new = GUICtrlRead($Input1) GUICtrlSetData($Input1, "") ;MsgBox(0, "", "Input: " & $new) If $new <> "" Then FileWriteLine($oFile, $new) _GUICtrlListBox_ResetContent($List1) For $z = 1 To _FileCountLines($oFile) $oLine = FileReadLine($oFile, $z) GUICtrlSetData($List1, $oLine) Next If $new = "" Then MsgBox(0, "Error", "There is nothing to add.") ;~ URL_Config() <<<<<<<<<<<<<<<<<<< Recursing the function Case $Button3, $GUI_EVENT_CLOSE GUIDelete($Form2) ;~ Main_Form() <<<<<<<<<<<<<<<<< Recursing the first function Return EndSwitch WEnd EndFunc ;==>URL_Config
  6. Have you tried this with another file?
  7. Yesterday
  8. How can I make html codes the same? and how can i solve <script type="text/javascript"> document.write(unescape('%41%75%74%6F%69%74%54%65%73%74')); </script> Is it possible to do this with Autoit and solve it?
  9. Slacker, unfortunately that does not work as i cannot control the object using usual methods for some reason that is the whole dilemma. Fortunately InnI has provided a solution for me! - Thank you !!!! will be using this IUIAutomation in the future !!!!!!
  10. Thanks RTFC, yes, helped a lot My problem was a lack of knowledge on dllstruct and similar ones. But now that is solved ! I also checked _WinAPI_CreateFileMapping and seems that it can work too. About performance, later I will do some loops and compare against array direct cells write/read. I can suppose that it is much slower, but much faster than, for example, use a file as a way to exange data betwen processes. But I thint that if AU3 variables had an "AT" keyword, that would be great.... For example Global/Local AT $ptr $var1, $var2[1000][1000], etc. Some years ago I suggested that in MikroPascal, and hoppefully they implemented that. Today we can map a variable over another, and over PIC microcontrolers register bits, etc. => Var XXX: byte AT portB; Var ZZZ: sbit at portB.1; .....
  11. Someone here gave me some help in order to detect if my Yubikey is inserted or not, by checking the Windows system for all "keyboard" devices for the presence of the serial number of my Yubikey. Then once unplugged and found to be missing, take some action like lock the PC. The problem is it does not work with the newer Yubikeys because, I think, they act as smartcards or something. So the code looking for a keyboard is no good. There was some kind of tool which I used to help me find what to search for I think, I do not remember. Here is the function which did the original checking, but I am totally clueless on how to tweak it to again be able to find the serial number of my new (no longer acting as a keyboard) Yubikey. Func CheckForYubikey($input) $Output = "" $object = ObjGet("winmgmts:\\" & $strComputer & "\ROOT\CIMV2") $items = $object.ExecQuery("SELECT DeviceID FROM Win32_Keyboard", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($items) Then For $objItem In $items FileWriteLine('test.txt', $objItem.DeviceID) If StringInStr($objItem.DeviceID, $YubikeySerialNumber) Then Return True Next Else Return False EndIf Return False EndFunc ;==>CheckForYubikey Any help would be appreciated.
  12. Hi Jose. My first impulse was to just refer you to my Eigen4AutoIt environment (v4.1), which contains a working example (test #20 in the EIgenTest subdirectory) of a matrix (struct) being created by one process, an subsequently written two in alternating fashion by a second process and the first (both filling it with their PID). That example illustrates mutex usage as well, as you'll see each process failing to obtain the mutex until the other one releases it (after which a successful write occurs). My second impulse was to refer you to the _WinAPI_CreateFileMapping example in the AutoIt Help, which shows how to share a joint memory allocation between two processes without mutex. But of course, that one doesn't involve the HighMem environment, which takes care of all the nitty gritty of keeping your memory allocations organised. So my third impulse, followed here, is to share two tiny test scripts from my earliest testing phase of _HighMem. Both use a struct as a string buffer for one process to store user-defined text in and the other process to read it back, just like in the CreateFileMapping example (but using the HighMem environment). Obviously, you can stick anything you like into a struct, including an array (e.g., convert to string and store in struct at one end, and do the reverse at the other end). If you need more extensive examples of how to use structs as generic tmporary containers for any type of variable, I would suggest you study my Pool IPC environment (link in my sig below). Start this script first (the HighMem equivalent of the AutoIt Help file example referred to above), but don't fill the inputbox yet... #AutoIt3Wrapper_UseX64=Y #NoTrayIcon #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <WinAPIFiles.au3> #include "D:\Autoit\HighMem\HighMem.au3" $_HighMem_verbose=True Opt('WinWaitDelay', 0) Global Const $g_sTitle = 'TestHighMem' Global $sText Global $mapobjectname=$_HighMem_NamePrefix & '123' ; fake PID _HighMem_StartUp(1) _HighMem_MapExternalMemory(123, False) ; fake PID Local $sText,$tData = DllStructCreate('wchar[1024]', $_HighMem_ExternalBaseOffset[1]) While WinWait($g_sTitle, '', 1) Sleep(200) $sText = DllStructGetData($tData, 1) DllStructSetData($tData, 1, '') If $sText Then MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), $g_sTitle & " (receiver)", " " & @CRLF & $sText) WEnd _HighMem_CleanUp() Then start the second one below, then type something and press Ok. #AutoIt3Wrapper_UseX64=Y #NoTrayIcon #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <WinAPIFiles.au3> #include "D:\Autoit\HighMem\HighMem.au3" $_HighMem_verbose=True Opt('WinWaitDelay', 0) Global Const $g_sTitle = 'TestHighMem' Global $sText Global $mapobjectname=$_HighMem_NamePrefix & '123' _HighMem_StartUp(1,"GB",$mapobjectname) Local $sText,$tData = DllStructCreate('wchar[1024]', $_HighMem_BaseOffset) While WinWaitClose($g_sTitle) $sText = StringStripWS(InputBox($g_sTitle & " (sender)", 'Type some text', '', '', -1, 171), 3) If Not $sText Then ExitLoop DllStructSetData($tData, 1, $sText) If Not WinWait($g_sTitle, '', 1) Then ExitLoop WEnd _HighMem_CleanUp() IMPORTANT: this simple example works for a single allocation only, because it maps the struct directly to the shared memory base pointer (the start of the total pre-allocated region). But obviously, only the first allocation has an offset of zero. Any allocation made thereafter by script 1 will have a relative offset larger than zero. So you have to start parsing those offsets to your second (and third, fourth, etc) script(s) using some form of IPC (for example, using my Pool environment ). And the second script then calls _HighMem_AllocateExternal ( $PID, $offset, $size, $unit="B"), after first calling _HighMem_MapExternalMemory( $PID ). Maybe I can provide a nexample of that some other time. I'm not sure by what you mean by "efficient" in this context. Using a shared resource and just communicating a pointer once is certainly less data traffic than moving a 1000x1000 cell array back and forth every time, if that's what you mean. And yes, these allocations can be any size that fits into your virtual memory. Does that clarify things for you?
  13. Attack is the best defense approach? 7 days to think about that last post whether that is the way you want to continue here or not. Jos
  14. Second, dont care about impression. Since I rarely get useful answers on my questions I dont really care whose 'hammer' I will get, not much will change...
  15. This is the second or third time I have seen you posting like this - not sure if you're under the mistaken impression that it's clever or funny. Continue with this and and you can personally experience the hammer.
  16. Gaat prima hoor! Jos
  17. Hi, I have a file with many rows that i want to convert to array. The thing i need is to add a comma and 1 space after end of each line like "first line, second line, third line, fourth line". Document looks like this 277 278 279 281 282 283 590 285 473 476 482 286 287 275 280 284 1059 1063 1067 1083 1071 1055 And here is code i try. #include <File.au3> $file = FileOpen("test.txt", 0) $oFile = FileReadToArray($file) For $i = 1 to UBound($oFile)-1 $line = FileReadLine($file, $oFile[$i]) $replace = $line & ", " ConsoleWrite($replace) Next
  18. @Jos Sorry I meant Another threah but this time without Game automation. My English is not great. Thanks that the thread can stay
  19. Read in Debene QPDF Reference about: DrawHTMLTextBox and try: _QPDF_TXT_to_PDF _QPDF_TXT_to_PDF_Lite _QPDF_TXTFile_to_PDFFile
  20. As @Danp2 said So @domina did you try on another location, at home, at friend ..... ? Of course also on different ISP.
  21. @Golfboy, Funny you now say you create a thread with game automation while you stated before in PM it wasn't about game automation at all. Nikolas92 is right about not re-opening a thread on the same topic in general, but I will let this go as long as it is about general software updates. Jos
  22. Please refrain from these type of comments and simply report when you feel you need to act upon this. thanks. Jos
  23. Sorry, but it's an environmental issue AFAICS and I'm all out of ideas ATM.
  24. You should read the forum rules, particularly this section --
  25. Reboot, no firewall. Also tried tunnel bear. Nothing works. When I change the url to any other site it works without a problem. If the site doesnt exisist it takes more time till the script fails. Only the server makes these problems.
  26. Any firewalls / corporate proxies involved? Have you tried rebooting?
  27. But why.... there is nothing about game automation. I'm just asking how I can improve the code and how I can get the process to the background
  1. Load more activity