Jump to content

help.. time!


Golbez
 Share

Recommended Posts

well i have found plugins that work with winamp but they do not all do what i want. so what better 2 to with my time? i decided i was going to try to make my own.

so far this is what i think i need to find out and learn!

1. how to get current time and date.

2. how to sent playlist.

3. how to sent commands to winamp.

4. how to tell after it been a certin amount of time for winamp to stop (sleep alarm).

5. snooze button.

6. gui menu.

if i missed anythin or got any other ideas for the alarm post. if u would like to help me plz leave info on what u can do :)

....

this what i got so far:

i found a program i can rip apart 2 learn from: Click Me

music functions: Click Me More

winamp functions.. YEAH!! Click Me

hotkeys!!:

Posted Image

time:
MsgBox(0,"",  "The time is " & @HOUR & ":" & @MIN & ":" & @SEC)

-Golbez

p.s. im usen this as a check list and a place for me to gather all my facts n what not

Edited by Golbez
Link to comment
Share on other sites

  • Replies 46
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Moderators

That's kind of funny, I just made one for my wife using windows media player. (and I mean, I JUST finished it 10 minutes ago :) )

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

think u could send me the code so mabye i can edit it alittle and change it 2 what i need/want plz :P

I don't think it will work with WinAmp... do they even have switches?

Edit:

Actually after reading that request... (send me code so I don't have to do the work, and I'll edit a little), I don't think I would.

But what I will do, is if you can find the switches and such, start your project, and if you run into problems, I'll help if and or when you run into problems. I only had to write 4 custom functions (maybe 3 :) ) and it was for time (probably could have just used standard ones, but I was too lazy too look). It was one of the shortest progs I've made, something like 140 lines.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Read my edit

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

im tryen 2 make somethin like this:

Posted Image

the only things i dont like about this is it changes the playlist into sleep which is ok but kinda annoying.

and the second is i want to be able to make it so i can set it to go off at a certin time each day. kinda like an alarm to wake up but i want it to go 2 sleep.

Link to comment
Share on other sites

  • Moderators

I wouldn't concern myself with the GUI, I'd write my plan out (like you did) and start coding.

Golbez, as you know, I'm harsh and to the point... do something, try something, fail, then ask questions... I wouldn't lift a finger at this moment to "start" you off.... But I would help if you started the what you wanted and showed what you were doing, so maybe the insight would teach you.

I've made the mistake already once tonight giving code to someone that copy and pasted.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

its all good.. im just doing research atm.. im way 2 tired to start.. its 2:30 am for me and i got 2 go to college in like 6 hours so... yeah i was just tryen 2 save myself some time on researchen but i plan on tryen 2 code it myself..

i plan on programing when i get out of college. (i just started :) )

question for u smoke..

how should i start coden.. like how should i test it without the gui?? or is there a way i can just like put it on somethin (not a messagebox there kinda annoyen) {maybe a splash screen?)

Edited by Golbez
Link to comment
Share on other sites

  • Moderators

As I said, you're first concern should be the internal workings, the GUI is the easy part. Pretend it was just a script first, then you/we can convert it to a GUI.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

ok well i got the keystrokes worken..

i dont no were 2 start for the time.. any suggestions??

;Keys
$play = "^!{ins}"
$stop = "^!{end}"
$pause = "^!{home}"
$volup = "^!{up}"
$voldn = "^!{down}"
$next = "^!{left}"
$previous = "^!{right}"

send($stop)
sleep(2000)
send($play)
Edited by Golbez
Link to comment
Share on other sites

current code.. im goen 2 sleep. if anyone want to help or point me in some what of a direction.. atm im just guessing on what to do.. and im lost but i think i might be on to somethin but idk.

#include <Date.au3>

_iniread()

Global $Sec, $Min, $Hour, $Time
; calculate with time
$StartTicks = _TimeToTicks(@HOUR,@MIN,@SEC)
; calculate 1 minutes later
$EndTicks = $StartTicks + $sleep * 60 * 1000
_TicksToTime($EndTicks,$Hour,$Min,$Sec)
MsgBox(262144,'' , 'New Time: ' &  $Hour & ":" & $Min & ":" & $Sec) 


Func _iniread()
;Other
    
;Delays
        Global $sleep = 10
;Keys
        Global $play = "^!{ins}"
        Global $stop = "^!{end}"
        Global $pause = "^!{home}"
        Global $volup = "^!{up}"
        Global $voldn = "^!{down}"
        Global $next = "^!{left}"
        Global $previous = "^!{right}"
EndFunc
Link to comment
Share on other sites

smoke think u can help me make the gui menu plz :)

#include <Date.au3>
#include <GUIConstants.au3>
_iniread()

Global $sleephour, $sleepmin, $wakeuphour, $wakeupmin, $stop, $play

$Form1 = GUICreate("Golbez Alarm", 273, 161, 346, 244)
GUISetBkColor(0xA0A0A4)
GUICtrlCreateLabel("Time", 16, 8, 243, 41)
GUICtrlSetBkColor(-1, 0x454545)
$Button1 = GUICtrlCreateButton("Exit", 192, 120, 73, 33, 0)
$Button2 = GUICtrlCreateButton("Menu", 112, 120, 73, 33, 0)
$Button3 = GUICtrlCreateButton("Play", 8, 120, 41, 33, 0)
$Button4 = GUICtrlCreateButton("Stop", 56, 120, 41, 33, 0)
$Button5 = GUICtrlCreateButton("U", 200, 56, 25, 17, 0)
$Button6 = GUICtrlCreateButton("U", 200, 88, 25, 17, 0)
$Button7 = GUICtrlCreateButton("D", 240, 56, 25, 17, 0)
$Button8 = GUICtrlCreateButton("D", 240, 88, 25, 17, 0)
GUICtrlCreateLabel("WakeUp", 16, 56, 175, 17)
GUICtrlSetBkColor(-1, 0xA0A0A4)
GUICtrlCreateLabel("Sleep", 16, 88, 175, 17)
GUICtrlSetBkColor(-1, 0xA0A0A4)
GUISetState(@SW_SHOW)
While 1
    If @HOUR = $sleephour Then 
        If @MIN = $sleepmin Then Send($stop, 0)
    EndIf
    If  @HOUR = $wakeuphour Then 
        If @MIN = $wakeupmin Then send($play, 0)
    EndIf
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
       ;;;;;;;
    EndSelect
WEnd



Func _iniread()
;Other
        Global $timekey = "{del}"
        Global $endkey = "{end}"
        HotKeySet($endkey, "Terminate")
        HotKeySet($timekey, "GetTime")
;Time
        Global $sleephour = 17
        Global $sleepmin = 29
        Global $wakeuphour = 17
        Global $wakeupmin = 30
        Global $day = 0
        Global $month = 0
        
;Delays
        Global $sleep = 10
;Keys
        Global $play = "^!{ins}"
        Global $stop = "^!{end}"
        Global $pause = "^!{home}"
        Global $volup = "^!{up}"
        Global $voldn = "^!{down}"
        Global $next = "^!{left}"
        Global $previous = "^!{right}"
EndFunc

Func GetTime()
    MsgBox(48,"time", "hour is: " & @HOUR & " min is: " & @MIN & " sec is: " & @SEC, 5)
    MsgBox(48,"date", "month is: " & @MON & " day is: " & @WDAY & " year is: " & @YEAR, 5)
EndFunc
Func Terminate()
    Exit 0
EndFunc

this what i got so far.. i dont no how 2 put in the time or anythin

Edited by Golbez
Link to comment
Share on other sites

  • Moderators

I have no idea what you mean by the statement GUI menu, to me a GUI menu is something done with GUICtrlCreateMenu(), but it looks like you're trying to use a button.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

i used kuda... i dont no how 2 code the menus with out it :party: i sry ima noob wit that :D

thats kinda what i want it 2 look like tho

What's kuda? Barracuda? :D ... Or is that some new type of martial arts :P

What would you guys do without "everything" being automated :)

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

can u tell me how to make the time apear like u did smoke?? i dont understand how do to do that part :P

or if u cant tell me can u give me an example? plz :)

can u also show or tell me how to make it so when the user click on menu it opens a new gui? thenx

code update:

Opt("GUIOnEventMode", 1)

#include <Date.au3>
#include <GUIConstants.au3>

_iniread()
Global $sleephour, $sleepmin, $wakeuphour, $wakeupmin, $stop, $play, $voldn, $volup, $next, $previous

$Alarm = GUICreate("Golbez Alarm", 273, 209, 356, 216, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetBkColor(0xA0A0A4)
GUICtrlCreateLabel("Time Gos here", 16, 8, 241, 41, BitOR($SS_CENTER,$SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, 0x454545)
$Button1 = GUICtrlCreateButton("Exit", 192, 168, 73, 33, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetCursor ($Button1, 7)
    GUICtrlSetOnEvent(-1, "Terminate")
$Button2 = GUICtrlCreateButton("Menu", 192, 128, 73, 33, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
$Button3 = GUICtrlCreateButton("Play", 144, 128, 41, 33, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetTip(-1, "Plays current song.")
    GUICtrlSetOnEvent(-1, "Play")
$Button4 = GUICtrlCreateButton("Stop", 144, 168, 41, 33, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetTip(-1, "Stops current song.")
    GUICtrlSetOnEvent(-1, "Stop")
$Button5 = GUICtrlCreateButton("U", 200, 56, 25, 17, 0)
$Button6 = GUICtrlCreateButton("U", 200, 88, 25, 17, 0)
$Button7 = GUICtrlCreateButton("D", 240, 56, 25, 17, 0)
$Button8 = GUICtrlCreateButton("D", 240, 88, 25, 17, 0)
$Button9 = GUICtrlCreateButton("Previous", 8, 168, 65, 33, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetTip(-1, "Plays previous song.")
    GUICtrlSetOnEvent(-1, "_Previous")
$Button10 = GUICtrlCreateButton("Next", 8, 128, 65, 33)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetTip(-1, "Plays next song.")
    GUICtrlSetOnEvent(-1, "_Next")
$Button11 = GUICtrlCreateButton("Vol Up", 80, 128, 57, 33, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetTip(-1, "Turn volume up.")
    GUICtrlSetOnEvent(-1, "VolUp")
$Button12 = GUICtrlCreateButton("Vol Dn", 80, 168, 57, 33, 0)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetTip(-1, "Turn volume down.")
    GUICtrlSetOnEvent(-1, "VolDown")
GUICtrlCreateLabel("WakeUp time goes here", 16, 56, 175, 17, BitOR($SS_CENTER,$SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, 0xA0A0A4)
GUICtrlCreateLabel("Sleep time goes here", 16, 88, 175, 17, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_RIGHTJUST))
    GUICtrlSetBkColor(-1, 0xA0A0A4)
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $Alarm)


While 1
    If @HOUR = $sleephour Then 
        If @MIN = $sleepmin Then Send($stop, 0)
    EndIf
    If  @HOUR = $wakeuphour Then 
        If @MIN = $wakeupmin Then send($play, 0)
    EndIf
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    EndSelect
    sleep(200)
WEnd

Func _iniread()
;Other
        Global $timekey = "{del}"
        Global $endkey = "{end}"
        HotKeySet($endkey, "Terminate")
        HotKeySet($timekey, "GetTime")
;Time
        Global $sleephour = 17
        Global $sleepmin = 29
        Global $wakeuphour = 17
        Global $wakeupmin = 30
        Global $day = 0
        Global $month = 0
        
;Delays
        Global $sleep = 10
;Keys
        Global $play = "^!{ins}"
        Global $stop = "^!{end}"
        Global $pause = "^!{home}"
        Global $volup = "^!{up}"
        Global $voldn = "^!{down}"
        Global $next = "^!{left}"
        Global $previous = "^!{right}"
EndFunc

Func GetTime()
    MsgBox(48,"time", "hour is: " & @HOUR & " min is: " & @MIN & " sec is: " & @SEC, 5)
    MsgBox(48,"date", "month is: " & @MON & " day is: " & @WDAY & " year is: " & @YEAR, 5)
EndFunc
Func Play()
    Send($play)
EndFunc
Func Stop()
    Send($stop)
EndFunc
Func VolUp()
    Send($volup)
EndFunc
Func VolDown()
    Send($voldn)
EndFunc
Func _Next()
    Send($next)
EndFunc
Func _Previous()
    Send($previous)
EndFunc
Func Terminate()
    Exit 0
EndFunc
Edited by Golbez
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...