Results 1 to 9 of 9

Thread: Script to auto-control the volume of your computer.

  1. #1
    Join Date
    Jul 2007
    Location
    6443 N. Seeley 60645 Chicago
    Posts
    0

    Default Script to auto-control the volume of your computer.

    Here's something I wrote of laziness.

    When someone calls my name (or nick), my computer plays a sound.

    When I get opped, deopped, voiced, devoiced, invites, noticed, pm'd, etc., my computer also plays a different sound, so I know what happened, etc.

    When I go away from the computer, like into another room, obviously, I increase the volume of my computer, so I can hear if someone called my name from a distance.

    But then, what if I forgot? Or what if I'm lazy?

    Then, if I'm at a sleepover at someone's house, and it's past 10 o' clock at night, and someone calls my name, if my volume is up, uh oh, it can wake the people of the house. So obviously, I need mIRC to auto-lower the volume!

    So here's something I wrote to take care of that.

    If you do not have an on input event (using plain mIRC), use this:

    Code:
    on *:input:*: {
      if (/* !iswm $1) {
        /say $1-
      }
      .timersetvolume 1 300 /volume $asctime(dddd)
    }
    If you do have an on input event (such as SPP Script), just add this line to the bottom of the input event, before the last }.

    .timersetvolume 1 300 /volume $asctime(dddd)

    Now add this to your remotes:

    Code:
    alias volume {
      if ($time(HH) > 22) {
        if ($1 == Friday) || ($1 == Saturday) { /halt }
        /vol -v 2621
      }
      if ($time(HH) < 8) {
        if ($1 != Saturday) || ($1 != Sunday) { /halt }
        /vol -v 2621
      }
      if ($time(HH) > 8) && ($time(HH) < 10) {
        if ($1 == Friday) || ($1 == Saturday) { /halt }
        /vol -v 15728
      }
      if ($time(HH) > 10) && ($time(HH) < 22) {
        /vol -v 41942
      }
    }
    Basically, if it's 10 o' clock at night, it will lower the volume, except when it's a Friday or Saturday.

    It increases the volume, except on Saturday and Sunday mornings (so you can sleep in and not let IRC people wake you up).

    You can also optionally this:

    on *:start
    if ($time(HH) < 22) && ($time(HH) > 8) { /.timervolume -o 22:00 0 1 /vol -v 2621 }
    if ($time(HH) > 22) || ($time(HH) < 6) { /.timervolume -o 8:30 0 1 /vol -v 15728 }
    }

    Basically, this script checks that if you've been idle for 5 minutes, your mIRC assumes you're "away" and increases the volume of your computer (bigger number is louder). But of course, it'll lower it if it's the right hour.

    The maximum volume is 65,536. The minimum is 0. You can mute your computer sure.

    Any other ideas?

    This script was made for you to edit, of course. You can pick your own volume, and edit your own hours, and day of the week.

    Let me know if you need help.

    -Neal.

  2. #2
    Join Date
    Sep 2006
    Posts
    1,497

    Default

    I thought it was against the rules for non-OPs to use scripts.

    Still, it's a pretty useful little couple of functions you've got there. Wish there was a better way to do the second one than a bunch of if-statements. :/

    Stealthy Ninja Mario - A Crossover through Realms

    @>-{Click to see my shinies}- (Currently not trading) | -{Hunting Shinies with the Pokeradar}-<@
    ---------------------------------------------------------
    I was SHUKO-CHAN from NSider. Long live the Yoshis of the world!

  3. #3
    Join Date
    Jul 2007
    Location
    6443 N. Seeley 60645 Chicago
    Posts
    0

    Default

    Quote Originally Posted by Shuko View Post
    I thought it was against the rules for non-OPs to use scripts.
    All the script entirely does is change the volume of your computer. Whether an SPP op gets in the way of that, o well. However, there is no way of them knowing...

    Quote Originally Posted by Shuko
    Wish there was a better way to do the second one than a bunch of if-statements. :/
    Eh?

    Those if statements don't slow you down.

    -Neal.
    Last edited by Neal; 23rd August 2007 at 12:14 AM.

  4. #4
    Join Date
    Sep 2006
    Posts
    1,497

    Default

    Quote Originally Posted by Neal View Post
    All the script entirely does is change the volume of your computer. Whether an SPP op gets in the way of that, o well. However, there is no way of them knowing...



    Eh?

    Those if statements don't slow you down.

    -Neal.
    No, but it's not a very elegant way to code either. Still, some languages are restricted to really primitive conditionals like that.

    Stealthy Ninja Mario - A Crossover through Realms

    @>-{Click to see my shinies}- (Currently not trading) | -{Hunting Shinies with the Pokeradar}-<@
    ---------------------------------------------------------
    I was SHUKO-CHAN from NSider. Long live the Yoshis of the world!

  5. #5
    Join Date
    Aug 2007
    Posts
    0

    Default

    How would you have coded it, then?

  6. #6
    Join Date
    Sep 2006
    Posts
    1,497

    Default

    Quote Originally Posted by Neal4 View Post
    How would you have coded it, then?
    What the? o_0

    It's not very bright to come back to the same thread once you've evaded your ban. xD

    Anyway, if you must know, a switch is much better. I'm all for anything that decreases text in the code, while gets the job done in an optimum manner. Streamlined, elegant code is much nicer. Indeed, it's like an art form, lol. I have yet to master it though. xD

    Stealthy Ninja Mario - A Crossover through Realms

    @>-{Click to see my shinies}- (Currently not trading) | -{Hunting Shinies with the Pokeradar}-<@
    ---------------------------------------------------------
    I was SHUKO-CHAN from NSider. Long live the Yoshis of the world!

  7. #7
    Join Date
    Jun 2004
    Location
    Wet.
    Posts
    6,039

    Default

    Quote Originally Posted by Shuko View Post
    What the? o_0

    It's not very bright to come back to the same thread once you've evaded your ban. xD

    Anyway, if you must know, a switch is much better. I'm all for anything that decreases text in the code, while gets the job done in an optimum manner. Streamlined, elegant code is much nicer. Indeed, it's like an art form, lol. I have yet to master it though. xD
    LMAO!!!

    Not only that, but pick a better user name if you're going to evade a ban.
    If you want to fight me on Smash Bros or race me on Mario Kart 8 send me a PM or VM.

  8. #8
    Join Date
    Aug 2007
    Location
    Woking, UK
    Posts
    3

    Default

    ...Was he banned for using that script? >_>

    If so, dont use it people!

    Trainer card over the limit set for regular ones, so it was removed.

  9. #9
    Join Date
    Jun 2004
    Location
    Wet.
    Posts
    6,039

    Default

    Quote Originally Posted by Kireas View Post
    ...Was he banned for using that script? >_>

    If so, dont use it people!
    No, and it's not of your concern to ask why he was banned.

    And this topic shouldn't even be open.
    If you want to fight me on Smash Bros or race me on Mario Kart 8 send me a PM or VM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •