I use it to help me remember the commands for #sgkk on Rizon
/sgkk
fun
channel
releases
other
/sgkk
!apples
!loli
!sw
!cookie
!mizore
!sgkk
/sgkk
!rules
!topic
!help
!tt sgkk
!welcome
/sgkk
@find
!list
!releases
/sgkk
!tracker
!status
!peak
!stats
!quotes
!fabulous
!jecht
!win
!fail
!bar
!misc
!pickpocket
!rape
!fml
!bb
/sgkk
!lottery
!roulette
alias sgkk {
if ($1 == $null) {
echo 3 -a fun
echo 3 -a channel
echo 3 -a releases
echo 3 -a other
}
if ($1 == fun) {
echo 4 -a !apples
echo 4 -a !loli
echo 4 -a !sw
echo 4 -a !cookie
echo 4 -a !mizore
echo 4 -a !sgkk
}
if ($1 == channel) {
echo 3 -a !rules
echo 3 -a !topic
echo 3 -a !help
echo 3 -a !tt sgkk
echo 3 -a !welcome
}
if ($1 == releases) {
echo 3 -a @find
echo 3 -a !list
echo 3 -a !releases
}
if ($1 == other) {
echo 3 -a !tracker
echo 3 -a !status
echo 3 -a !peak
echo 3 -a !stats
echo 3 -a !quotes
echo 3 -a !fabulous
echo 3 -a !jecht
echo 3 -a !win
echo 3 -a !fail
echo 3 -a !bar
echo 3 -a !misc
echo 3 -a !pickpocket
echo 3 -a !rape
echo 3 -a !fml
echo 3 -a !bb
}
if ($1 == gamble) {
echo 3 -a !lottery
echo 3 -a !roulette
}
}
all should be elseif after the first ifff.
I often run into unworkability when I use an elseif right after an if upon sockread.
forgive me, but i sense there's still some confusion about what is one of the most fundamental programming concepts.
if (A) {
}
if (B) {
}
if (C) {
}
here, each of the conditions 'A', 'B' and 'C' are tested (unless the code is forced to end prematurely with /halt or /return). the if statements act independently. even in the case where 'B' can only be true if 'A' is false, or 'C' can only be true if both 'A' and 'B' are false, they are all still tested.
if (A) {
}
elseif (B) {
}
elseif (C) {
}
here, 'B' is only tested if 'A' is false. and 'C' is only tested if both 'A' and 'B' are false. when you're dealing with the case mentioned earlier, this code is ideal especially if 'B' and 'C' are computationally expensive checks, or if you want a final 'else' default case, or simply to adhere to good practice as in this snippet's case.
if you're not comfortable with a certain language construct then TEST IT. don't test it in the middle of your socket script, or with some other 1000 line script; test it in a simplified bit of code, and in a variety of different ways until you understand how it works.