Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:TEXT:*:#: { tokenize 32 $replace($strip($1-),@,!,.,!)
- if ($timer($+(Tender,$network,$nick))) { halt }
- ;*** Setting user/nick
- var %X 1, %mBarNiCK $iif($2 ison $chan,$nick(#,$nick(#,$2)),$iif($3 ison $chan,$nick(#,$nick(#,$v1)),$iif($4 ison $chan,$nick(#,$nick(#,$v1)),$iif($5 ison $chan,$nick(#,$nick(#,$v1)),$nick)))), %mBAR-NiCK $replacex(%mBarNiCK,[,@,],~,|,-,/,å)
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Bartender - You can download Bartender.mrc (/this script) from http://pastebin.com/A7tMVFM6
- if ($istok(!Tender !Bartender,$1,32)) { msg # $xTEXT(I've got) !beer $xSPACE !whiskey $xSPACE !bourbon $xSPACE !vodka $xSPACE !rum $xSPACE !tequila $xSPACE !wine $xSPACE !water $xTEXT(and) !drinks (as in mixed drinks) | goto END }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Beer - You can download Beer.txt (/DB) from http://pastebin.com/DRzrKN6j
- if ($istok(!Beer,$1,32)) { set -u1 %Type Beer }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Whiskey - You can download Whiskey.txt (/DB) from http://pastebin.com/tW7Ce8fR
- elseif ($istok(!Whiskey,$1,32)) { set -u1 %Type Whiskey | set -u1 %ResTYPE+ Whiskey }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Bourbon - You can download Bourbon.txt (/DB) from http://pastebin.com/rziKGRRY
- elseif ($istok(!Bourbon !Burbon,$1,32)) { set -u1 %Type Bourbon }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Vodka - You can download Vodka.txt (/DB) from http://pastebin.com/AzuVtzBv
- elseif ($istok(!Vodka,$1,32)) { set -u1 %Type Vodka }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Rum - You can download Rum.txt (/DB) from http://pastebin.com/wsdQhZNU
- elseif ($istok(!Rum,$1,32)) { set -u1 %Type Rum }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Tequila - You can download Tequila.txt (/DB) from http://pastebin.com/WeKB1F3A
- elseif ($istok(!Tequila,$1,32)) { set -u1 %Type Tequila }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** mDrink - You can download Drinks.txt (/DB) from http://pastebin.com/h9A3SBut
- elseif ($istok(!mDrinks,$1,32)) { set -u1 %Type Drinks }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Wine - You can download Wine.txt (/DB) from http://pastebin.com/JDWYYq0S
- elseif ($istok(!Wine !RedWine !WhiteWine,$1,32)) { set -u1 %Type Wine }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Water - You can download Water.txt (/DB) from http://pastebin.com/8pn03ZDA
- elseif ($istok(!Water,$1,32)) { set -u1 %Type Water }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- else { halt }
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** # #
- ;*** ## ## ###### #### #### ## #### ###### #### #### ###### #### ##### # #### # #
- ;*** # # # # # # # # # # # # # # # # # # # # # ## #
- ;*** # # # ##### #### #### # # # ##### #### #### ##### # # # # # # # #
- ;*** # # # # # ###### # ### # # # # # # # # # # # #
- ;*** # # # # # # # # # # # # # # # # # # # # # # # # ##
- ;*** # # ###### #### #### # # #### ###### #### #### ###### #### # # #### # #
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** Setting var for output and database
- if ($isfile($+(SRU\Bartender\,%Type,.txt))) { set -u1 %Read $read($+(SRU\Bartender\,%Type,.txt)) }
- set -u3 %ResTYPE.NiCK $calc($readini($+(SRU\Users\,%mBAR-NiCK,.ini),TOTAL,%TYPE) +1)
- set -u3 %ResTYPE.TOTAL $calc($readini($+(SRU\,0-TOTAL,.ini),TOTAL,%TYPE) +1)
- $iif($readini(SRU\Bartender\Timers.ini,%TYPE,LAST),set -u3 %ResTYPE.TiME $v1)
- set -u3 %ResTYPEs $replacex($+($lower(%TYPE),$iif(%ResTYPE.TOTAL > 1 && %TYPE != Drinks,s)),wines,glasses of wine,wine,glass of wine) has been ordered so far...
- set -u3 %ResSTATS $xWRAP($xNUM(%ResTYPE.TOTAL) %ResTYPEs $iif(%ResTYPE.TiME,last one $duration($calc($ctime -$v1)) ago) $iif(%ResTYPE.NiCK == %ResTYPE.TOTAL,ALL,$xNUM($v1)) by $xNiCK(%mBarNiCK) <o/)
- set -u3 %ResMONEY $calc(%ResTYPE.TOTAL * $replace(%TYPE,Beer,2.5,Whiskey,2,Bourbon,2,Vodka,2,Tequila,2,Water,0.75))
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;******* Messages section
- ;*** Shots
- if (bottle !isin $1-) && (%TYPE == Tequila) { set -u1 %RES-MSG grabs a couple of shotglass from the shelf and fills them with chilled $lower($v1) | set -u1 %RES-MSG2 .describe # fills a glass for himself and slides the other down the bar to $xNiCK(%mBarNiCK) }
- ;*** Whiskey
- elseif (%TYPE == Whiskey) { .describe # grabs a tall boy glass from the shelf and fills it with ice | set -u1 %RES-MSG adds a double shot of $lower($v1) and slides it down the bar to $xNiCK(%mBarNiCK) }
- ;*** mDrink (as in mixed drinks)
- elseif (%TYPE == Drinks) { set -u1 %RES-MSG grabs a chilled tall boy glass from the freezer and starts to mix a $iif(%Read,$v1,$lower(%TYPE)) $iif($r(1,2) == 1,to,for) $xNiCK(%mBarNiCK) }
- ;*** Everything else
- else { set -u1 %RES-MSG grabs a ice cold bottle of $iif(%Read,$v1,$lower(%TYPE)) and slides it across the bar to $xNiCK(%mBarNiCK) }
- ;******* Messages
- $iif(%RES-MSG2,.TiMER 1 1,$iif(%ResTYPE+,.TiMER 1 1)) .describe # %RES-MSG %ResSTATS
- ;***
- $iif(%RES-MSG2,.TiMER 1 2 $v1)
- ;*** TAB
- ; .TiMER 1 2 .notice $nick 14"There you go buddy... I'll add it to your tab14" ;) ooO( You have a $+(03,%ResMONEY,14$) tab running on %Type alone )
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- ;*** SAVE ( Create DB ) ********************************************************************************************************************************************************************************************************************************************************************************************************
- while (%X < 5) { var %mVARsT $replacex(%X,1,TODAY,2,TOTAL,3,$network,4,$+($network,$chan)) | SaveStats %mBAR-NiCK %TYPE %mVARsT 1 | inc %X }
- ;*** Timers
- writeini SRU\Bartender\Timers.ini %TYPE Last $ctime
- writeini SRU\Bartender\Timers.ini %TYPE $network $ctime
- writeini SRU\Bartender\Timers.ini %TYPE $+($network,$chan) $ctime
- writeini SRU\Bartender\Timers.ini $nick %TYPE $ctime
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- :END
- ;*** Flood protection
- $+(.timer,Tender,$network,$nick) 1 4 noop
- ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
- }
- alias SaveStats {
- if (!$4) { halt }
- ;*** Today + Total *********************************************************************************************************
- elseif ($3 != TODAY) {
- $iif(%DrugTYPE && $5 == LAST && %DrugTYPE != MiX,writeini -n $+(SRU\,0-TODAY,.ini) $3 $+($iif($6 != RECEiVeT,SMOK,RECEiV),eD) $calc($readini($+(SRU\,0-TODAY,.ini),$3,$+($iif($6 != RECEiVeT,SMOK,RECEiV),eD)) +$4))
- $iif(%DrugTYPE && $5 == LAST && %DrugTYPE != MiX,writeini -n $+(SRU\,0-TOTAL,.ini) $3 $+($iif($6 != RECEiVeT,SMOK,RECEiV),eD) $calc($readini($+(SRU\,0-TOTAL,.ini),$3,$+($iif($6 != RECEiVeT,SMOK,RECEiV),eD)) +$4))
- writeini -n $+(SRU\,0-TODAY,.ini) $3 $iif($6 == RECEiVeT,$+(r,$2),$2) $calc($readini($+(SRU\,0-TODAY,.ini),$3,$iif($6 == RECEiVeT,$+(r,$2),$2)) +$4)
- writeini -n $+(SRU\,0-TOTAL,.ini) $3 $iif($6 == RECEiVeT,$+(r,$2),$2) $calc($readini($+(SRU\,0-TOTAL,.ini),$3,$iif($6 == RECEiVeT,$+(r,$2),$2)) +$4)
- }
- ;*** TOP 10 section ********************************************************************************************************
- writeini -n $+(SRU\TOP10\,$3,.ini) $iif($6 == RECEiVeT,$+(r,$2),$2) $1 $calc($readini($+(SRU\TOP10\,$3,.ini),$iif($6 == RECEiVeT,$+(r,$2),$2),$1) +$4)
- ;*** User section **********************************************************************************************************
- writeini -n $+(SRU\Users\,$replacex($1,[,@,],~,|,-),.ini) $3 $iif($6 == RECEiVeT,$+(r,$2),$2) $calc($readini($+(SRU\Users\,$replacex($1,[,@,],~,|,-),.ini),$3,$iif($6 == RECEiVeT,$+(r,$2),$2)) +$4)
- ;***************************************************************************************************************************
- $iif($6 && $3 == $+($network,$chan) && $5 == LAST,writeini -n $+(SRU\Users\,$replacex($1,[,@,],~,|,-),.ini) LAST $6 $ctime)
- $iif($3 == $+($network,$chan) && $5 == LAST,writeini -n $+(SRU\Users\,$replacex($1,[,@,],~,|,-),.ini) LAST $iif($6 == RECEiVeT,$+(r,$2),$2) $ctime)
- }
Advertisement
Add Comment
Please, Sign In to add comment