Beer script

By jackster35-1 on Oct 31, 2010

A easy script I made for my friend.

Syntax:

!reg - Register
!unreg Unregister
!drink - Drink
!stats - Stats

Credit goes to TMFKSOFT for the idea and the original script. I re-wrote it for him as his one wasn't working out to well and was getting people confused.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;; Drink script ;;;;;;;;
;;;;; By Jackster35 ;;;;;;;;
;;;;; All rights to ;;;;;;;;
;;;;;  Jackster35   ;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;

on *:TEXT:!reg:#:{
  if (!%drink.reg [ $+ [ $nick ] ]) {
    set %drink.reg [ $+ [ $nick ] ] 1
    msg $chan Thank you $nick $+ , you're now registered in my database.
  }
  else {
    msg $chan Sorry $nick $+ , you're already registered
  }
}
on *:TEXT:!unreg:#:{
  if (%drink.reg [ $+ [ $nick ] ] = 1) {
    set %drink.reg [ $+ [ $nick ] ] 0
    msg $chan Thank you $nick $+ , you're now unregistered.
  }
  else {
    msg $chan Sorry $nick $+ , you're not registered.
  }
}
on *:TEXT:!drink:#:{
  if (%drink.reg [ $+ [ $nick ] ] = 1) {
    inc %d. [ $+ [ $nick ] ]
    describe $chan slides $nick a pint
    msg $chan Happy $nick $+ ? You got your pint, I'll add that to your tab.
  }
  else {
    msg $chan Please register by typing !reg....
  }
}
on *:TEXT:!stats*:#:{
  if (!$2) {
    if (%drink.reg [ $+ [ $nick ] ] = 1) {
      msg $chan $nick $+ : $iif(!%d. [ $+ [ $nick ] ],0,%d. [ $+ [ $nick ] ]) drink(s).
    }
    else {
      msg $chan Please Register $nick $+ .
    }
  }
  else {
    if (%drink.reg [ $+ [ $2 ] ] = 1) {
      msg $chan $2 $+ : $iif(!%d. [ $+ [ $2 ] ],0,%d. [ $+ [ $2 ] ]) drink(s).
    }
    else {
      msg $chan Please Register $nick $+ .
    }
  }
}

Comments

Sign in to comment.
macs-rock   -  Dec 11, 2010

OMG

 Respond  
TMFKSOFT   -  Nov 06, 2010

TY Jackster35 :)

 Respond  
jackster35-1   -  Nov 03, 2010

Hmm, thanks for all the feed back guys, also TMFKSOFT, millions of people have thought of a idea like this. Although, I'm not gonna be harsh so I've now given you credit.

 Respond  
napa182   -  Nov 01, 2010

instead of filling up ur var list maybe go with hash an as well a flood pro and go with address instead of nick
just a fast ex:

on $*:text:/^!(\w+)?\s?(\S+)?$/iS:#:{
  if (!$($+(%,f,$wildsite),2)) { inc -u10 $+(%,f,$wildsite) 
    if ($regml(1) = reg) {
      if (!$hget(drink,$+(reg,$wildsite))) {
        hadd -m drink $+(reg,$wildsite) yes
        msg # Thank you $nick $+ , you're now registered in my database.
      }
      else { msg # Sorry $nick $+ , you're already registered }
    }
    elseif ($regml(1) = unreg) { 
      if ($hget(drink,$+(reg,$wildsite))) {
        hdel drink $+(reg,$wildsite)
        hdel drink $+(c,$wildsite)
        msg # Thank you $nick $+ , you're now unregistered.
      }
      else { msg # Sorry $nick $+ , you're not registered. }
    }
    elseif ($regml(1) = drink) {
      if ($hget(drink,$+(reg,$wildsite))) {
        hinc -m drink $+(c,$wildsite) 1
        describe # slides $nick a pint
        msg # Happy $nick $+ ? You got your pint, I'll add that to your tab.
      }
      else { msg # Please register by typing !reg.... }
    }
    elseif ($regml(1) = stats) {
      if (!$regml(2)) {
        if ($hget(drink,$+(reg,$wildsite))) {
          msg # $nick $+ : $iif($hget(drink,$+(c,$wildsite)),$v1,0) drink(s).
        }
        else { msg # Please Register $nick $+ . }
      }
      elseif ($hget(drink,$+(reg,$address($regml(2),2)))) {
        msg # $nick $+ : $iif($hget(drink,$+(c,$address($regml(2),2))),$v1,0) drink(s).
      }
      else { msg # Sorry But $regml(2) is not registered $+ . }
    }
  }
}
alias -l savedrink { .hsave drink $qt($scriptdirdrink.hsh) }
alias -l loaddrink { if (!$hget(drink)) { .hmake drink 100 | .hload drink $qt($scriptdirdrink.hsh) } } 
on *:disconnect:$savedrink 
on *:exit:$savedrink
on *:start:$loaddrink
on *:load:$loaddrink
on *:connect:$loaddrink
 Respond  
irchainscriptz   -  Nov 01, 2010

0.o

 Respond  
Dark|   -  Nov 01, 2010

Nice snippet. :)

 Respond  
TMFKSOFT   -  Nov 01, 2010

:P lol

 Respond  
Sorasyn   -  Oct 31, 2010

Should probably credit if what he says is true ^^^^^^ Lol.

As for "registering" it would probably be more beneficial and organized to have used text files instead of using %drink.reg [ $+ [ $nick ] ]. For more reasons than I really care to explain at 2 in the morning.

 Respond  
TMFKSOFT   -  Oct 31, 2010

Erm and i created the original code and you rewrote it for me :(

 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.