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 $+ .
}
}
}
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