Douche Meter

By Nap on Mar 27, 2011

Just a script I've been working on for the past couple of days in my free time. It really is nothing, just a game I like to play with my friends. You can add to their Douche Meter. Sometimes we see who has the highest Douche rating at the end of the week or whatever. Sometimes it can actually be used if you need to keep track of someone and see if they get to a certain point.

Key:
For Admin:
/add [nick] = Gives 1 point to [nick]
/take [nick] = Takes 1 point from [nick]
/show [nick] = Shows [nick] meter to %chan
/compare [nick] [nick] = Compares [nick] meter vs [nick] meter
/power [nick] = Gives [nick] power to the script
/remove [nick] = Takes power away from [nick]

You can also have it so other people can control the script through you. If you do /power [nick] and add them to your user list, then they can also use the bot. For them, they have to do it in a query to you.

!add [nick] = Add 1 to [nick]
!take [nick] = Takes 1 from [nick]
!show [nick] = Shows [nick] meter to %chan
!compare [nick] = Compares [nick] meter vs [nick] meter

At the top of the script, you have to change #lounge to whatever channel you want it to be!

To clear the script, simply erase all the nicks from your variable list.

alias add { 
  set $+(%,$1) $calc($($+(%,$1),2) + 1)
  msg #lounge 4 $+ $1 $+ 's Douche Meter: $($+(%,$1),2)[+1]
}

alias show {
  msg #lounge 4 $+ $1 $+ 's Douche Meter: $($+(%,$1,),2)[0]
}

alias take { 
  set $+(%,$1) $calc($($+(%,$1),2) - 1)
  msg #lounge 4 $+ $1 $+ 's Douche Meter: $($+(%,$1),2)[-1]
}

alias compare {
  msg #lounge 4 $+ $1 $+ 's Douche Meter: $($+(%,$1),2) 9vs 4 $+ $2 $+ s Douche Meter: $($+(%,$2),2)
}

on R:TEXT:*:?: {
  if ($2 isin #lounge) {
    if ($1 == !add) {
      set $+(%,$2) $calc($($+(%,$2),2) + 1)
      msg #lounge 4 $+ $2 $+ 's Douche Meter: $($+(%,$2),2)[+1] ¤¤Done by $nick $+ ¤¤
    }
    if ($1 == !take) {
      set $+(%,$2) $calc($($+(%,$2),2) - 1)
      msg #lounge 4 $+ $2 $+ 's Douche Meter: $($+(%,$2),2)[-1] ¤¤Done by $nick $+ ¤¤
    }
    if ($1 == !add) {
      msg #lounge 4 $+ $2 $+ 's Douche Meter: $($+(%,$2,),2)[0] ¤¤Done by $nick $+ ¤¤
    }
    if ($1 == !take) {
      msg #lounge 4 $+ $2 $+ 's Douche Meter: $($+(%,$2),2) 9vs 4 $+ $3 $+ s Douche Meter: $($+(%,$3),2) ¤¤Done by $nick $+ ¤¤
    }
  }
  else {
    query $nick 4Error: $2 is not in #lounge!
  }
}

alias power {
  auser R $1
}

Comments

Sign in to comment.
Syele   -  Jan 29, 2016

I like this and am trying to use it, but I can only do the / commands directly into the bot. When I give power to people we cannot use the ! commands, tried it both in the channel and pming the bot. Can someone help?

 Respond  
MaxEvans   -  Mar 30, 2011

This is a pretty cool idea, I like where you're going with this. Would be nice to have a variable to set the channel you want this to work on without having to edit every single line where the channel is in the script though. =)

 Respond  
Callumlord   -  Mar 27, 2011

Yes, needs some tweaks here and there. But nice script. :)

 Respond  
Aucun50   -  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.

 Respond  
Callumlord   -  Mar 27, 2011

Thats better :)

 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.