Author Topic: Volume Script/Bind  (Read 3334 times)

DaRkNeSS

  • Autococker
  • Posts: 622
Volume Script/Bind
« on: December 27, 2007, 10:06:50 PM »
Is it possible to setup whether through a script or just commands some binds that will increase and decrease my DP volume?  I have buttons on my keyboard but that control my overall volume, but I was wondering if I could make some volume binds for DP.  Any help is appreciated, thanks.

coLa

  • Autococker
  • Posts: 1178
Re: Volume Script/Bind
« Reply #1 on: December 27, 2007, 10:09:53 PM »
pretty sure if you can find the volume command (if there is one) the script or bind would be easy. i have not heard or come across a volume command other than the toggle bar in the setup menu. i would like to know the command also.

Eiii

  • Autococker
  • Posts: 4595
Re: Volume Script/Bind
« Reply #2 on: December 27, 2007, 10:27:58 PM »
Code: [Select]
bind "KEY" "volswitch"

alias "volswitch" "vol3"
alias "vol1" "s_volume 0.1; echo Volume Low; alias volswitch vol2"
alias "vol2" "s_volume 0.3; echo Volume Med-Low; alias volswitch vol3"
alias "vol3" "s_volume 0.5; echo Volume Medium; alias volswitch vol4"
alias "vol4" "s_volume 0.7; echo Volume Med-High; alias volswitch vol5"
alias "vol5" "s_volume 1.0; echo Volume High; alias volswitch vol1"

That should do it. Replace KEY with whatever key you want to toggle between volumes, and hit that to cycle through.

Cobo

  • Autococker
  • Posts: 1362
Re: Volume Script/Bind
« Reply #3 on: December 27, 2007, 10:29:52 PM »
Its not a command, its a cvar.
s_volume

So yes its possible.

Eiii beat me to it but anyway...


Also, you dont have to create a whole script for something as simple as increasing/decreasing a cvar, use the cvar_inc and cvar_dec commands.

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Volume Script/Bind
« Reply #4 on: December 27, 2007, 10:35:45 PM »
I didn't know what the command was.  Thanks.


So how could I make a Increase and Decrease bind?

Eiii

  • Autococker
  • Posts: 4595
Re: Volume Script/Bind
« Reply #5 on: December 27, 2007, 10:35:51 PM »
Also, you dont have to create a whole script for something as simple as increasing/decreasing a cvar, use the cvar_inc and cvar_dec commands.
But those don't have min/max/wraparound capability, do they?
EDIT: Looks like they do. But you wouldn't be able to detect what level it was at...
I like my toggle more.

A-like-a this.

Code: [Select]
bind "KEY" "volup"
bind "KEY" "voldn"

alias "volup" "cvar_inc s_volume .1 0 1"
alias "voldn" "cvar_inc s_volume .1 0 1"


EDIT AGAIN: Here's an updated version of my previous script that allows for both a volume up key and a volume down key.
Code: [Select]
bind "KEY" "volup"
bind "KEY" "voldn"

alias "volup" "vol3"
alias "voldn" "vol2"
alias "vol1" "s_volume 0.1; echo Volume Low; alias volup vol2; alias voldn vol5"
alias "vol2" "s_volume 0.3; echo Volume Med-Low; alias volup vol3; alias voldn vol1"
alias "vol3" "s_volume 0.5; echo Volume Medium; alias volup vol4; alias voldn vol2"
alias "vol4" "s_volume 0.7; echo Volume Med-High; alias volup vol5; alias voldn vol3"
alias "vol5" "s_volume 1.0; echo Volume High; alias volup vol1; alias voldn vol4"

Cobo

  • Autococker
  • Posts: 1362
Re: Volume Script/Bind
« Reply #6 on: December 27, 2007, 10:38:55 PM »
bind + cvar_inc s_volume 0.1 0 1
bind - cvar_dec s_volume 0.1 0 1

Not sure if that would work correctly tho but it should be something like that.

Again, eiii beat me to it...

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Volume Script/Bind
« Reply #7 on: December 27, 2007, 10:39:36 PM »
I'll test it out, thanks.

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Volume Script/Bind
« Reply #8 on: December 27, 2007, 10:42:00 PM »
Another quick question, what are the binds for the keypad 4 and 6?

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Volume Script/Bind
« Reply #9 on: December 27, 2007, 10:44:26 PM »
K, tested it, and the max won't stop at 1, it will just keep on going and cycling with either key.

Eiii

  • Autococker
  • Posts: 4595
Re: Volume Script/Bind
« Reply #10 on: December 27, 2007, 11:20:59 PM »
That's why you use my second script. And why you shouldn't double or triple post.

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Volume Script/Bind
« Reply #11 on: December 27, 2007, 11:32:15 PM »
Sorry Eiii, I'm really working on my Automag status.



EDIT: I used your 2nd script, and like Cobo's it will just cycle through, it won't stop on a max or min value.

Cobo

  • Autococker
  • Posts: 1362
Re: Volume Script/Bind
« Reply #12 on: December 27, 2007, 11:37:37 PM »
Ok try
bind + cvar_inc s_volume 0.1 0.0 1.0
bind - cvar_dec s_volume 0.1 0.0 1.0

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Volume Script/Bind
« Reply #13 on: December 27, 2007, 11:45:14 PM »
No mojo.  It still cycled.

Eiii

  • Autococker
  • Posts: 4595
Re: Volume Script/Bind
« Reply #14 on: December 27, 2007, 11:55:40 PM »
Oh, you WANT it to stop? Sorry, I didn't understand. That's easy.

Code: [Select]
bind "KEY" "volup"
bind "KEY" "voldn"

alias "volup" "vol3"
alias "voldn" "vol2"
alias "vol1" "s_volume 0.1; echo Volume Low; alias volup vol2"
alias "vol2" "s_volume 0.3; echo Volume Med-Low; alias volup vol3; alias voldn vol1"
alias "vol3" "s_volume 0.5; echo Volume Medium; alias volup vol4; alias voldn vol2"
alias "vol4" "s_volume 0.7; echo Volume Med-High; alias volup vol5; alias voldn vol3"
alias "vol5" "s_volume 1.0; echo Volume High; alias voldn vol4"

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Volume Script/Bind
« Reply #15 on: December 28, 2007, 12:01:02 AM »
Brilliant indeed Eiii.  Thanks.

Hey Cobo I forgot what thread it was on when you mentioned a DP .exe you made with an irc client in it.  Do you still have it?

Eiii

  • Autococker
  • Posts: 4595
Re: Volume Script/Bind
« Reply #16 on: December 28, 2007, 12:03:19 AM »
Darkness: If you used it, you would be banned for client modification.

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Volume Script/Bind
« Reply #17 on: December 28, 2007, 12:06:53 AM »
If I used it online.

Eiii

  • Autococker
  • Posts: 4595
Re: Volume Script/Bind
« Reply #18 on: December 28, 2007, 12:11:32 AM »
If you used it offline, you wouldn't be able to chat in IRC. And anyway, it's just one-channel console IRC. Not pretty or readable at all.

coLa

  • Autococker
  • Posts: 1178
Re: Volume Script/Bind
« Reply #19 on: December 28, 2007, 12:13:38 AM »
are you talking about being able to connect and chat on irc through DP? if so warsow also has this and i have used it a couple times. it's a neat feature.