Sgkk alias

By Kentaro Kurosaki on Dec 10, 2011

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

Comments

Sign in to comment.
Jethro   -  Dec 21, 2011

Very, very nice. Thanks jaytea for your time and thorough explanation. ^^

More
 Respond  
jaytea   -  Dec 21, 2011

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.

More
 Respond  
Jethro   -  Dec 20, 2011

I often run into unworkability when I use an elseif right after an if upon sockread. Unless there's a comparison for me to make if-elseif-else, I'll use ifs straight up, and it works perfectly that way. :p

More
 Respond  
blackvenomm666   -  Dec 20, 2011

yea i know. i had a lof stuff set up that way and got yelled at by other coders for it haha. all should be elseif after the first ifff. so i thought i'd say it nicely before one of the other dicks said it not so nicely

More
 Respond  
Jethro   -  Dec 20, 2011

Ryan, though it works with multiple ifs.

More
 Respond  
blackvenomm666   -  Dec 20, 2011

and technically after your first if statement the others should be elseif's

More
 Respond  
Kentaro Kurosaki   -  Dec 10, 2011

o,o Yes I am, thank you Edit: Though I found its only on here, so i copied wrong

More
 Respond  
_Dean_   -  Dec 10, 2011

missing a closing bracket

More
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.