1. We have moved to a new forum system. All your posts and data should have transferred over. Welcome, to the new Serebii Forums. Details here
    Dismiss Notice
  2. Be sure to join the discussion on our discord at: Discord.gg/serebii
    Dismiss Notice
  3. If you're still waiting for the e-mail, be sure to check your junk/spam e-mail folders
    Dismiss Notice

Script to auto-control the volume of your computer.

Discussion in 'Chatroom Discussion' started by Neal, Aug 22, 2007.

Thread Status:
Not open for further replies.
  1. Neal

    Neal Banned

    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. Shuko

    Shuko Pippi! Pi!

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

    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. :/
     
  3. Neal

    Neal Banned

    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.
     
    Last edited: Aug 22, 2007
  4. Shuko

    Shuko Pippi! Pi!

    No, but it's not a very elegant way to code either. :p Still, some languages are restricted to really primitive conditionals like that. :)
     
  5. Neal4

    Neal4 Banned

    How would you have coded it, then?
     
  6. Shuko

    Shuko Pippi! Pi!

    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
     
  7. Kirby

    Kirby ʘ‿ʘ Staff Member Admin

    LMAO!!!

    Not only that, but pick a better user name if you're going to evade a ban.
     
  8. Kireas

    Kireas Pokemon Collector

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

    If so, dont use it people!
     
  9. Kirby

    Kirby ʘ‿ʘ Staff Member Admin

    No, and it's not of your concern to ask why he was banned.

    And this topic shouldn't even be open.
     
Thread Status:
Not open for further replies.

Share This Page