Degausser commented on a Page, Bar Script (Randomized) v2  -  Jul 24, 2017

You should really cut down this script a bit. Here are a couple examples.

For the last "else" block in the whole script, you randomly select 1-8, and describe as appropriate. With only 8 options, a good method is adding a local alias which just returns a string of possibilities. In this case i would add something like this near the top of my page:

alias -l listSnacks return Boost.Flake.Cherry Ripe.Mars Bar.Snickers of Chocolate of of Mont Chocos

Each result is seperated by a dot. The idea is, you can easily add another element to your list, and the code will handle it. If this alias were present within your script, your last else statement could look like this:

else { describe $chan gives $nick a $gettok($listSnacks,$rand(1,$numtok($listSnacks,46)),46) }

Like this, you're simply selecting a random element from your list, using ASCII value 46 (a dot) as your token separator.

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.