A script to make what you say have a cool design around it. You have a choice of blue, green, pink, and red. everything is controled by the menu, just right click on a channel or PM. click off to turn it off of cource.
on *:input:*: {
if ($left($1,1) == /) { return }
if ($left($1,1) == !) { return }
else {
if (%font == Blue) {
haltdef
msg $active 12%0,12% 2%12,2% 1%2,1%0 $1- 2%1,2% 12%2,12% 0%12,0%
}
elseif (%font == Red) {
haltdef
msg $active 4%0,4% 5%4,5% 1%5,1%0 $1- 5%1,5% 4%5,4% 0%4,0%
}
elseif (%font == Green) {
haltdef
msg $active 9%0,9% 3%9,3% 1%3,1%0 $1- 3%1,3% 9%3,9% 0%9,0%
}
elseif (%font == Pink) {
haltdef
msg $active 13%0,13% 6%13,6% 1%6,1%0 $1- 6%1,6% 13%6,13% 0%13,0%
}
elseif (%font == Orange) {
haltdef
msg $active 8%0,8% 7%8,7% 1%7,1%0 $1- 7%1,7% 8%7,8% 0%8,0%
}
elseif (%font == Grey) {
haltdef
msg $active 15%0,15% 14%15,14% 1%14,1%0 $1- 14%1,14% 15%14,15% 0%15,0%
}
elseif (%font == Skyblue) {
haltdef
msg $active 11%0,11% 10%11,10% 12%10,12%0 $1- 10,12%12,10% 11%10,11% 0,11%11,0%
}
elseif (%font == LemonLime) {
haltdef
msg $active 3%0,3% 9%3,9% 8%9,8%1 $1- 9%8,9% 3,9%9,3% 0,3%3,0%
}
elseif (%font == Berry) {
haltdef
msg $active 6%0,6% 4%6,4% 5%4,5%0 $1- 4,5%5,4% 6,4%4,6% 0,6%6,0%
}
elseif (%font == Emo) {
haltdef
msg $active 1%0,1% 14,1%1,14% 15,14%14,15%1 $1- 14,15%15,14% 1,14%14,1% 0,1%1,0%
}
elseif (%font == Superman) {
haltdef
msg $active 4/5,12/ 4/12,4/ 5/4,5/0 $1- 4/5,4/ 12/4,12/ 5/4,0/
}
elseif (%font == Purplewaves) {
haltdef
msg $active 6/0,6/ 13/6,13/ 6/13,2/ $1- 13/2,13/ 6/13,6/ 0,6/6,0/
}
elseif (%font == Rainbow) {
haltdef
msg $active 7,4|4,7|8,7|7,8|9,8|8,9|10,9|9,10|12,10|10,12|0 $1- 3|12,3|9|3,9|8,9|9,8|7,8|8,7|4,7|7,4|
}
elseif (%font == Money) {
haltdef
msg $active 3$0,3$ 9$3,9$ 3$9,3$0 $1- 9$3,9$ 3$9,3$ 0,3$3,0$
}
elseif (%font == Tubby) {
haltdef
msg $active 7<(^_^<) $1- 7(>^_^)>
}
}
}
menu menubar,channel,query {
.Fonts
..Blue :set %font Blue
..Red :set %font Red
..Green :set %font Green
..Pink :set %font Pink
..Orange :set %font Orange
..Grey :set %font Grey
..Skyblue :set %font Skyblue
..LemonLime :set %font LemonLime
..Berry :set %font Berry
..Emo :set %font Emo
..Superman :set %font Superman
..Purplewaves :set %font Purplewaves
..Rainbow :set %font Rainbow
..Money :set %font Money
..Tubby :set %font Tubby
..Off :unset %font
}
i dont know but i think that in some cases the command /goto is faster as in this example
alias t {
var %x $r(1,5)
if %x == 1 { /cmd }
elseif %x == 2 { /cmd }
elseif %x == 3 { /cmd }
elseif %x == 4 { /cmd }
elseif %x == 5 { /cmd }
}
alias t {
goto $r(1,5)
:1
/cmd
halt
:2
/cmd
halt
...
...
..
:5
/cmd
halt
}
so with /goto the code avoid several conditions
to immediately consider /goto as a quick and easy fix rather than restructuring your code is, admittedly, bad practice; but that's not really an issue here.
here we're seeing /goto being used analogous to switch/case in other languages, which most certainly isn't surrounded by stigma, and is in this instance a very clear and easy method to follow and maintain. i've used and have seen /goto used very elegantly in mirc ;PI concur wholeheartedly.
just a small comment about /goto being considered bad practice. is it not worse practice to steer clear of a certain feature entirely without being aware of its good and bad points?
/goto is generally considered inadvisable because you will, invariably, find people (usually beginners) that will use it at every turn in place of constructs such as nested if/else statements which are much clearer and, consequently, more maintainable. to immediately consider /goto as a quick and easy fix rather than restructuring your code is, admittedly, bad practice; but that's not really an issue here.
here we're seeing /goto being used analogous to switch/case in other languages, which most certainly isn't surrounded by stigma, and is in this instance a very clear and easy method to follow and maintain. i've used and have seen /goto used very elegantly in mirc ;P
if $active != status window
why not the contrary
on *:input:*:{
if ($left($1,1) != /) && ($active != status window) && (%font) {
haltdef
msg $active %font
}
}
menu menubar,channel,query {
.Fonts
..Blue :set %font 12%0,12% 2%12,2% 1%2,1%0 $!1- 2%1,2% 12%2,12% 0%12,0%
..Red :set %font 4%0,4% 5%4,5% 1%5,1%0 $!1- 5%1,5% 4%5,4% 0%4,0%
..Green :set %font 9%0,9% 3%9,3% 1%3,1%0 $!1- 3%1,3% 9%3,9% 0%9,0%
..Pink :set %font 13%0,13% 6%13,6% 1%6,1%0 $!1- 6%1,6% 13%6,13% 0%13,0%
..Off :unset %font
}
lol that's a funny way to put it every time people refer goto as being that of "Spaghetti". Well, I've heard the goods and bads about using goto command. I have nothing against that; it's just it works the same as opposed to that of a bunch of if statements. To me, as a matter of preference, the goto looks shorter and cleaner to me. Oh, I'm not gonna compare goto with the efficiency in speed. That's not gonna make any difference in today's PC.
Perhaps we'll let people be their own judge when it comes to "Spaghetti" and "Meatballs." Meatballs, as being my way of coining the if statements.
You can use goto command for this, which makes your code shorter in bytes:
on *:input:*:{
$iif(($left($1,1) != / && %font),goto $v1,return)
:Blue
msg $active 12%0,12% 2%12,2% 1%2,1%0 $1- 2%1,2% 12%2,12% 0%12,0%
halt
:Red
msg $active 4%0,4% 5%4,5% 1%5,1%0 $1- 5%1,5% 4%5,4% 0%4,0%
halt
:Green
msg $active 9%0,9% 3%9,3% 1%3,1%0 $1- 3%1,3% 9%3,9% 0%9,0%
halt
:Pink
msg $active 13%0,13% 6%13,6% 1%6,1%0 $1- 6%1,6% 13%6,13% 0%13,0%
halt
}