Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/07/2024 in all areas

  1. Andreik

    ePUB Reader

    This is a portable application that can open ePUB books (EPUB 2 and EPUB 3) and it's made just with native AutoIt UDFs. It's a personal project since I have many ebooks but I post the code here just in case someone else need a portable and lightweight reader or simply to learn how to read ePUB files. Features: Load ePUB book Navigation through content (backward / forward / stop / refresh) with a visual indicator of chapters in the form of an interactive slider. Resizeable and (partially) customizable UI Custom CSS (partially) Jump to chapter Note: This is an early (experimental) release that might have undiscovered bugs and please note that some features are just partially implemented. I tested the application with a dozen of ePUB books but I am sure that some bugs might come to light soon, so if you found any just let me know and I will try to fix the application. I don't have enough space to upload the source and binary here but you can see the entire project on GitHub or download from AutoIt.
    3 points
  2. UEZ

    Find Duplicates in an array

    Something like this here? #include <Array.au3> Global $aFilms[] = ["Rambo", "Rambo II", "Rambo III", "Rocky", "Rocky II", "Rocky III", "Rocky IV", "Possessed", "Edge of Tomorrow", "The Ghost Writer", "rocky ii", "RAMBO iii"] Global $aDuplicates[UBound($aFilms) * 2], $j = 0 For $i = 0 To UBound($aFilms) - 1 $aDuplicates[$j] = $aFilms[$i] $j += 1 If Random() < 0.3333333 Then $aDuplicates[$j] = $aFilms[$i] $j += 1 EndIf Next ReDim $aDuplicates[$j - 1] ;_ArrayShuffle($aDuplicates) _ArraySort($aDuplicates) ConsoleWrite("All " & UBound($aDuplicates) & " films:" & @CRLF) For $i = 0 To UBound($aDuplicates) - 1 ConsoleWrite($i + 1 & ": " & $aDuplicates[$i] & @CRLF) Next ConsoleWrite(@CRLF) ConsoleWrite("Duplicates:" & @CRLF) $i = -1 $j = 1 While $i < UBound($aDuplicates) - 2 $i += 1 If StringLower($aDuplicates[$i]) == StringLower($aDuplicates[$i + 1]) Then ConsoleWrite($j & ". duplicate: " & $aDuplicates[$i] & @CRLF) $j += 1 $i += 1 EndIf WEnd
    2 points
  3. Andreik

    Slideshow UDF

    This is a basic UDF to create nice slideshows. There are a lot of customizable options so it might be useful in some projects. Here is an example: #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 4 -w 5 -w 6 -w 7 #Au3Stripper_Parameters=/sf /sv /mo /rm /rsln #include "Slideshow.au3" Global $avImage[4] = [ _ 'https://lh5.googleusercontent.com/p/AF1QipM3jIOsqrISfcKwgYLYF8-9DyAzQiUyWmB35nBj=w540-h312-n-k-no', _ 'https://lh5.googleusercontent.com/p/AF1QipMPb5fGtzZz2ZJFd20CV2trNzmxNOYLv4abJSfi=w540-h312-n-k-no', _ 'https://lh5.googleusercontent.com/p/AF1QipPLOXRwTpKbFxNNLTmiLrIJlG_H3h4VU6HShLwf=w540-h312-n-k-no', _ 'https://lh5.googleusercontent.com/p/AF1QipPNiwx1lGPxcHJzKTMRl5Cyr1SOjS05yHbif8BE=w540-h312-n-k-no' _ ] Global $asCaptions[4] = ['Pico do Fogo', 'Praia da Chave', 'Buracona - Blue Eye Cave', 'Deserto de Viana'] Global $mOptions[] $mOptions['ImageType'] = 'URL' $mOptions['Captions'] = $asCaptions $mOptions['ShowCaptions'] = True Global $sTitle = 'Cape Verde' Global $sText = 'Cape Verde or Cabo Verde, officially the Republic of Cabo Verde, is an archipelago and island country of West Africa in the central Atlantic Ocean, ' & _ 'consisting of ten volcanic islands with a combined land area of about 4,033 square kilometres (1,557 sq mi). These islands lie between 600 and 850 kilometres ' & _ '(320 and 460 nautical miles) west of Cap-Vert, the westernmost point of continental Africa. The Cape Verde islands form part of the Macaronesia ecoregion, ' & _ 'along with the Azores, the Canary Islands, Madeira, and the Savage Isles.' Global $sExtraText = "Cape Verde's official language is Portuguese. The recognized national language is Cape Verdean Creole, which is spoken by the vast " & _ "majority of the population. As of the 2021 census the most populated islands were Santiago, where the capital Praia is located (269,370), São Vicente (74,016), " & _ "Santo Antão (36,632), Fogo (33,519) and Sal (33,347). The largest cities are Praia (137,868), Mindelo (69,013), Espargos (24,500) and Assomada (21,297)." Global $sCopyright = 'Sources for pictures and data are from google.com and wikipedia.com' Global $hGUI, $cTitle, $cText, $cExtra, $cCopyright, $mSlideshow _GDIPlus_Startup() $hGUI = GUICreate('Slideshow', 870, 450) $cTitle = GUICtrlCreateLabel($sTitle, 10, 10, 300, 60) $cText = GUICtrlCreateLabel($sText, 10, 90, 300, 240) $cExtra = GUICtrlCreateLabel($sExtraText, 10, 330, 850, 80) $cCopyright = GUICtrlCreateLabel($sCopyright, 10, 420, 850, 20) $mSlideshow = _GUICtrlSlideshow_Create($hGUI, 320, 10, 540, 312, $avImage, $mOptions) GUICtrlSetFont($cTitle, 35, 600, 0, 'Segoe UI') GUICtrlSetFont($cText, 11, 500, 0, 'Segoe UI') GUICtrlSetFont($cExtra, 11, 500, 0, 'Segoe UI') GUICtrlSetFont($cCopyright, 11, 500, 2, 'Segoe UI') GUICtrlSetColor($cTitle, 0x000060) GUICtrlSetColor($cCopyright, 0x800000) GUISetState(@SW_SHOW, $hGUI) While True If _GUICtrlSlideshow_ButtonEvent($mSlideshow, $SLIDESHOW_PREV_BTN) Then _GUICtrlSlideshow_ShowSlide($mSlideshow, $BTN_EVENT_PREV) If _GUICtrlSlideshow_ButtonEvent($mSlideshow, $SLIDESHOW_NEXT_BTN) Then _GUICtrlSlideshow_ShowSlide($mSlideshow, $BTN_EVENT_NEXT) Switch GUIGetMsg() Case -3 ExitLoop EndSwitch WEnd _GUICtrlSlideshow_Delete($mSlideshow) _GDIPlus_Shutdown() There might be some hidden bugs. If you encounter any just let me know. Tip: use SlideshowEx.au3 if you don't want to preload the images Slideshow.au3SlideshowEx.au3
    1 point
  4. Andreik

    ePUB Reader

    @argumentum I was thinking that someone might use a dark theme or some fancy colors. It would be trivial to add customizable colors so it will be in next release. I kinda hesitate to implement this because the books loaded have their own css and probably the background color of the page will still be white.
    1 point
  5. I'm still learning, I'm sorry @Jos. thankyou so much @Nine
    1 point
  6. Andreik

    ePUB Reader

    Ahhh, I forgot that not everyone have sqlite3.dll in @SystemDir. Just copy sqlite3.dll in script directory until I fix this.
    1 point
  7. @ioa747 I have not tested this I think the will be much cleaner thank you!!!
    1 point
  8. Scripting.Dictionary will not mix "Rambo II" with "Rambo III". I believe you got another problem somewhere. Here a simple way to test it : #include <Array.au3> Local $aList = ["Rambo I", "Rambo II", "Rambo III", "RAMBO I", "Rambo ii"] Local $aDup = FindeDuplikate($aList) _ArrayDisplay($aDup) Func FindeDuplikate( $aArray ) Local $oTst = ObjCreate( "Scripting.Dictionary" ) Local $oRes = ObjCreate( "Scripting.Dictionary" ) ;$oTst.CompareMode = 1 For $i = 0 To UBound( $aArray ) - 1 If Not $oTst.Exists( $aArray[$i] ) Then $oTst( $aArray[$i] ) = 1 ElseIf Not $oRes.Exists( $aArray[$i] ) Then $oRes( $aArray[$i] ) = 1 EndIf Next Return $oRes.Keys() EndFunc As you can see none is duplicate, but if you uncomment the line of CompareMode, then comparaison will be non-case-sensitive, so last two will be flagged as duplicates.
    1 point
  9. Danyfirex

    WinHTTP functions

    @maniootek yes its possible. Saludos
    1 point
  10. yes CTRL+J also try to use:
    1 point
×
×
  • Create New...