1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. x0r

Beiträge von x0r

  • Wrapper für Konsolenbefehl (MEGACommandline client)

    • x0r
    • 8. Mai 2013 um 11:01

    so würde ich das auf die schnelle lösen, sollte auch leicht verständlich sein:

    [autoit]

    dim $str, $out, $split

    [/autoit][autoit][/autoit][autoit]

    $str = "/Contacts/Root/Trash/Mail/Root/Datei1.png/Root/Datei2.png/Root/Datei3.jpeg"

    [/autoit][autoit][/autoit][autoit]

    $split = StringSplit($str,"/")

    [/autoit][autoit][/autoit][autoit]

    for $i = 1 to $split[0]
    if StringInStr($split[$i],".") and $i+1 < $split[0] Then
    $out &= $split[$i] & @CRLF & "/"
    Else
    $out &= $split[$i] & "/"
    EndIf
    Next

    [/autoit][autoit][/autoit][autoit]

    $out = StringTrimRight($out,1)

    [/autoit][autoit][/autoit][autoit]

    MsgBox(0,"",$out)

    [/autoit]
  • Wrapper für Konsolenbefehl (MEGACommandline client)

    • x0r
    • 8. Mai 2013 um 10:47

    Hi,

    jetzt wissen wir, wie es nach dem Script aussieht und wie es aussehen soll, aber wie sieht es DAVOR aus, also dein Output?

    Gruß
    x0r

  • Unterscheidungsmerkmal zwischen ID (Zahl) und String

    • x0r
    • 7. Mai 2013 um 11:37

    Hi,

    so:

    [autoit]

    if IsNumber($var)
    if IsString($var)

    [/autoit]

    €dit: Inputfeld = String, BugFix hat recht mit umwandeln "Number(guictrlread($input))"

    Gruß
    x0r

  • Anzahl der Vorkommen eines Strings in txt

    • x0r
    • 7. Mai 2013 um 08:50

    ...schon 100x im forum erwähnt und 0x die suche bemüht :)

  • DROP TABLE löscht nicht die gespeicherten Daten

    • x0r
    • 6. Mai 2013 um 09:42

    dann kann man bestimmt ein alias auf "DELETE FROM table;" erstellen, dann funzt truncate auch ;)

  • DROP TABLE löscht nicht die gespeicherten Daten

    • x0r
    • 6. Mai 2013 um 08:14

    TRUNCATE TABLE - löscht den kompletten inhalt, falls du das zuerst ausführen willst und dann DROP TABLE :)

  • Variablentausch mit/ohne Hilfsvariable

    • x0r
    • 29. April 2013 um 12:00

    Hi,

    was haltet ihr von folgenden Möglichkeiten?

    [autoit]


    dim $a = "1"
    dim $b = "2"

    [/autoit][autoit][/autoit][autoit]

    ;~ tausch1()
    ;~ tausch2()

    [/autoit][autoit][/autoit][autoit]

    func tausch1()
    $a = BitXOR($a, $b)
    $b = BitXOR($a, $b)
    $a = BitXOR($a, $b)
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    func tausch2()
    $tmp = $a
    $a = $b
    $b = $tmp
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    MsgBox(0,"","$a = " & $a & @CRLF & _
    "$b = " & $b)

    [/autoit]

    Im Endeffekt kommt je das gleiche raus, nur eben einmal mit und einmal ohne Hilfsvariable (dementsprechend Auskommentierung entfernen).

    Gruß
    x0r

  • Bit-Anzeiger

    • x0r
    • 27. April 2013 um 12:59

    püh!!!!!! :thumbup:

  • Bit-Anzeiger

    • x0r
    • 26. April 2013 um 23:52

    Hi,

    kein Plan, wofür man das brauchen könnte (vermutlich zum "lernen" :D)

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Form1_1 = GUICreate("Bit Anzeiger", 226, 83, 192, 114)
    $Button1 = GUICtrlCreateButton("0", 16, 16, 19, 25, $WS_GROUP)
    $Button2 = GUICtrlCreateButton("0", 40, 16, 19, 25, $WS_GROUP)
    $Button3 = GUICtrlCreateButton("0", 64, 16, 19, 25, $WS_GROUP)
    $Button4 = GUICtrlCreateButton("0", 88, 16, 19, 25, $WS_GROUP)
    $Label1 = GUICtrlCreateLabel("•", 112, 32, 8, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Button5 = GUICtrlCreateButton("0", 120, 16, 19, 25, $WS_GROUP)
    $Button6 = GUICtrlCreateButton("0", 144, 16, 19, 25, $WS_GROUP)
    $Button7 = GUICtrlCreateButton("0", 168, 16, 19, 25, $WS_GROUP)
    $Button8 = GUICtrlCreateButton("0", 192, 16, 19, 25, $WS_GROUP)
    $out = GUICtrlCreateInput("", 16, 48, 65, 21)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Button1
    GUICtrlSetData($Button1, BitXOR(GUICtrlRead($Button1),1))
    GUICtrlSetData($out, bin2dec(GUICtrlRead($Button1) & GUICtrlRead($Button2) & GUICtrlRead($Button3) & GUICtrlRead($Button4) & _
    GUICtrlRead($Button5) & GUICtrlRead($Button6) & GUICtrlRead($Button7) & GUICtrlRead($Button8)))
    Case $Button2
    GUICtrlSetData($Button2, BitXOR(GUICtrlRead($Button2),1))
    GUICtrlSetData($out, bin2dec(GUICtrlRead($Button1) & GUICtrlRead($Button2) & GUICtrlRead($Button3) & GUICtrlRead($Button4) & _
    GUICtrlRead($Button5) & GUICtrlRead($Button6) & GUICtrlRead($Button7) & GUICtrlRead($Button8)))
    Case $Button3
    GUICtrlSetData($Button3, BitXOR(GUICtrlRead($Button3),1))
    GUICtrlSetData($out, bin2dec(GUICtrlRead($Button1) & GUICtrlRead($Button2) & GUICtrlRead($Button3) & GUICtrlRead($Button4) & _
    GUICtrlRead($Button5) & GUICtrlRead($Button6) & GUICtrlRead($Button7) & GUICtrlRead($Button8)))
    Case $Button4
    GUICtrlSetData($Button4, BitXOR(GUICtrlRead($Button4),1))
    GUICtrlSetData($out, bin2dec(GUICtrlRead($Button1) & GUICtrlRead($Button2) & GUICtrlRead($Button3) & GUICtrlRead($Button4) & _
    GUICtrlRead($Button5) & GUICtrlRead($Button6) & GUICtrlRead($Button7) & GUICtrlRead($Button8)))
    Case $Button5
    GUICtrlSetData($Button5, BitXOR(GUICtrlRead($Button5),1))
    GUICtrlSetData($out, bin2dec(GUICtrlRead($Button1) & GUICtrlRead($Button2) & GUICtrlRead($Button3) & GUICtrlRead($Button4) & _
    GUICtrlRead($Button5) & GUICtrlRead($Button6) & GUICtrlRead($Button7) & GUICtrlRead($Button8)))
    Case $Button6
    GUICtrlSetData($Button6, BitXOR(GUICtrlRead($Button6),1))
    GUICtrlSetData($out, bin2dec(GUICtrlRead($Button1) & GUICtrlRead($Button2) & GUICtrlRead($Button3) & GUICtrlRead($Button4) & _
    GUICtrlRead($Button5) & GUICtrlRead($Button6) & GUICtrlRead($Button7) & GUICtrlRead($Button8)))
    Case $Button7
    GUICtrlSetData($Button7, BitXOR(GUICtrlRead($Button7),1))
    GUICtrlSetData($out, bin2dec(GUICtrlRead($Button1) & GUICtrlRead($Button2) & GUICtrlRead($Button3) & GUICtrlRead($Button4) & _
    GUICtrlRead($Button5) & GUICtrlRead($Button6) & GUICtrlRead($Button7) & GUICtrlRead($Button8)))
    Case $Button8
    GUICtrlSetData($Button8, BitXOR(GUICtrlRead($Button8),1))
    GUICtrlSetData($out, bin2dec(GUICtrlRead($Button1) & GUICtrlRead($Button2) & GUICtrlRead($Button3) & GUICtrlRead($Button4) & _
    GUICtrlRead($Button5) & GUICtrlRead($Button6) & GUICtrlRead($Button7) & GUICtrlRead($Button8)))
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func bin2dec($strBin)
    Local $Return
    Local $lngResult
    Local $intIndex

    [/autoit] [autoit][/autoit] [autoit]

    If StringRegExp($strBin,'[0-1]') then
    $lngResult = 0
    For $intIndex = StringLen($strBin) to 1 step -1
    $strDigit = StringMid($strBin, $intIndex, 1)
    Select
    case $strDigit="0"
    case $strDigit="1"
    $lngResult = $lngResult + (2 ^ (StringLen($strBin)-$intIndex))
    case else
    $lngResult = 0
    $intIndex = 0
    EndSelect
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $Return = $lngResult
    Return $Return
    EndIf
    EndFunc

    [/autoit]

    Beschreibung: Selbsterklärend!

    Gruß
    x0r

  • HTML Quelltext nach Stringmuster parsen und in eine Datei schreiben

    • x0r
    • 25. April 2013 um 20:22

    Andere ID:

    [autoit]

    $line = _stringbetween($str,'id=','"')

    [/autoit]

    ...für die kleine Änderung am Script lern ich mich jetzt nicht extra in Regex ein ;)

    Man kann auch so ganz gut die Probleme lösen, wenn auch manchmal ein wenig umständlich.

  • HTML Quelltext nach Stringmuster parsen und in eine Datei schreiben

    • x0r
    • 25. April 2013 um 16:21

    Kein Thema, gern geholfen! :)

    Ich löse in der Firma meine "Webseite-auslesen"-Aufgaben immer so, ist sehr praktisch, grade in Verbindung mit "_InetGetSource()".

    Gruß
    x0r

  • HTML Quelltext nach Stringmuster parsen und in eine Datei schreiben

    • x0r
    • 25. April 2013 um 15:54

    hi,

    mit _stringbetween() biste ganz gut beraten, denk ich :)

    [autoit]

    #include <string.au3>
    $str = "dein quelltext" ;oder mit clipget() oder direkt über _inetgetsource()
    $line = _stringbetween($str,'id=zksMID','"')

    [/autoit][autoit][/autoit][autoit]

    for $i = 0 to ubound($line)-1
    filewrite("deinetxt.txt",$line[$i])
    next

    [/autoit]

    musst evtl noch bissl umbauen, is nur kurz hingeklatscht :D

  • Autostart Prog

    • x0r
    • 25. April 2013 um 15:38

    Hi,

    wer keine Lust hat, in seinem Autostart-Ordner eine Verknüpfung anzulegen oder Dateien da rein zu kopieren (ist subjektiv betrachtet extrem nervend), kann Folgendes nutzen (so dachte ich es mir jedenfalls :D):

    Spoiler anzeigen
    [autoit]

    ;GUI Autostart

    [/autoit] [autoit][/autoit] [autoit]

    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    dim $toggle = 1
    dim $ini = @UserProfileDir & "\autostart.ini"

    [/autoit] [autoit][/autoit] [autoit]

    HotKeySet("^{F12}","guitoggle")

    [/autoit] [autoit][/autoit] [autoit]

    #include <date.au3>
    #include <file.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIComboBoxEx.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Autostart GUI by x0r", 627, 454, 192, 114, Default, $WS_EX_ACCEPTFILES)
    $list = GUICtrlCreateList("", 16, 48, 481, 383)
    $addin = GUICtrlCreateInput("", 16, 16, 593, 21)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    $add = GUICtrlCreateButton("Hinzufügen", 512, 48, 99, 25, $WS_GROUP)
    $del = GUICtrlCreateButton("Löschen", 512, 80, 99, 25, $WS_GROUP)
    $runini = GUICtrlCreateButton("ini öffnen", 512, 300, 99, 25, $WS_GROUP)
    $xit = GUICtrlCreateButton("Beenden", 512, 408, 99, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    guitoggle()
    fillbox()
    startup()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $add
    saveds()
    GUICtrlSetData($addin,"")
    Case $del
    deleteentry()
    Case $runini
    ShellExecute($ini)
    Case $xit
    Exit
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    func startup()
    $cnt = _FileCountLines($ini)
    For $i = 2 to $cnt
    $sec = FileReadLine($ini, $i)
    $sec = StringSplit($sec,"=")
    if $sec[2] <> "" then
    ShellExecute($sec[2])
    sleep(500) ;Timer je nach Bedarf
    EndIf
    Next
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    func guitoggle()
    $toggle = BitXOR($toggle,1)
    if $toggle = 1 Then GUISetState(@SW_SHOW)
    if $toggle = 0 Then GUISetState(@SW_HIDE)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func fillbox()
    GUICtrlSetData($list, "")
    $cnt = _FileCountLines($ini)
    For $i = 2 to $cnt
    $sec = FileReadLine($ini, $i)
    GUICtrlSetData($list, $sec)
    Next
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func saveds()
    Local $additem = GUICtrlRead($addin)
    if $additem <> "" then IniWrite($ini, "start", _Now(), $additem)
    fillbox()
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func deleteentry()
    if GUICtrlRead($list) <> "" Then
    local $reallydel = MsgBox(36, "Eintrag löschen", "Sicher?")
    If $reallydel = 6 Then
    Local $proj1 = GUICtrlRead($list)
    $proj1 = StringSplit($proj1,"=")
    IniDelete($ini, "start", $proj1[1])
    fillbox()
    EndIf
    EndIf
    EndFunc

    [/autoit]


    Das Teil einfach kompiliert in besagten Ordner und schon hat man so ne Art "Autostart-Manager".

    Es ist eigentlich selbsterklärend:

    Kurze Beschreibung:
    - beim Start (und nur da) führt es eingetragene Programme aus, wenn nix drin steht, öffnet sich auch nix
    - wird mittels "Strg+F12" geöffnet und wieder versteckt (toggle)
    - GUI ist "Drag & Drop", das heisst man kann gewünschte Dateien einfach in die obere Zeile ziehen und dann "Hinzufügen"
    - Löschen gibts natürlich auch
    - man kann die ini direkt öffnen (welche im @UserProfileDir liegt)
    - und beenden über den Button "Beenden" oder "ESC"

    Viel Spass damit oder auch nicht :)

    Gruß
    x0r

  • Mit StringRegExp Umlaute in HTML Code finden

    • x0r
    • 23. April 2013 um 16:44

    Hi,

    so löse ich immer eventuelle Quelltext-Abfragen:

    Spoiler anzeigen
    [autoit]

    #include <inet.au3>
    #include <string.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $src = _INetGetSource("http://translation.autoit.de/onlinehilfe/libfunctions/_INetGetSource.htm")
    $src = _StringBetween($src, '<p class="funcdesc">','<br>')

    [/autoit] [autoit][/autoit] [autoit]

    MsgBox(0,"", $src[0])

    [/autoit]

    Hier werden die Umlaute korrekt wieder gegeben.

    Gruß
    x0r

  • Kann Fenester nicht auswählen bzw. schließen

    • x0r
    • 22. April 2013 um 16:52

    wie wärs mit:

    [autoit]

    if winexists("Digigram Drivers") then winclose("Digigram Drivers")

    [/autoit]

    oder:

    [autoit]

    if processexists("prozessname deines fensters") then processclose("prozessname deines fensters")

    [/autoit]

    P.S.: Wenn die Möglichkeiten schon genannt wurden, sorry, ich hab mir nich alles durchgelesen! :D

  • Aus "b" mache Linksklick bis andere Taste gedrückt wird

    • x0r
    • 22. April 2013 um 13:08

    Linksklick per Fussschalter - noch nie was seltsameres gelesen :D

  • Binäre Uhr

    • x0r
    • 22. April 2013 um 08:37
    Zitat von m-obi

    Das ist meine _DecToBin.

    ...funktioniert hervorragend! :D

  • Binäre Uhr

    • x0r
    • 19. April 2013 um 10:14

    Hi,

    habe eben meine ersten Versuche entdeckt, dezimale in binäre Zahlen umzuwandeln. Rausgekommen ist eine Uhr mit Radiobuttons :)

    Leider hab ich irgendwann die "dec2bin()"-Funktion ausgewechselt, ist also nicht mehr ganz original nur von mir :(

    Spoiler anzeigen
    [autoit]

    ;binary clock

    [/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Form1_1 = GUICreate("Binary Clock", 504, 114, 192, 114)
    GUIStartGroup()
    $H16 = GUICtrlCreateRadio("", 16, 56, 17, 17)
    GUIStartGroup()
    GUICtrlSetState(-1,$gui_disable)
    $H8 = GUICtrlCreateRadio("", 40, 56, 17, 17)
    GUIStartGroup()
    GUICtrlSetState(-1,$gui_disable)
    $H4 = GUICtrlCreateRadio("", 64, 56, 17, 17)
    GUIStartGroup()
    GUICtrlSetState(-1,$gui_disable)
    $H2 = GUICtrlCreateRadio("", 88, 56, 17, 17)
    GUIStartGroup()
    GUICtrlSetState(-1,$gui_disable)
    $H1 = GUICtrlCreateRadio("", 112, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)

    [/autoit] [autoit][/autoit] [autoit]

    $Label1 = GUICtrlCreateLabel("16 8 4 2 1", 16, 40, 109, 17)
    $Label2 = GUICtrlCreateLabel("Stunden", 50, 16, 51, 17)
    GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")

    [/autoit] [autoit][/autoit] [autoit]

    GUIStartGroup()
    $M32 = GUICtrlCreateRadio("", 168, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $M16 = GUICtrlCreateRadio("", 192, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $M8 = GUICtrlCreateRadio("", 216, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $M4 = GUICtrlCreateRadio("", 240, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $M2 = GUICtrlCreateRadio("", 264, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $M1 = GUICtrlCreateRadio("", 288, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)

    [/autoit] [autoit][/autoit] [autoit]

    $Label3 = GUICtrlCreateLabel("32 16 8 4 2 1", 168, 40, 133, 17)
    $Label4 = GUICtrlCreateLabel("Minuten", 200, 16, 49, 17)
    GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")
    $Label8 = GUICtrlCreateLabel("°", 144, 56, 15, 17)
    GUICtrlSetFont(-1, 25, 400, 0, "MS Sans Serif")
    $Label7 = GUICtrlCreateLabel("°", 144, 32, 15, 17)
    GUICtrlSetFont(-1, 25, 400, 0, "MS Sans Serif")

    [/autoit] [autoit][/autoit] [autoit]

    GUIStartGroup()
    $S32 = GUICtrlCreateRadio("", 344, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $S16 = GUICtrlCreateRadio("", 368, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $S8 = GUICtrlCreateRadio("", 392, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $S4 = GUICtrlCreateRadio("", 416, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $S2 = GUICtrlCreateRadio("", 440, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)
    GUIStartGroup()
    $S1 = GUICtrlCreateRadio("", 464, 56, 17, 17)
    GUICtrlSetState(-1,$gui_disable)

    [/autoit] [autoit][/autoit] [autoit]

    $Label9 = GUICtrlCreateLabel("32 16 8 4 2 1", 344, 40, 133, 17)
    $Label10 = GUICtrlCreateLabel("Sekunden", 370, 16, 61, 17)
    GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")
    $Label12 = GUICtrlCreateLabel("°", 320, 56, 15, 25)
    GUICtrlSetFont(-1, 25, 400, 0, "MS Sans Serif")
    $Label13 = GUICtrlCreateLabel("°", 320, 32, 15, 25)
    GUICtrlSetFont(-1, 25, 400, 0, "MS Sans Serif")

    [/autoit] [autoit][/autoit] [autoit]

    $Label5 = GUICtrlCreateLabel("", 65, 80, 42, 17)
    $Label6 = GUICtrlCreateLabel("", 216, 80, 42, 17)
    $Label11 = GUICtrlCreateLabel("", 392, 80, 42, 17)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    dim $hour, $minute, $second

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    dobinary()

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetData($label11,@SEC)
    GUICtrlSetData($label5,@HOUR)
    GUICtrlSetData($label6,@MIN)

    [/autoit] [autoit][/autoit] [autoit]

    sleep(90)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    func dobinary()
    $hour = @HOUR
    $minute = @MIN
    $second = @SEC

    [/autoit] [autoit][/autoit] [autoit]

    if $hour > 0 Then $hour = dec2bin($hour)
    if $hour = 0 then $hour = "00000"

    [/autoit] [autoit][/autoit] [autoit]

    if $minute > 0 Then $minute = dec2bin($minute)
    if $minute = 0 then $minute = "000000"

    [/autoit] [autoit][/autoit] [autoit]

    if $second > 0 Then $second = dec2bin($second)
    if $second = 0 then $second = "000000"

    [/autoit] [autoit][/autoit] [autoit]

    setbinh($hour)
    setbinm($minute)
    setbins($second)

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    func setbins($second)
    local $arys[6]
    for $i = 1 to UBound($arys)
    $arys[$i-1] = StringMid($second,$i,1)
    Next
    if $arys[0] = 0 then GUICtrlSetState($S32,$GUI_UNCHECKED)
    if $arys[0] = 1 then GUICtrlSetState($S32,$GUI_CHECKED)
    if $arys[1] = 0 then GUICtrlSetState($S16,$GUI_UNCHECKED)
    if $arys[1] = 1 then GUICtrlSetState($S16,$GUI_CHECKED)
    if $arys[2] = 0 then GUICtrlSetState($S8,$GUI_UNCHECKED)
    if $arys[2] = 1 then GUICtrlSetState($S8,$GUI_CHECKED)
    if $arys[3] = 0 then GUICtrlSetState($S4,$GUI_UNCHECKED)
    if $arys[3] = 1 then GUICtrlSetState($S4,$GUI_CHECKED)
    if $arys[4] = 0 then GUICtrlSetState($S2,$GUI_UNCHECKED)
    if $arys[4] = 1 then GUICtrlSetState($S2,$GUI_CHECKED)
    if $arys[5] = 0 then GUICtrlSetState($S1,$GUI_UNCHECKED)
    if $arys[5] = 1 then GUICtrlSetState($S1,$GUI_CHECKED)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    func setbinm($minute)
    local $arym[6]
    for $i = 1 to UBound($arym)
    $arym[$i-1] = StringMid($minute,$i,1)
    Next
    if $arym[0] = 0 then GUICtrlSetState($M32,$GUI_UNCHECKED)
    if $arym[0] = 1 then GUICtrlSetState($M32,$GUI_CHECKED)
    if $arym[1] = 0 then GUICtrlSetState($M16,$GUI_UNCHECKED)
    if $arym[1] = 1 then GUICtrlSetState($M16,$GUI_CHECKED)
    if $arym[2] = 0 then GUICtrlSetState($M8,$GUI_UNCHECKED)
    if $arym[2] = 1 then GUICtrlSetState($M8,$GUI_CHECKED)
    if $arym[3] = 0 then GUICtrlSetState($M4,$GUI_UNCHECKED)
    if $arym[3] = 1 then GUICtrlSetState($M4,$GUI_CHECKED)
    if $arym[4] = 0 then GUICtrlSetState($M2,$GUI_UNCHECKED)
    if $arym[4] = 1 then GUICtrlSetState($M2,$GUI_CHECKED)
    if $arym[5] = 0 then GUICtrlSetState($M1,$GUI_UNCHECKED)
    if $arym[5] = 1 then GUICtrlSetState($M1,$GUI_CHECKED)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    func setbinh($hour)
    local $aryh[6]
    for $i = 1 to UBound($aryh)
    $aryh[$i-1] = StringMid($hour,$i,1)
    Next
    ;~ if $aryh[0] = 0 then GUICtrlSetState($H32,$GUI_UNCHECKED)
    ;~ if $aryh[0] = 1 then GUICtrlSetState($H32,$GUI_CHECKED)
    if $aryh[1] = 0 then GUICtrlSetState($H16,$GUI_UNCHECKED)
    if $aryh[1] = 1 then GUICtrlSetState($H16,$GUI_CHECKED)
    if $aryh[2] = 0 then GUICtrlSetState($H8,$GUI_UNCHECKED)
    if $aryh[2] = 1 then GUICtrlSetState($H8,$GUI_CHECKED)
    if $aryh[3] = 0 then GUICtrlSetState($H4,$GUI_UNCHECKED)
    if $aryh[3] = 1 then GUICtrlSetState($H4,$GUI_CHECKED)
    if $aryh[4] = 0 then GUICtrlSetState($H2,$GUI_UNCHECKED)
    if $aryh[4] = 1 then GUICtrlSetState($H2,$GUI_CHECKED)
    if $aryh[5] = 0 then GUICtrlSetState($H1,$GUI_UNCHECKED)
    if $aryh[5] = 1 then GUICtrlSetState($H1,$GUI_CHECKED)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func dec2bin($Decimal, $MaxLen=10, $DontAddLeadingZeros=False, $ErrorOnMoreThanOneByte=True)
    $Decimal = $Decimal + 1
    If $Decimal > 256 And $ErrorOnMoreThanOneByte = True Then
    SetError(1)
    Return ''
    EndIf
    Local $Binary = ''
    For $i = $MaxLen To 0 Step -1
    Local $TempVar1 = $Decimal - (2^$i)
    If $TempVar1 <= 0 Then
    $Binary &= '0'
    Else
    $Decimal -= 2^$i
    $Binary &= '1'
    EndIf
    Next
    Do
    Local $TempVar2 = StringLeft($Binary, 1)
    If $TempVar2 = 0 Then
    $Binary = StringTrimLeft($Binary, 1)
    EndIf
    Until $TempVar2 = 1
    Local $TempVar3 = StringLen($Binary)
    Local $TempVar4 = ''
    If $TempVar3 < 6 And $DontAddLeadingZeros = False Then
    For $i = $TempVar3+1 To 6 Step 1
    $TempVar4 &= '0'
    Next
    $Binary = $TempVar4 & $Binary
    ElseIf $TempVar3 > 6 And $ErrorOnMoreThanOneByte = True Then
    SetError(1)
    Return ''
    EndIf
    Return $Binary
    EndFunc

    [/autoit]

    Gruß
    x0r

  • Zahlen in Worte umwandeln

    • x0r
    • 18. April 2013 um 08:21

    das is mal interessant...

    mal sehen, wann ich zum fixen komme, momentan is bissl viel auf arbeit :thumbdown:

    danke für den tipp ;)

  • Zahlen in Worte umwandeln

    • x0r
    • 17. April 2013 um 10:52

    wow du hast recht, danke! :)

    €dit: Fixed! :D

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™