ah ok achso...
Aber ich glaub so ist es trotzdem besser
Beiträge von stayawayknight
-
-
So... hab dann das mit der Einstellungsmöglichkeit fertig... speichert die gewünschten Hotkeys in einer ini ab und ruft diese beim Programmstart automatisch ab.
Die Einstellungshotkey lässt sich nicht verändern, da man die sonst nimmer findet wenn man alles verändert...Vielen Dank dabei an Alizame, der die Zufallsfunktion geschrieben hat und auch vielen Dank an Schnitzel, der mir eine Frage wegen Variabeln in Hotkeys beantwortet hat.
So das ist der Wiedergabelistenersteller:
Spoiler anzeigen
[autoit]#include <GUIConstants.au3>
[/autoit] [autoit][/autoit] [autoit]$count = 1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$file = @WindowsDir
$countr = 1
$i = 0
$f = 0
Dim $read[500]$form = GUICreate("RemiXXer by stay", 625, 443, 193, 125)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$list = GUICtrlCreateList("", 40, 96, 377, 188)
$load = GUICtrlCreateButton("Neuen Song laden", 440, 112, 129, 41, 0)
$label1 = GUICtrlCreateLabel("RemiXXer", 72, 0, 304, 84)
GUICtrlSetFont(-1, 70, 400, 0, "MS Sans Serif")
$delete = GUICtrlCreateButton("Liste löschen", 440, 168, 129, 41, 0)
$run = GUICtrlCreateButton("Start Player!", 440, 224, 129, 41, 0)
$exit = GUICtrlCreateButton("Exit", 440, 368, 129, 41, 0)
$loadoldlist = GUICtrlCreateButton("Alte Liste laden", 100, 368, 129, 41, 0)
GUISetState(@SW_SHOW)While 1
[/autoit] [autoit][/autoit] [autoit]
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ex()Case $delete
[/autoit] [autoit][/autoit] [autoit]
delete()Case $load
[/autoit] [autoit][/autoit] [autoit]
load()Case $exit
[/autoit] [autoit][/autoit] [autoit]
ex()Case $run
[/autoit] [autoit][/autoit] [autoit]
run("playcatcher.exe")
ExitCase $loadoldlist
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
loadold()EndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndFunc load()
[/autoit] [autoit][/autoit] [autoit]
if FileExists("playlist.ini") Then
FileDelete("playlist.ini")
EndIf
$file = FileOpenDialog("Titel hinzufügen", $file, "Sounddateien (*.mp3;*.wma;*.wav)")
IniWrite(@ScriptDir & "\playlist.ini", "Playlist", $count, $file)
GUIctrlsetdata($list, $file)$count = $count + 1
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit] [autoit][/autoit] [autoit]Func loadold()
[/autoit] [autoit][/autoit] [autoit]
While 1
$i = $i + 1 ; für auslesearray
$f = $f + 1 ;
$read[$i] = IniRead("playlist.ini", "Playlist", $f, "")
if $read[$i] = "" Then
ExitLoop
Else
GUICtrlSetData($list, $read[$i])
EndIf
WEndEndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func delete()
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetData($list, "")
FileDelete("playlist.ini")
EndFuncFunc ex()
[/autoit] [autoit][/autoit] [autoit]
MsgBox(0, "Auf Wiedersehen!", "Auf Wiedersehen, bis zum nächsten Mal! By stayawayknight")
ExitEndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit]
;Benötigt playcatcher.exe!Und das der Player:
Spoiler anzeigen
[autoit]#include <Sound.au3>
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
#include <GUIConstants.au3>$playk = "p"
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$stopk = "s"
$nextk = "n"
$endk = "e"
$backk = "b"
$volumek = "v"
$zufallk = "z"if Not FileExists("hotkeys.remix") Then
[/autoit] [autoit][/autoit] [autoit]
IniWrite("hotkeys.remix", "Hotkeys", "play", $playk)
IniWrite("hotkeys.remix", "Hotkeys", "stop", $stopk)
IniWrite("hotkeys.remix", "Hotkeys", "next", $nextk)
IniWrite("hotkeys.remix", "Hotkeys", "end", $endk)
IniWrite("hotkeys.remix", "Hotkeys", "back", $backk)
IniWrite("hotkeys.remix", "Hotkeys", "volume", $volumek)
IniWrite("hotkeys.remix", "Hotkeys", "zufall", $zufallk)Else
[/autoit] [autoit][/autoit] [autoit]$playk = IniRead("hotkeys.remix", "Hotkeys", "play", "")
[/autoit] [autoit][/autoit] [autoit]
$stopk = IniRead("hotkeys.remix", "Hotkeys", "stop", "")
$nextk = IniRead("hotkeys.remix", "Hotkeys", "next", "")
$endk = IniRead("hotkeys.remix", "Hotkeys", "end", "")
$backk = IniRead("hotkeys.remix", "Hotkeys", "back", "")
$volumek = IniRead("hotkeys.remix", "Hotkeys", "volume", "")
$zufallk = IniRead("hotkeys.remix", "Hotkeys", "zufall", "")EndIf
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]HotkeySet("!{" & $playk & "}", "play")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
HotKeySet("!{" & $stopk & "}", "stop")
HotKeySet("!{" & $nextk & "}", "nexts")
HotKeySet("!{" & $endk & "}", "ende")
HotKeySet("!{" & $backk & "}", "back")
HotKeySet("!{" & $volumek & "}", "volume")
HotKeySet("!{" & $zufallk & "}", "zufall")
HotkeySet("!{w}", "settings")$settingwindow = GUICreate("Einstellungen", 625, 416, 193, 125)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$play = GUICtrlCreateInput("", 160, 24, 137, 21)
$stop = GUICtrlCreateInput("", 160, 64, 137, 21)
$next = GUICtrlCreateInput("", 160, 104, 137, 21)
$ende = GUICtrlCreateInput("", 160, 141, 137, 21)
$back = GUICtrlCreateInput("", 160, 182, 137, 21)
$volume = GUICtrlCreateInput("", 160, 221, 137, 21)
$zufall = GUICtrlCreateInput("", 160, 257, 137, 21)
$Label1 = GUICtrlCreateLabel("Playtaste: alt +", 56, 24, 80, 17)
$Label2 = GUICtrlCreateLabel("Stoptaste: alt +", 56, 65, 80, 17)
$Label3 = GUICtrlCreateLabel("Nexttaste: alt +", 56, 105, 80, 17)
$Label4 = GUICtrlCreateLabel("Endetaste: alt +", 56, 142, 80, 17)
$Label5 = GUICtrlCreateLabel("Backtaste: alt +", 56, 184, 80, 17)
$Label6 = GUICtrlCreateLabel("Vol. -taste: alt +", 56, 218, 80, 17)
$Label7 = GUICtrlCreateLabel("Zufallstaste: alt +", 56, 254, 80, 17)
$Label8 = GUICtrlCreateLabel($playk & " (momentan)", 344, 24, 80, 17)
$Label9 = GUICtrlCreateLabel($stopk & " (momentan)", 344, 70, 80, 17)
$Label10 = GUICtrlCreateLabel($nextk & " (momentan)", 344, 107, 80, 17)
$Label11 = GUICtrlCreateLabel($endk & " (momentan)", 344, 149, 80, 17)
$Label12 = GUICtrlCreateLabel($backk & " (momentan)", 344, 183, 80, 17)
$Label13 = GUICtrlCreateLabel($volumek & " (momentan)", 344, 223, 80, 17)
$Label14 = GUICtrlCreateLabel($zufallk & " (momentan)", 344, 258, 80, 17)
$okbutton = GUICtrlCreateButton("Speichern", 257, 345, 129, 41, 0)
GUISetState(@SW_Hide)$a = 0 ; bewirkt die untilschleife und bricht play1 ab, wenn next kommt
[/autoit] [autoit][/autoit] [autoit]
$count = 1 ; zählt songs$vol = 75
[/autoit] [autoit][/autoit] [autoit]Msgbox(0, "Start", "Folgende Hotkeys sind wichtig: Alt+" & $playk & " = Play, Alt+" & $stopk & " = Stop, Alt+" & $nextk & " = Next Song , Alt+" & $backk & " = Song Back, Alt+" & $volumek & " = Volume, Alt+" & $zufallk & " = Zufallsmodus, Alt+W = Einstellungsmenü und Alt+" & $endk & " = Ende.")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func play()
[/autoit] [autoit][/autoit] [autoit]Do
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$file = IniRead("playlist.ini", "Playlist", $count, "")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$lengh = _SoundLength ($file, 2)
SoundPlay($file)
ToolTip("Play")
Sleep(2000)
ToolTip("")
Sleep($lengh)
$count = $count + 1Until $a = 1
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func ende()
[/autoit] [autoit][/autoit] [autoit]
Tooltip("Ende, wird beendet ...")
Sleep(2000)
ExitEndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func volume()
[/autoit] [autoit][/autoit] [autoit]$vol = Inputbox("Lautstärke", "Gib die gewünschte Lautstärke (1-100) ein! Momentan: " & $vol)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
SoundSetWaveVolume($vol)EndFunc
[/autoit] [autoit][/autoit] [autoit]Func stop()
[/autoit] [autoit][/autoit] [autoit]
Run("playcatcher.exe")
Exit
EndFuncFunc nexts()
[/autoit] [autoit][/autoit] [autoit]
$a = 1
$count = $count + 1
ToolTip("Next")
Sleep(2000)
play()
$a = 0
EndFuncFunc back()
[/autoit] [autoit][/autoit] [autoit]
$a = 1
$count = $count - 1
ToolTip("Back")
Sleep(2000)
play()
$a = 0
EndFuncFunc zufall ()
[/autoit] [autoit][/autoit] [autoit]
Do
$file = IniRead("playlist.ini", "Playlist", Random( 1, _FileCountLines("playlist.ini"),1) , "")
$lengh = _SoundLength ($file, 2)
SoundPlay($file)
ToolTip("Play")
Sleep(2000)
ToolTip("")
Sleep($lengh)
$count = $count + 1
Until $a = 1
EndFuncFunc settings()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_SHOW)While 1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$msg = GuiGetMsg()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Select
Case $msg = $okbutton$playk = GUICtrlRead($play)
[/autoit] [autoit][/autoit] [autoit]
$stopk = GUICtrlRead($stop)
$nextk = GUICtrlRead($next)
$endk = GUICtrlRead($ende)
$backk = GUICtrlRead($back)
$volumek = GUICtrlRead($volume)
$zufallk = GUICtrlRead($zufall)IniWrite("hotkeys.remix", "Hotkeys", "play", $playk)
[/autoit] [autoit][/autoit] [autoit]
IniWrite("hotkeys.remix", "Hotkeys", "stop", $stopk)
IniWrite("hotkeys.remix", "Hotkeys", "next", $nextk)
IniWrite("hotkeys.remix", "Hotkeys", "end", $endk)
IniWrite("hotkeys.remix", "Hotkeys", "back", $backk)
IniWrite("hotkeys.remix", "Hotkeys", "volume", $volumek)
IniWrite("hotkeys.remix", "Hotkeys", "zufall", $zufallk)ToolTip("Gespeichert, aktuellisiere ... ")
[/autoit] [autoit][/autoit] [autoit]
Sleep(2000)Run("playcatcher.exe")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
ExitEndSelect
[/autoit] [autoit][/autoit] [autoit]
WEnd
EndFuncWhile 1
[/autoit]
WEndViel Spaß damit, für Kritik immer offen
-
jap ist auch (so wie ich finde) um einiges praktischer
-
wär vll. hilfreich wenn du dein jetziges script noch einmal posten würdest, dann weiß man wie' s steht etc.
-
verdammt das Ding ist ja schon alt!
-
ändere das:
[autoit]While 1
[/autoit]
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then Exit
WEndmal in das um:
[autoit]
[/autoit]
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEndist übersichtlicher falls du noch mehr Funktionen einbauen willst
-
OK,
@Ubuntu: Nein, ich meine halt das ich sonst verdammt viel noch aufzählen müsste wenn man für jede Sportart den Namen hinschreibt... Und außerdem würden kaum welche dafür stimmen.. -
Ja, sehr nützlich!
-
Kopier das programm doch in den Autostartordner mit folgendem Befehl:
[autoit]FileCopy("PfadzumProgramm", @StartupDir) ; Kopiert den angegebenen Pfad in den Autostartordner (der ist irgendwo als versteckter Ordner gespeichert)
[/autoit] -
das wurde irgendwie schon sehr oft hier gefragt vor allem wenn man unten mal bei "ähnliche Themen" schaut
PS: Willkommen hier!
-
aber normal werden doch die entsprechenden Hotkeyfunktionen für andere Programme solange geblockt, bis Autoit sie nicht mehr benötigt, oder?
-
Es gibt nur zurück ob die angegebene Taste gedrückt wurde
-
also falls das Beep über Systemlautsprechern abgespielt wird, kann man da die Lautstärke nicht regulieren, soweit ich weiß..
Bei mir wird das Beep aber nicht über Systemlautsprecher sondern die normalen Hardwarelautsprecher abgespielt...
Da kann man dann die Lautstärke regulieren, hab mir mal ne Klaviatur gebaut, ist lustig -
zur sinnvollen Anwendung: Könnte mir da durchaus etwas vorstellen, z.B. wenn man versehehntlich immer eine bestimmte Kombination drückt, die dann eine unerwünschte Aktion
auslöst, ist die Frage wie oft das vorkommt...
Ist nicht so schmerzhaft wie die Bügeleisenvariante -
ich glaub das war eins wo einer in Paint gezeichnet hat, also per bot
-
Danke an alle! Besonders an Schnitzel, habt mir sehr geholfen! => Problem gelöst
-
ok danke... _ispressed hilft mir in dem fall nicht weiter, aber trotzdem mal danke....
ist jetzt auch egal ist nicht sonderlich wichtig -
sollte ich auch eintragen aber da muss ein übergeordneter begriff her ...
-
japp echt nett und irgendwie auch lustig
-
Hallo!
[autoit]
Ich habe eine Frage und zwar: Ist es möglich eine Variable in ein Hotkey einzubauen? Also in etwa so:$key = "F1"
[/autoit]
HotKeySet("!{$key}")
Nur tut das so noch nicht, weil das ja in "..." steht.
Hat jemand ne Idee? Glaub nicht das das allzu schwer ist, nur komm ich nicht drauf
Wär nett wenn mir jemand helfen könnte!