Jump to content

NEO12

Members
  • Posts

    14
  • Joined

  • Last visited

NEO12's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. That's right: Sébastien a publiAc quelque chose sur votre mur. That should appear in the place of "... wrote something on your wall" that acually should be "... published something on your wall". I've searched for "rss help" but i didn't find something that interested me. I'm not a great coder and before i posted i searched also on google but again found nothing. I'm just beginning here with autoit again, because i was occuped with something other (Private) I think i must look around this: code of gui... $baseurl = "http://www.facebook.com/feeds/notifications.php?id=100000295219880&viewer=100000295219880&key=683ac29a17&format=rss20" $source = _InetGetSource($baseurl) $array = StringRegExp($source, "(?i)(?s)<title>(.+?)</title>", 3) GUICtrlCreateLabel($array, 5, 30, 200, 20) while... Ok i found it : ;#NoTrayIcon #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Array.au3> #include <Inet.au3> $width = 300 $height = 90 $xa = @DesktopWidth - $width - 5 $ya = @DesktopHeight - $height - 50 $GUi = GUICreate("Facebook Notification", $width, $height, $xa, $ya, $WS_POPUPWINDOW, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) $label = GUICtrlCreateLabel("Facebook Notification", 5, 5, 130, 20) $baseurl = "http://www.facebook.com/feeds/notifications.php?id=100000295219880&viewer=100000295219880&key=683ac29a17&format=rss20" $source = _InetGetSource($baseurl) $array = StringRegExp($source, "(?i)(?s)<title>(.+?)</title>", 3) GUICtrlCreateLabel($array[1], 5, 30, 200, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd I must only improve it a little bit Thank you very much.
  2. Ok But i'm looking for something that looks like my second post. With the function GUICtrlSetData($label2,$array) even if it's with or without array. http://www.autoitscript.com/forum/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=29754
  3. It's a good way but it's not the result i would have. It should look as this:
  4. I'm trying to make a program that show the latest notification of facebook. I have a difficult part: how to pick up the text of the RSS (see url in script) In the script i have put a url between "" and for the moment there is nothing on it. I know that its something with stringregexp and IE.au3, but for the rest i'm turning around without finding something. I would also like to have a configuration GUI, but that i'll do it on myself. Please help me I already have a part of the script. Here is it: ;#NoTrayIcon #include <IE.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Array.au3> $width = 300 $height = 90 $xa = @DesktopWidth - $width - 5 $ya = @DesktopHeight - $height - 50 $GUi = GUICreate("Facebook Notification", $width, $height, $xa, $ya, $WS_POPUPWINDOW, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) $label = GUICtrlCreateLabel("Facebook Notification", 5, 5, 130, 20) $label2 = GUICtrlCreateLabel("", 5, 30, 130, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func Notification() $baseurl = "http://www.facebook.com/feeds/notifications.php?id=100000295219880&viewer=100000295219880&key=683ac29a17&format=rss20" $Source = _IEBodyReadHTML( $baseurl) $array = StringRegExp($Source," <channel> <channel>", "<title> </title>") GUICtrlSetData($label2,$array) EndFunc Thanks to all in advance! Greets
  5. i did a playlist creator to export a list of songs to M3U: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <ProgressConstants.au3> #include <EditConstants.au3> #include <ListViewConstants.au3> #include <Constants.au3> #include <GuiListView.au3> #include <File.au3> #include <Timers.au3> #include <WinAPI.au3> #include <Array.au3> #include <Misc.au3> #include "Includes\GDIPlus.au3" #include "Includes\Recursive.au3" #include "Includes\ModernMenuFixed.au3" #include "Includes\ExtProp.au3" #include "Includes\GUIEnhance.au3" #include "Includes\GUICtrlSetOnHover_UDF.au3" Dim $updater_gui,$backbuffer,$backbuffer2,$szDrive, $szDir, $szFName, $szExt , $brush,$stop_btn,$fwd_btn,$ini_sleep,$bitmap,$graphics,$gui_artist_txt,$ar,$gui_title_txt,$ti,$gui_album_txt,$search_array_orig, $al,$aaaa,$ai_Handle,$ai_Return,$status_txt Opt("TrayMenuMode",1) $playlist_gui = GUICreate("Playlist Creator(*.m3u", 350, 407, -1, -1, $WS_SIZEBOX, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)) GUISetBkColor(0x000000) _SetMenuBkColor(0x000000) _SetMenuIconBkColor(0x000000) _SetMenuTextColor(0xFFFFFF) _SetMenuSelectRectColor(0x555555) _SetMenuSelectTextColor(0xFFFFFF) $playlist = GUICtrlCreateListView("Artist|Title|Album|Location", 8, 38, 335, 341) GUICtrlSendMsg(-1, 0x101E, 0, 92) GUICtrlSendMsg(-1, 0x101E, 1, 92) GUICtrlSendMsg(-1, 0x101E, 2, 92) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) GUICtrlSetOnEvent(-1, "pevent") ;Creating context menu $playlist_menu = GUICtrlCreateContextMenu($playlist) $pls_addfile = _GUICtrlCreateODMenuItem("Add file", $playlist_menu) $pls_addfolder = _GUICtrlCreateODMenuItem("Add folder", $playlist_menu) $pls_delentry = _GUICtrlCreateODMenuItem("delete entry", $playlist_menu) _GUICtrlCreateODMenuItem("", $playlist_menu) $pls_save = _GUICtrlCreateODMenuItem("Save playlist (*.pls)", $playlist_menu) $pls_load = _GUICtrlCreateODMenuItem("Load playlist (*.pls)", $playlist_menu) $pls_export = _GUICtrlCreateODMenuItem("Export Playlist to *.m3u", $playlist_menu) $pls_clear = _GUICtrlCreateODMenuItem("Clear playlist", $playlist_menu) $searchi = GUICtrlCreateInput("", 8, 8, 203, 21) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKHEIGHT) $searchbtn = GUICtrlCreateButton("Search", 220, 7, 50, 24, 0) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKHEIGHT+$GUI_DOCKWIDTH) $resetbtn = GUICtrlCreateButton("Reset", 270, 7, 75, 24, 0) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKHEIGHT+$GUI_DOCKWIDTH) _GUICtrlListView_RegisterSortCallBack($playlist) pls_load() GUISetState(@SW_SHOW) $tabout = TrayCreateItem("About") TrayCreateItem("") $texit = TrayCreateItem("Exit") While 1 $msg = GUIGetMsg() $tmsg = TrayGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $pls_addfile pls_addfile() Case $msg = $pls_addfolder pls_addfolder() Case $msg = $pls_delentry pls_delentry() Case $msg = $pls_save pls_save() Case $msg = $pls_load pls_load() Case $msg = $pls_export pls_export() Case $msg = $pls_clear pls_clear() Case $msg = $searchbtn pls_search() Case $msg = $resetbtn pls_reset() Case $tmsg = $tabout _about() Case $tmsg = $texit _Exit() EndSelect WEnd ;===================== Playlist functions ==================== Func pls_addfile() $sFile = FileOpenDialog("Chosse audio file ", "", "Audio Files (*.mp3;*.mp2;*.mp1;*.wav;*.ogg;*.aiff)|MP3 (*.mp3)|MP2 (*.mp1)|MP3 (*.mp1)|WAV (*.wav)|OGG (*.ogg)AIFF (*.aiff)|") If FileExists($sFile) Then $path = $sFile If @OSVersion = "WIN_VISTA" Then $ar = _GetExtProperty($path, 13) $ti = _GetExtProperty($path, 21) $al = _GetExtProperty($path, 14) Else $ar = _GetExtProperty($path, 16) $ti = _GetExtProperty($path, 10) $al = _GetExtProperty($path, 17) EndIf $artist1 = $ar & "|" $title1 = $ti & "|" $album1 = $al & "|" GUICtrlCreateListViewItem($artist1 & $title1 & $album1 & $path, $playlist) GUICtrlSendMsg($playlist, 0x101E, 0, 92) GUICtrlSendMsg($playlist, 0x101E, 1, 92) GUICtrlSendMsg($playlist, 0x101E, 2, 92) GUICtrlSendMsg($playlist, 0x101E, 3, 92) EndIf EndFunc Func pls_addfolder() $pcdir = FileSelectFolder("Select Folder", "") If $pcdir <> "" Then $filesArray = RecursiveFileSearch($pcdir, "(?i)\.(mp3)") If Not IsArray($filesArray) Then TrayTip("", "Folder empty !", 2, 1) Else _GUICtrlListView_BeginUpdate($playlist) GUICtrlSetState($searchbtn,$GUI_DISABLE) For $i = 1 To $filesArray[0] $path = $filesArray[$i] If @OSVersion = "WIN_VISTA" Then $ar = _GetExtProperty($path, 13) $ti = _GetExtProperty($path, 21) $al = _GetExtProperty($path, 14) Else $ar = _GetExtProperty($path, 16) $ti = _GetExtProperty($path, 10) $al = _GetExtProperty($path, 17) EndIf GUICtrlCreateListViewItem($ar & "|" & $ti & "|" & $al & "|" & $path, $playlist) Next _GUICtrlListView_EndUpdate($playlist) GUICtrlSetState($searchbtn,$GUI_ENABLE) EndIf GUICtrlSendMsg($playlist, 0x101E, 0, 92) GUICtrlSendMsg($playlist, 0x101E, 1, 92) GUICtrlSendMsg($playlist, 0x101E, 2, 92) GUICtrlSendMsg($playlist, 0x101E, 3, 92) EndIf EndFunc Func pls_delentry() _GUICtrlListView_BeginUpdate($playlist) _GUICtrlListView_DeleteItemsSelected($playlist) _GUICtrlListView_EndUpdate($playlist) EndFunc Func pls_save() $pls_save_max = _GUICtrlListView_GetItemCount($playlist) $pls_loc = @ScriptDir & "\playlist.pls" If FileExists($pls_loc) = 0 Then _FileCreate($pls_loc) $pls_file = FileOpen($pls_loc, 2) ;~ GUICtrlSetState($playlist,$GUI_HIDE) ;~ GUICtrlSetState($searchbtn,$GUI_DISABLE) For $i = 0 To $pls_save_max FileWrite($pls_loc, _GUICtrlListView_GetItemTextString($playlist,$i) & @CRLF) Next FileClose($pls_file) ;~ GUICtrlSetState($playlist,$GUI_SHOW) ;~ GUICtrlSetState($searchbtn,$GUI_ENABLE) EndFunc Func pls_load() pls_clear() $pls_loc = @ScriptDir & "\playlist.pls" $pls_file = FileOpen($pls_loc, 0) $pls_load_max = _FileCountLines($pls_loc) - 1 ;~ GUICtrlSetState($playlist, $GUI_HIDE) _GUICtrlListView_BeginUpdate($playlist) GUICtrlSetState($searchbtn,$GUI_DISABLE) For $i = 1 To $pls_load_max $pls_read = FileReadLine($pls_file, $i) GUICtrlCreateListViewItem($pls_read, $playlist) Next ;~ GUICtrlSetState($playlist, $GUI_SHOW) _GUICtrlListView_EndUpdate($playlist) GUICtrlSetState($searchbtn,$GUI_ENABLE) GUICtrlSendMsg($playlist, 0x101E, 0, 92) GUICtrlSendMsg($playlist, 0x101E, 1, 92) GUICtrlSendMsg($playlist, 0x101E, 2, 92) GUICtrlSendMsg($playlist, 0x101E, 3, 92) _Optimize() EndFunc Func pls_clear() GUICtrlSetState($searchbtn,$GUI_DISABLE) _GUICtrlListView_BeginUpdate($playlist) _GUICtrlListView_DeleteAllItems($playlist) _GUICtrlListView_EndUpdate($playlist) GUICtrlSetState($searchbtn,$GUI_ENABLE) EndFunc Func pls_search() GUICtrlSetState($searchbtn,$GUI_DISABLE) ;Create array with playlist contents Dim $search_array_orig[1],$search_array[1] For $i = 0 To _GUICtrlListView_GetItemCount($playlist) _ArrayAdd($search_array_orig, _GUICtrlListView_GetItemTextString($playlist, $i)) Next $search_string = GUICtrlRead($searchi) If @error = 1 Then Else $sa = _GUICtrlListView_FindInText($playlist, $search_string) $sa1 = _GUICtrlListView_GetItemTextString($playlist, $sa) _ArrayAdd($search_array, $sa1) If $sa = -1 Then MsgBox(32, "Playlist creator (*.m3u;*.pls)", "None file containing '" & $search_string & "' has been found !") pls_reset() Else $sa2 = True Dim $sb While $sb <> -1 If $sa2 = True Then $sb = _GUICtrlListView_FindInText($playlist, $search_string, $sa, FALSE) Else $sb = _GUICtrlListView_FindInText($playlist, $search_string, $sb, FALSE) EndIf $sb1 = _GUICtrlListView_GetItemTextString($playlist, $sb) _ArrayAdd($search_array, $sb1) $sa2 = False WEnd $search_array[0] = _ArrayMaxIndex($search_array) pls_clear() _GUICtrlListView_BeginUpdate($playlist) For $i = 1 To $search_array[0] GUICtrlCreateListViewItem($search_array[$i], $playlist) Next GUICtrlSendMsg($playlist, 0x101E, 0, 92) GUICtrlSendMsg($playlist, 0x101E, 1, 92) GUICtrlSendMsg($playlist, 0x101E, 2, 92) GUICtrlSendMsg($playlist, 0x101E, 3, 92) _GUICtrlListView_EndUpdate($playlist) EndIf EndIf EndFunc Func pls_reset() pls_clear() _GUICtrlListView_BeginUpdate($playlist) For $i = 1 To _ArrayMaxIndex($search_array_orig) GUICtrlCreateListViewItem($search_array_orig[$i],$playlist) Next _GUICtrlListView_EndUpdate($playlist) GUICtrlSetState($searchbtn,$GUI_ENABLE) EndFunc Func pls_export() $plsloc2 = FileSaveDialog(" Export playlist", "", "M3U (*.m3u)", "", ".m3u") If StringRight($plsloc2, 3) = "m3u" Then $plsloc3 = FileOpen($plsloc2, 2) $max3 = _GUICtrlListView_GetItemCount($playlist) - 1 FileWrite($plsloc3, "#EXTM3U" & @CRLF) For $i = 0 To $max3 $text = _GUICtrlListView_GetItemTextArray($playlist, $i) $atext = _PathSplit($text[4], $szDrive, $szDir, $szFName, $szExt) FileWrite($plsloc3, "#EXTINF:0," & $atext[3] & @CRLF) FileWrite($plsloc3, $text[4] & @CRLF) FileWrite($plsloc3, @CRLF & @CRLF) Next FileClose($plsloc3) EndIf EndFunc ;==>plsexport Func pevent() _GUICtrlListView_SortItems($playlist, GUICtrlGetState($playlist)) EndFunc ;==>pevent Func _Optimize($i_PID = -1) If $i_PID <> -1 Then Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Else Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) EndIf Return $ai_Return[0] EndFunc ;==>_Optimize Func _about() MsgBox(64,"About","Playlist creator " & @CRLF & " Author: neo2606") EndFunc Func _Exit() Exit EndFunc i've added a zip file so you can download all the needed includesPlaylist crea.zip Edit: to export or save playlist : right clic with mouse in the gui. S.B.
  6. @info Hello I like your virtual keybord.It's very good. I did some changes in your script: Qwerty > Azerty because I'm not using a qwerty keyboard.µ here is the code:
  7. Thank you. It's working fine. I'm not a great programmer (see join date : 19-June 09). it's since my register to this forum that i'm using autoit. I didn't thought to pass some seconds but it's also a great idea. just adding 5 seconds forward and 1 back can be usefull. I had something i didn't know about it . Now just adding two button more and it will be ready. [button for next/previous song ( to go to the next/previous song in playlist).] i'm going to work on that.
  8. hello everybody i'm trying to make an mp3 player but i'm encountering a few problems with the next and previous function ( next song and previous song). The problem is at the end of the code. The language of the buttons in the script is french. Here is the code: #NoTrayIcon #include <WindowsConstants.au3> #include <SliderConstants.au3> #include <ProgressConstants.au3> #include <ListBoxConstants.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <Sound.au3> #include <GUIConstants.au3> #Include <GuiListBox.au3> #include <file.au3> #include <array.au3> SplashImageOn("",@ScriptDir&"\splash.bmp","400","500","-1","-1",3) Sleep(3000) SplashOff() $Mp3PlayerGui = GUICreate("White Tiger MP3 Player", 420, 600, 272, 170) GUISetBkColor(0x000000) $img = GUICtrlCreatePic(@ScriptDir & "\tiger.jpg",80,280,250,304) $Open = GUICtrlCreateButton("Ouvrir...", 3, 2, 65, 21, 0) $Label2 = GUICtrlCreateLabel("Volume :", 8, 32, 61, 17) GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif") GUICtrlSetColor(-1,0xFFFFFF) $Labelvol = GUICtrlCreateLabel("100%", 12, 50, 61, 17) GUICtrlSetColor(-1,0xFFFFFF) $Labelvolmin= GUICtrlCreateLabel("0%", 16, 250, 61, 17) GUICtrlSetColor(-1,0xFFFFFF) $slider = GUICtrlCreateSlider(8, 65, 49, 180, BitOR($TBS_VERT, $TBS_AUTOTICKS)) GUICtrlSetLimit($slider, 100, 0) GUICtrlSetData($slider, 50) GUICtrlSetBkColor(-1,0x000000) $Input1 = GUICtrlCreateInput("", 292, 7, 81, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) GUICtrlSetBKColor(-1, 0xFFFFFF) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) $Label3 = GUICtrlCreateLabel("Durée :", 240, 12, 48, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1,0xFFFFFF) $Play = GUICtrlCreateButton("Lire >", 128, 39, 57, 21, 0) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $PosSong = GUICtrlCreateProgress(121, 67, 238, 14, $PBS_SMOOTH) GUICtrlSetBKColor(-1, 0x97d1fd) GUICtrlSetData(-1, 25) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $Button1 = GUICtrlCreateButton("Pause/Lire", 196, 39, 73, 21, 0) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Stop", 279, 39, 57, 21, 0) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $PlayList = GUICtrlCreateList("", 60, 87, 317, 136, BitOR($WS_HSCROLL,$WS_VSCROLL,$WS_BORDER)) GUICtrlSetData(-1, "") GUICtrlSetColor(-1, 0xFFFFE1) GUICtrlSetBkColor(-1, 0x808080) $Label1 = GUICtrlCreateLabel("Playlist :", 60, 65, 42, 17) $Label4 = GUICtrlCreateLabel("Fichier:", 73, 12, 45, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1,0xFFFFFF) $Input2 = GUICtrlCreateInput("", 125, 7, 110, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) GUICtrlSetBKColor(-1, 0xFFFFFF) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) $MoveBack = GUICtrlCreateButton("<<", 100, 65, 19, 18) $MoveForward = GUICtrlCreateButton(">>", 361, 65, 19, 18) $Button4 = GUICtrlCreateButton("Effacer liste", 60, 223, 150, 27, 0) $Button5 = GUICtrlCreateButton("Retirer ", 210, 223, 110, 27, 0) $Shuffle = GUICtrlCreateCheckbox ("Shuffle", 324, 223, 52, 12) GUICtrlSetBkColor(-1,0xFFFFFF) GUICtrlSetColor(-1,0xFFFFFF) $Repeat = GUICtrlCreateCheckbox ("Repeat", 324, 237, 53, 12) GUICtrlSetBkColor(-1,0xFFFFFF) GUICtrlSetColor(-1, 0xFFFFFF) GUISetState(@SW_SHOW) GUICtrlSetData($PosSong, 0) Global $old_slider_value = 50 While 1 $msg = GUIGetMsg() $slider_value = GUICtrlRead($slider) Select Case $msg = $GUI_EVENT_CLOSE global $SoundToPlay If IsDeclared($SoundToPlay) Then _SoundClose($SoundToPlay) ExitLoop Case $msg = $Open If _GUICtrlListBox_GetText($PlayList, 0) <> "" Then $LastItem = _GUICtrlListBox_GetCount($PlayList) $Local = _GUICtrlListBox_GetText($PlayList, $LastItem - 1) ElseIf FileExists(@HomeDrive & "") Then $Local = @HomeDrive & "" ElseIf FileExists(@HomeDrive & "") Then $Local = @HomeDrive & "" Else $Local = @DesktopDir EndIf $PathToMp3 = FileOpenDialog("Fichier audio à ouvrir...", $Local, "Audio (*.mp3)", 5) If StringInStr($PathToMp3, "|") > 0 Then $MultiSelect = StringSplit($PathToMp3, "|") For $NbrSongs = 2 To UBound($MultiSelect) - 1 _GUICtrlListBox_AddString($PlayList, $MultiSelect[1]&"\"&$MultiSelect[$NbrSongs]) Next Else If $PathToMp3 <> "" Then _GUICtrlListBox_AddString($PlayList, $PathToMp3) EndIf EndIf If Not IsDeclared("SoundToPlay") Then $SoundToPlay = _SoundOpen(_GUICtrlListBox_GetText($PlayList, 0)) GUICtrlSetData($Input1, _SoundLength($SoundToPlay, 1)) _GUICtrlListBox_SetCurSel($PlayList, 0) Dim $szDrive, $szDir, $szFName, $szExt $NameSong = _PathSplit(_GUICtrlListBox_GetText($PlayList, 0), $szDrive, $szDir, $szFName, $szExt) GUICtrlSetData($Input2, $NameSong[3]) _SoundPlay($SoundToPlay, 0) GUICtrlSetData($PosSong, 0) ElseIf IsDeclared("SoundToPlay") Then If _SoundStatus($SoundToPlay) <> "playing" And _SoundStatus($SoundToPlay) <> "paused" Then _SoundClose($SoundToPlay) $SoundToPlay = _SoundOpen(_GUICtrlListBox_GetText($PlayList, 0)) GUICtrlSetData($Input1, _SoundLength($SoundToPlay, 1)) _GUICtrlListBox_SetCurSel($PlayList, 0) Dim $szDrive, $szDir, $szFName, $szExt $NameSong = _PathSplit(_GUICtrlListBox_GetText($PlayList, 0), $szDrive, $szDir, $szFName, $szExt) GUICtrlSetData($Input2, $NameSong[3]) _SoundPlay($SoundToPlay, 0) GUICtrlSetData($PosSong, 0) EndIf EndIf Case $msg = $Play If IsDeclared("SoundToPlay") Then _SoundStop($SoundToPlay) _SoundClose($SoundToPlay) EndIf If _GUICtrlListBox_GetCurSel($PlayList) <> $LB_ERR Then $SoundToPlay = _SoundOpen(_GUICtrlListBox_GetText($PlayList, _GUICtrlListBox_GetCurSel($PlayList))) GUICtrlSetData($Input1, _SoundLength($SoundToPlay, 1)) _GUICtrlListBox_SetCurSel($PlayList, _GUICtrlListBox_GetCurSel($PlayList)) Dim $szDrive, $szDir, $szFName, $szExt $NameSong = _PathSplit(_GUICtrlListBox_GetText($PlayList, _GUICtrlListBox_GetCurSel($PlayList)), $szDrive, $szDir, $szFName, $szExt) GUICtrlSetData($Input2, $NameSong[3]) _SoundPlay($SoundToPlay, 0) GUICtrlSetData($PosSong, 0) Else $SoundToPlay = _SoundOpen(_GUICtrlListBox_GetText($PlayList, 0)) GUICtrlSetData($Input1, _SoundLength($SoundToPlay, 1)) _GUICtrlListBox_SetCurSel($PlayList, 0) Dim $szDrive, $szDir, $szFName, $szExt $NameSong = _PathSplit(_GUICtrlListBox_GetText($PlayList, 0), $szDrive, $szDir, $szFName, $szExt) GUICtrlSetData($Input2, $NameSong[3]) _SoundPlay($SoundToPlay, 0) GUICtrlSetData($PosSong, 0) EndIf Case $msg = $Button1 And IsDeclared("SoundToPlay") If IsDeclared("SoundToPlay") And _SoundStatus($SoundToPlay) = "playing" Then _SoundPause($SoundToPlay) ElseIf IsDeclared("SoundToPlay") And _SoundStatus($SoundToPlay) = "paused" Then _SoundResume($SoundToPlay) EndIf Case $msg = $Button2 And IsDeclared("SoundToPlay") _SoundStop($SoundToPlay) _SoundClose($SoundToPlay) GUICtrlSetData($PosSong, 0) Case $old_slider_value <> $slider_value SoundSetWaveVolume(100 - $slider_value) $old_slider_value = $slider_value Case IsDeclared("SoundToPlay") And _SoundStatus($SoundToPlay) = "playing" $TempsTotalSong = _SoundLength($SoundToPlay, 2) $LectureAvancement = _SoundPos($SoundToPlay, 2) $percent = ($LectureAvancement * 100) / $TempsTotalSong GUICtrlSetData($PosSong, $percent) If $LectureAvancement = $TempsTotalSong Then GUICtrlSetData($PosSong, 0) EndIf Case $msg = $Button4 _GUICtrlListBox_ResetContent($PlayList) Case $msg = $Button5 And _GUICtrlListBox_GetCurSel($PlayList) <> $LB_ERR _GUICtrlListBox_DeleteString($PlayList, _GUICtrlListBox_GetCurSel($PlayList)) Case IsDeclared("SoundToPlay") And _SoundStatus($SoundToPlay) = "playing" $TempsTotalSong = _SoundLength($SoundToPlay, 2) $LectureAvancement = _SoundPos($SoundToPlay, 2) $CurrentIndexPlay = _GUICtrlListBox_GetCurSel($PlayList) $NbrSongsInPlayList = _GUICtrlListBox_GetCount($PlayList) - 1 If $CurrentIndexPlay <> $NbrSongsInPlayList Then If $LectureAvancement = $TempsTotalSong Then _SoundStop($SoundToPlay) _SoundClose($SoundToPlay) Sleep(500) If ControlCommand("", "", $Shuffle, "IsChecked", "") = 0 Then $SoundToPlay = _SoundOpen(_GUICtrlListBox_GetText($PlayList, $CurrentIndexPlay + 1)) GUICtrlSetData($Input1, _SoundLength($SoundToPlay, 1)) _GUICtrlListBox_SetCurSel($PlayList, $CurrentIndexPlay + 1) Dim $szDrive, $szDir, $szFName, $szExt $NameSong = _PathSplit(_GUICtrlListBox_GetText($PlayList, $CurrentIndexPlay + 1), $szDrive, $szDir, $szFName, $szExt) GUICtrlSetData($Input2, $NameSong[3]) _SoundPlay($SoundToPlay, 0) GUICtrlSetData($PosSong, 0) Else $IndexShuffle = Random(0, $NbrSongsInPlayList, 1) If $IndexShuffle = $CurrentIndexPlay Then $IndexShuffle = $CurrentIndexPlay + 3 $SoundToPlay = _SoundOpen(_GUICtrlListBox_GetText($PlayList, $IndexShuffle)) GUICtrlSetData($Input1, _SoundLength($SoundToPlay, 1)) _GUICtrlListBox_SetCurSel($PlayList, $IndexShuffle) Dim $szDrive, $szDir, $szFName, $szExt $NameSong = _PathSplit(_GUICtrlListBox_GetText($PlayList, $IndexShuffle), $szDrive, $szDir, $szFName, $szExt) GUICtrlSetData($Input2, $NameSong[3]) _SoundPlay($SoundToPlay, 0) GUICtrlSetData($PosSong, 0) EndIf EndIf EndIf If $CurrentIndexPlay = $NbrSongsInPlayList Then If $LectureAvancement = $TempsTotalSong Then _SoundStop($SoundToPlay) _SoundClose($SoundToPlay) Sleep(500) If ControlCommand("", "", $Repeat, "IsChecked", "") = 1 And ControlCommand("", "", $Shuffle, "IsChecked", "") = 0 Then $SoundToPlay = _SoundOpen(_GUICtrlListBox_GetText($PlayList, 0)) GUICtrlSetData($Input1, _SoundLength($SoundToPlay, 1)) _GUICtrlListBox_SetCurSel($PlayList, 0) Dim $szDrive, $szDir, $szFName, $szExt $NameSong = _PathSplit(_GUICtrlListBox_GetText($PlayList, 0), $szDrive, $szDir, $szFName, $szExt) GUICtrlSetData($Input2, $NameSong[3]) _SoundPlay($SoundToPlay, 0) GUICtrlSetData($PosSong, 0) ElseIf ControlCommand("", "", $Repeat, "IsChecked", "") = 1 And ControlCommand("", "", $Shuffle, "IsChecked", "") = 1 Then $IndexShuffle = Random(0, $NbrSongsInPlayList, 1) If $IndexShuffle = $CurrentIndexPlay Then $IndexShuffle = $CurrentIndexPlay + 3 $SoundToPlay = _SoundOpen(_GUICtrlListBox_GetText($PlayList, $IndexShuffle)) GUICtrlSetData($Input1, _SoundLength($SoundToPlay, 1)) _GUICtrlListBox_SetCurSel($PlayList, $IndexShuffle) Dim $szDrive, $szDir, $szFName, $szExt $NameSong = _PathSplit(_GUICtrlListBox_GetText($PlayList, $IndexShuffle), $szDrive, $szDir, $szFName, $szExt) GUICtrlSetData($Input2, $NameSong[3]) _SoundPlay($SoundToPlay, 0) GUICtrlSetData($PosSong, 0) EndIf EndIf EndIf ;Here is my problem: Case $msg = $MoveForward And IsDeclared("SoundToPlay") And _SoundStatus($SoundToPlay) = "playing" $LectureAvancement = _SoundPos($SoundToPlay, 2) / 1000 _SoundSeek($SoundToPlay, 0, 0, $LectureAvancement + 5) _SoundPlay($SoundToPlay, 0) Case $msg = $MoveBack And IsDeclared("SoundToPlay") And _SoundStatus($SoundToPlay) = "playing" $LectureAvancement = _SoundPos($SoundToPlay, 2) / 1000 _SoundSeek($SoundToPlay, 0, 0, $LectureAvancement - 1 ) _SoundPlay($SoundToPlay, 0) EndSelect WEnd Here is a preview: Thanks for the uture help.
  9. Thank you very much, it's working fine. Your slot machine is very good, i like it!
  10. Hello I'm trying to make a little script to connect to my gmail and live account. i'm not a great script creator but i try to to my best. I would like to know what i should do to send the username and password writted in the inputs: This is the code i use: #include <IE.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TraymenuMode",1) $GUI = GUICreate("Login To:",200, 150, 300, 300) GUISetBkColor(0x000000) $Live = GUICtrlCreateButton("Live", 0, 10, 100) $Gmail = GUICtrlCreateButton("Gmail", 100, 10, 100) $username = GUICtrlCreateInput("",90 , 50, 100, 22) $passwordlabel = GUICtrlCreateLabel("Username:", 8, 50, 80, 17) GUIctrlSetColor(-1,0xFFFFFF) $usernamelabel = GUICtrlCreateLabel("Password:", 8, 80, 80, 17) GUIctrlSetColor(-1,0xFFFFFF) $Password = GUICtrlCreateInput("",90 , 80, 100, 22) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Live loglive() Case $Gmail logGmail() EndSwitch WEnd Func loglive() $o = _IECreate ("http://login.live.com/") _IELoadWait ($o) Sleep (500) Send($username) Sleep (1000) Send("{TAB}") Sleep (1000) Send($Password) Sleep (1000) Send("{ENTER}") EndFunc Func logGmail() $o2 = _IECreate ("https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fhl%3Dfr%26tab%3Dwm%26ui%3Dhtml%26zy%3Dl&bsv=zpwhtygjntrz&scc=1&ltmpl=default&ltmplcache=2&hl=fr") _IELoadWait ($o2) Sleep (500) Send($username) Sleep (1000) Send("{TAB}") Sleep (1000) Send($Password) Sleep (1000) Send("{ENTER}") EndFunc Thanks for your help.
  11. No it was the png-file that i uploaded. The icon is 32x32 if i remeber.
  12. You re right it tested with another icon(downloaded from png fact) and it works. my icon was "dead". Yhank you for your great help.
  13. Thank you It works on vista but not on XP. I don't know what i'm doing wrong. Edit: It only works on XP when i compile it with the default icon
  14. Hi everbody When i compile my script to an exe i chose an icon. but when i start my application the icon doesn't appear. Can Someone help me?? here is the code i use #Region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=beta #AutoIt3Wrapper_icon=..\..\..\..\Program Files\AutoIt3\Icons\AU32.ico #AutoIt3Wrapper_outfile=Just For You.exe #AutoIt3Wrapper_UseUpx=n #EndRegion;**** Directives created by AutoIt3Wrapper_GUI **** #NoTrayIcon #Include <Constants.au3> #include <Word.au3> #include <Excel.au3> #include <Inet.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <File.au3> Opt("TrayMenuMode",1); Default tray menu items (Script Paused/Exit) will not be shown. $settingsitem = TrayCreateMenu("Settings") $displayitem = TrayCreateItem("Open CD/DVD", $settingsitem) $printeritem = TrayCreateItem("Close CD/DVD", $settingsitem) $worditem = TrayCreateItem("Word", $settingsitem) $excelitem = TrayCreateItem("Excel", $settingsitem) $PublicIPitem = TrayCreateItem("IP", $settingsitem) $Recycleitem =TrayCreateItem ("Empty Bin", $settingsitem) $Chatitem =TrayCreateItem("Chat", $settingsitem) TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() TrayTip("", "Hello", 5) While 1 $msg = TrayGetMsg() Select Case $msg = $displayitem CDTray("E:", "open") Case $msg = $aboutitem Msgbox(64,"About:","Author: Sébastien Bauval") Case $msg = $printeritem CDTray("E:", "Close") Case $msg= $worditem $oWordApp = _WordCreate ("") Case $msg= $excelitem $oExcel = _ExcelBookNew() Case $msg =$PublicIPitem $PublicIP = _GetIP() MsgBox(0, "IP Address", "Your IP Address is: " & $PublicIP) Case $msg = $Recycleitem FileRecycleEmpty ( "" ) Case $msg = $Chatitem Run ("Chat.exe") Case $msg = $exititem Switch @HOUR Case 6 To 11 $msg = "Good Morning!" Case 12 To 17 $msg = "Good Afternoon!" Case 18 To 21 $msg = "Good Evening!" Case Else $msg = "What are you still doing up?!" EndSwitch TrayTip("", "Bye", 5) MsgBox(0, Default, $msg) $msg = TrayGetMsg() ExitLoop EndSelect WEnd Exit And the icon i use is: Thanks
×
×
  • Create New...