Aucun50 commented on a Page, Douche Meter  -  Mar 27, 2011

Few problems with this snippet that can and should be fixed.

First off, the aliases. You can combine your aliases into one. Here is a little example of what I mean putting it in a very simple form.

alias meter {
  if ($1 == add) { set $+(%,$2) $calc($($+(%,$2),2) + 1) | msg #lounge 4 $+ $2 $+ 's Douche Meter: $($+(%,$2),2)[+1] }
  else if ($1 == show) { msg #lounge 4 $+ $2 $+ 's Douche Meter: $($+(%,$2,),2)[0] }
  else if ($1 == take) { set $+(%,$2) $calc($($+(%,$2),2) - 1) |  msg #lounge 4 $+ $2 $+ 's Douche Meter: $($+(%,$2),2)[-1] }

This alias is then used by typing /meter add/take/show. For the script at hand I wouldn't recommend using variables as 1 can turn into 30 very fast. You should look into using a file like .txt. It will keep your variables down and store your information in a nice and neat file.

Second thing I noticed was your text event, it is only set for one channel, #lounge. You might want to make it work for all channels are let people know they need to edit the snippet if they wish to use it in other channels. For your event you can make use of the else if statement, not a big deal but it's a good habit to use else if rather then all if statements when scripting. In my opinion anyways.

Last but not least your alias power. This doesn't give they anything new for the script, it doesn't allow them to do anything related to this script. The only difference is they will be added to the users file for that mIRC. I don't see a real need for the alias as you don't use the command the way it was intended.

In all this isn't a bad snippet but it could use a little work, with time you might want to update. Also, this snippet can be easily flooded. You might want to look into adding flood control.

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.