• Hi all. We have had reports of member's signatures being edited to include malicious content. You can rest assured this wasn't done by staff and we can find no indication that the forums themselves have been compromised.

    However, remember to keep your passwords secure. If you use similar logins on multiple sites, people and even bots may be able to access your account.

    We always recommend using unique passwords and enable two-factor authentication if possible. Make sure you are secure.
  • Be sure to join the discussion on our discord at: Discord.gg/serebii
  • If you're still waiting for the e-mail, be sure to check your junk/spam e-mail folders

Script to auto-control the volume of your computer.

Status
Not open for further replies.

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.
 

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

Neal

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

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

Shuko said:
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:

Shuko

Pippi! Pi!
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. :p Still, some languages are restricted to really primitive conditionals like that. :)
 

Shuko

Pippi! Pi!
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
 

Kirby

ʘ‿ʘ
Staff member
Admin
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.
 

Kireas

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

If so, dont use it people!
 
Status
Not open for further replies.
Top