Last thing i want to do is draw from our limited resources, but a point in the right direction would be handy
I have been interested in coding for a while, and haven't had any real experience or anything of the sorts, but I have an idea. I want to make a program that sits in your taskbar, or just hides and has universal hotkeys. So when you hit one of them (say F11 for example) it plays a sound. Having a cheery *Boing* and *kaboom* sounds at your finger tips during games of Crysis, Farcry, or anything with pretty explosions would lighten the mood. If anyone could perhaps point me in the direction of a beginner program/tutorial, that would be great!
Thanks again!
Starting At the bottom
Moderator: Team Members
- ilythor
- Retired
- Posts: 436
- Joined: Sun Oct 14, 2007 3:44 am
- EQ2Emu Server: TessEq2
- Location: Australia, mate!
- Contact:
Starting At the bottom
"Everytime you pull the trigger in space, you will ruin someone's day, somewhere, and eventually, some time."
- Zcoretri
- Team Member
- Posts: 1642
- Joined: Fri Jul 27, 2007 12:55 pm
- Location: SoCal
Re: Starting At the bottom
Well the way I have learned is by going out and buying programming books on the language I am going to use. I also googled for sites that have programming examples, nut just like the books, some are better than others.
You might consider taking formal classes.
Putting stuff in taskbar is kinda an advanced topic, but it might be easier now in .NET
I first learned basic in the DOS days, then migrated to Visual Basic. I have started to teach myself C++ now that I have been involved with this project.
You might consider taking formal classes.
Putting stuff in taskbar is kinda an advanced topic, but it might be easier now in .NET
I first learned basic in the DOS days, then migrated to Visual Basic. I have started to teach myself C++ now that I have been involved with this project.
-
Bion
- Retired
- Posts: 241
- Joined: Sun Sep 16, 2007 1:47 pm
Re: Starting At the bottom
This can be done pretty easy with autoit it is a Windows automation language
I use it for things like this that i want to make quickly
here is an example of how you would do it.
you first download and install autoit v3 then you can copy that script to notepad or the autoit editor and save it with the .au3 extention like playsound.au3
you can then run it as a script or compile it as a exe
to use this as is copy the sound files to the dir C:\sounds and hit F4 to exit , F5 for sound 1,F6 for sound 2
example sound files can be found here
I use it for things like this that i want to make quickly
here is an example of how you would do it.
Code: Select all
HotKeySet("{F4}", "ExitProg") ;;Sets F4 as a hotkey to exit program
HotKeySet("{F5}", "PlaySound1") ;;Sets F5 as a hotkey to play sound 1
HotKeySet("{F6}", "PlaySound2") ;;Sets F6 as a hotkey to play sound 2
;path where sound files are at
Dim $sPath = "C:\Sounds\"
;file name of sound files
Dim $sFileName = ""
While 1
Sleep(100) ;;;Waits for function call
Wend
Func PlaySound1()
;sets file name
$sFileName = "boing_x.wav"
;play sound file with our path and filename
SoundPlay($sPath & $sFileName,1)
EndFunc
Func PlaySound2()
$sFileName = "bomb droppng.mpg"
SoundPlay($sPath & $sFileName,1)
EndFunc
Func ExitProg()
exit 0
EndFunc
you can then run it as a script or compile it as a exe
to use this as is copy the sound files to the dir C:\sounds and hit F4 to exit , F5 for sound 1,F6 for sound 2
example sound files can be found here
- ilythor
- Retired
- Posts: 436
- Joined: Sun Oct 14, 2007 3:44 am
- EQ2Emu Server: TessEq2
- Location: Australia, mate!
- Contact:
Re: Starting At the bottom
Awesome, Thanks!
If I wanted more sounds, I would add more hotkeys, and duplicate these sections? (following the same syntax and changing the sound names etc).
I am at school now, I'm going to try it out when I get home!
Wow, thats awesome! Oh and loads of thanks for the comments in the script, makers a lot more sense now!
If I wanted more sounds, I would add more hotkeys, and duplicate these sections? (following the same syntax and changing the sound names etc).
Code: Select all
Func PlaySound1()
;sets file name
$sFileName = "boing_x.wav"
;play sound file with our path and filename
SoundPlay($sPath & $sFileName,1)
EndFuncWow, thats awesome! Oh and loads of thanks for the comments in the script, makers a lot more sense now!
"Everytime you pull the trigger in space, you will ruin someone's day, somewhere, and eventually, some time."
- ilythor
- Retired
- Posts: 436
- Joined: Sun Oct 14, 2007 3:44 am
- EQ2Emu Server: TessEq2
- Location: Australia, mate!
- Contact:
Re: Starting At the bottom
I think i did something wrong here, I expanded on your code following syntax and changed a few file paths but i think i stuffed up somewhere, as I compiled and ran it as an exe, the icon in my task bar (after unpausing) flashes between the AutoIt icon and a red X. Here is my code. Its probably a simple problem. Thanks for any help!
File paths and file names are all correct and I can't see any errors. I will try to find a way to see whats wrong, if AutoIt has an error log.
Code: Select all
HotKeySet("{F4}", "ExitProg") ;;Sets F4 as a hotkey to exit program
HotKeySet("{F5}", "PlaySound1") ;;Sets F5 as a hotkey to play sound 1
HotKeySet("{F6}", "PlaySound2") ;;Sets F6 as a hotkey to play sound 2
HotKeySet("{F7}", "PlaySound3") ;;Sets F7 as a hotkey to play sound 3
;path where sound files are at
Dim $sPath = "D:\Gorcin\Announcements"
;file name of sound files
Dim $sFileName = ""
While 1
Sleep(100) ;;;Waits for function call
Wend
Func PlaySound1()
;sets file name
$sFileName = "headshot.wav"
;play sound file with our path and filename
SoundPlay($sPath & $sFileName,1)
EndFunc
Func PlaySound2()
$sFileName = "denied.wav"
SoundPlay($sPath & $sFileName,1)
EndFunc
Func PlaySound3()
$sFileName = "vehicularmansalughter.wav"
SoundPlay($sPath & $sFileName,1)
EndFunc
Func ExitProg()
exit 0
EndFunc"Everytime you pull the trigger in space, you will ruin someone's day, somewhere, and eventually, some time."
-
Bion
- Retired
- Posts: 241
- Joined: Sun Sep 16, 2007 1:47 pm
Re: Starting At the bottom
it sounds like it is still paused if it is flashing with the red x just by clicking the task tray icon pauses it. just run the exe and when you see the tasktray icon the program is loaded and waiting for you to hit the assigned hotkeys to do what it needs to do.
everything looks fine except for here
it is missing the last \ . should be Dim $sPath = "D:\Gorcin\Announcements\"
the goal here is to make it when the path and filename are joined it gives the exact location of the file if that last \ is missing then it will read like D:\Gorcin\Announcementsdenied.wav instead of D:\Gorcin\Announcements\denied.wav
everything looks fine except for here
Code: Select all
;path where sound files are at
Dim $sPath = "D:\Gorcin\Announcements"
the goal here is to make it when the path and filename are joined it gives the exact location of the file if that last \ is missing then it will read like D:\Gorcin\Announcementsdenied.wav instead of D:\Gorcin\Announcements\denied.wav
- ilythor
- Retired
- Posts: 436
- Joined: Sun Oct 14, 2007 3:44 am
- EQ2Emu Server: TessEq2
- Location: Australia, mate!
- Contact:
Re: Starting At the bottom
Oh, thought it was something small, thanks again. I will try it when I get home (again).
Yeah, that was it. Thanks heaps! Now I am going to try and see if I can redistribute as a package. Plenty of credits to you! Thanks!
Yeah, that was it. Thanks heaps! Now I am going to try and see if I can redistribute as a package. Plenty of credits to you! Thanks!
"Everytime you pull the trigger in space, you will ruin someone's day, somewhere, and eventually, some time."
Who is online
Users browsing this forum: No registered users and 0 guests