Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/05/2016 in all areas

  1. 2.0.0 release (8999 Bug Fixes and Sublime Text support added) Just like that, some days later. Here is 2.0.0 Why everything in TeenyScript before the version 2.0.0 is broken A very noob programming choice of me caused the whole nesting-story to collapse when mixing classes and methods See this example, also aliases were a pure nightmare. I found this while working on my biggest project.. SO Parse.au3 is mostly rewritten using a Treeview structure with inheritance (This is what I should have done from the beginning) instead of CRAP, yeah that's what it was. So now most logical errors are fixed by default. Changes @Use x AT y, now covers the whole file instead of a specific class (Since it didn't make sense to have it exclusive for parent class per file) It's no longer possible to create anything else besides methods and properties in a class scope, instead the Construct keyword may be used to achieve the same result Major parsing improvements (M A J O R) Changed the way of accessing namespaces, from path/to/namespace/$func() topath/to/namespace::$func(). it looks more clean and makes more sense Its not longer possible to construct in extensions, it will throw an compiling error Bug Fixes Custominit.au3 caused an Array error when a regular .au3 files generated a com error No error on duplicate namespaces set #2 It is now possible to ; comment out TS code, this was not done before so, code after ; for example, would still get parsed. These are just some of the crucial I remember, but there is probably 50+ fixes /optimizations along this update New features Added support for Sublime Text 2 and 3 for non SciTe users. See "How to run with Sublime.txt" which is located in the directory Added new Namespace keyword self:: Added "Smart cache" which automatically stores parsed data in memory if not modified, making TeenyScript scale better with larger projects.
    1 point
  2. Test this script: #include <GUIConstantsEx.au3> #include <IE.au3> #include <String.au3> #include <Array.au3> $Form1 = GUICreate("Form1", 700, 500, 192, 124) $Button1 = GUICtrlCreateButton("View", 576, 24, 89, 41) Global $oIE = _IECreate("https://www.youtube.com/playlist?list=PL4Jcq5zn02jKpjX0nqI1_fS7mEEb5tw6z", 1, 1, 0) Sleep(1000) Global $sHTML = _IEDocReadHTML($oIE) $FirstChunks = _StringBetween($sHTML, 'pl-video-title-link yt-uix-tile-link yt-uix-sessionlink', '<div class="pl-video-owner') ;_ArrayDisplay($FirstChunks, '$FirstChunks') Global $Checkbox1[UBound($FirstChunks)][2] $x = 16 $y = 0 $iCheck = 0 For $a = 0 To UBound($FirstChunks) - 1 $actualdata = _StringBetween($FirstChunks[$a], '">', '</a>') If Not IsArray($actualdata) Then ContinueLoop $actualdata2 = _StringBetween($FirstChunks[$a], 'href="', '&amp;') If Not IsArray($actualdata2) Then ContinueLoop $Checkbox1[$iCheck][0] = GUICtrlCreateCheckbox($actualdata[0], 24, $x, 500, 17) $Checkbox1[$iCheck][1] = $actualdata2[0] $iCheck += 1 $x = $x + 20 $y = $y + 1 Next ReDim $Checkbox1[$iCheck][2] ;maybe some checkboxes aren't created (avoiding corupt data using ContinueLoop) _ArrayDisplay($Checkbox1,'checkbox ids |URL-watchpart') GUISetState(@SW_SHOW) Sleep(1000) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ; check whether a button is pressed For $x = 0 To UBound($Checkbox1) - 1 ConsoleWrite('X: ' & $x & @TAB & $Checkbox1[$x][0] & @TAB) If BitAND(GUICtrlRead($Checkbox1[$x][0]), $GUI_CHECKED) = $GUI_CHECKED Then ConsoleWrite('is checked') ; do what you want to do for Button pressed ConsoleWrite("www.youtube.com/" & $Checkbox1[$x][1] & @CRLF) _IECreate("www.youtube.com/" & $Checkbox1[$x][1]) GUICtrlSetState($Checkbox1[$x][0], $GUI_UNCHECKED) ;so you have toc check again and press view ExitLoop ;as you can't see all tut's at same time Else ConsoleWrite('is not checked') EndIf ConsoleWrite('press View' & @CRLF) Next EndSwitch WEnd it should work like expected, but i can't test my internet is to poor (64 kbs).
    1 point
  3. try $_IECreate("www.youtube.com/" & $actualdata2[$x]) you can also insert a Consolewrite for checking the url: ConsoleWrite("www.youtube.com/" & $actualdata2[$x]&@crlf) you can also use _ArrayDisplay to see if the arrays: $FirstChunks, $actualdata and $actualdata2 has expected elements.
    1 point
  4. You don't want to do that as the For ... Next will fill $a with content. add another variable for the counting ($y). Just redim your array to the correct number after the initial For...Next like: $FirstChunks = _StringBetween($sHTML, 'pl-video-title-link yt-uix-tile-link yt-uix-sessionlink', '<div class="pl-video-owner') Global $Checkbox1[100] $x = 16 $y = 0 For $a In $FirstChunks $actualdata = _StringBetween($a, '">', '</a>') ;$actualdata2 = _StringBetween($a, 'href="', '&amp;') $Checkbox1[$a] = GUICtrlCreateCheckbox($actualdata[0], 24, $x, 500, 17) $x = $x + 20 $y = $y + 1 Next ReDim $Checkbox1[$y-1] Then add something like this in your message loop: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch ; check whether a button is pressed For $x = 0 to UBound($Checkbox1)-1 If $nMsg = $Checkbox1[$x] Then ; do what you want to do for Button pressed EndIf next WEnd
    1 point
  5. Little impatient? Store the handles in that loop into an Array like: $Checkbox[$a] = GUICtrlCreateCheckbox($actualdata[0], 24, $x, 500, 17) And then do a For..Next in the Message loop check for any of these handles. This is also done in this way in SciTEConfig.au3 that comes with the full version of SciTE4AutoIt3. Jos
    1 point
×
×
  • Create New...