SRU

Bartender (Starter Script)

SRU
Apr 13th, 2013
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 12.97 KB | None | 0 0
  1. on *:TEXT:*:#: { tokenize 32 $replace($strip($1-),@,!,.,!)
  2.   if ($timer($+(Tender,$network,$nick))) { halt }
  3.   ;*** Setting user/nick
  4.   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,[,@,],~,|,-,/,å)
  5.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  6.   ;*** Bartender - You can download Bartender.mrc (/this script) from http://pastebin.com/A7tMVFM6
  7.   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 }
  8.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  9.   ;*** Beer - You can download Beer.txt (/DB) from http://pastebin.com/DRzrKN6j
  10.   if ($istok(!Beer,$1,32)) { set -u1 %Type Beer }
  11.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  12.   ;*** Whiskey - You can download Whiskey.txt (/DB) from http://pastebin.com/tW7Ce8fR
  13.   elseif ($istok(!Whiskey,$1,32)) { set -u1 %Type Whiskey | set -u1 %ResTYPE+ Whiskey }
  14.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  15.   ;*** Bourbon - You can download Bourbon.txt (/DB) from http://pastebin.com/rziKGRRY
  16.   elseif ($istok(!Bourbon !Burbon,$1,32)) { set -u1 %Type Bourbon }
  17.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  18.   ;*** Vodka - You can download Vodka.txt (/DB) from http://pastebin.com/AzuVtzBv
  19.   elseif ($istok(!Vodka,$1,32)) { set -u1 %Type Vodka }
  20.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  21.   ;*** Rum - You can download Rum.txt (/DB) from  http://pastebin.com/wsdQhZNU
  22.   elseif ($istok(!Rum,$1,32)) { set -u1 %Type Rum }
  23.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  24.   ;*** Tequila - You can download Tequila.txt (/DB) from http://pastebin.com/WeKB1F3A
  25.   elseif ($istok(!Tequila,$1,32)) { set -u1 %Type Tequila }
  26.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  27.   ;*** mDrink - You can download Drinks.txt (/DB) from http://pastebin.com/h9A3SBut
  28.   elseif ($istok(!mDrinks,$1,32)) { set -u1 %Type Drinks }
  29.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  30.   ;*** Wine - You can download Wine.txt (/DB) from http://pastebin.com/JDWYYq0S
  31.   elseif ($istok(!Wine !RedWine !WhiteWine,$1,32)) { set -u1 %Type Wine }
  32.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  33.   ;*** Water - You can download Water.txt (/DB) from http://pastebin.com/8pn03ZDA
  34.   elseif ($istok(!Water,$1,32)) { set -u1 %Type Water }
  35.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  36.   else { halt }
  37.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  38.   ;*** #     #                                                                                                      
  39.   ;*** ##   ## ######  ####   ####    ##    ####  ######  ####            ####  ######  ####  ##### #  ####  #    #
  40.   ;*** # # # # #      #      #       #  #  #    # #      #               #      #      #    #   #   # #    # ##   #
  41.   ;*** #  #  # #####   ####   ####  #    # #      #####   ####            ####  #####  #        #   # #    # # #  #
  42.   ;*** #     # #           #      # ###### #  ### #           #               # #      #        #   # #    # #  # #
  43.   ;*** #     # #      #    # #    # #    # #    # #      #    #          #    # #      #    #   #   # #    # #   ##
  44.   ;*** #     # ######  ####   ####  #    #  ####  ######  ####            ####  ######  ####    #   #  ####  #    #
  45.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  46.   ;*** Setting var for output and database
  47.   if ($isfile($+(SRU\Bartender\,%Type,.txt))) { set -u1 %Read $read($+(SRU\Bartender\,%Type,.txt)) }  
  48.   set -u3 %ResTYPE.NiCK $calc($readini($+(SRU\Users\,%mBAR-NiCK,.ini),TOTAL,%TYPE) +1)
  49.   set -u3 %ResTYPE.TOTAL $calc($readini($+(SRU\,0-TOTAL,.ini),TOTAL,%TYPE) +1)
  50.   $iif($readini(SRU\Bartender\Timers.ini,%TYPE,LAST),set -u3 %ResTYPE.TiME $v1)
  51.   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...
  52.   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/)
  53.   set -u3 %ResMONEY $calc(%ResTYPE.TOTAL * $replace(%TYPE,Beer,2.5,Whiskey,2,Bourbon,2,Vodka,2,Tequila,2,Water,0.75))
  54.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  55.   ;******* Messages section
  56.   ;*** Shots
  57.   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) }
  58.   ;*** Whiskey
  59.   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) }
  60.   ;*** mDrink (as in mixed drinks)
  61.   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) }
  62.   ;*** Everything else
  63.   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) }
  64.   ;******* Messages
  65.   $iif(%RES-MSG2,.TiMER 1 1,$iif(%ResTYPE+,.TiMER 1 1)) .describe # %RES-MSG %ResSTATS
  66.   ;***
  67.   $iif(%RES-MSG2,.TiMER 1 2 $v1)
  68.   ;*** TAB
  69.   ;  .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 )
  70.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  71.   ;*** SAVE ( Create DB ) ********************************************************************************************************************************************************************************************************************************************************************************************************
  72.   while (%X < 5) { var %mVARsT $replacex(%X,1,TODAY,2,TOTAL,3,$network,4,$+($network,$chan)) | SaveStats %mBAR-NiCK %TYPE %mVARsT 1 | inc %X }
  73.   ;*** Timers
  74.   writeini SRU\Bartender\Timers.ini %TYPE Last $ctime
  75.   writeini SRU\Bartender\Timers.ini %TYPE $network $ctime
  76.   writeini SRU\Bartender\Timers.ini %TYPE $+($network,$chan) $ctime
  77.   writeini SRU\Bartender\Timers.ini $nick %TYPE $ctime
  78.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  79.   :END
  80.   ;*** Flood protection
  81.   $+(.timer,Tender,$network,$nick) 1 4 noop
  82.   ;*******************************************************************************************************************************************************************************************************************************************************************************************************************************
  83. }
  84. alias SaveStats {
  85.   if (!$4) { halt }
  86.   ;*** Today + Total *********************************************************************************************************
  87.   elseif ($3 != TODAY) {
  88.     $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))
  89.     $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))
  90.     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)
  91.     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)
  92.   }
  93.   ;*** TOP 10 section ********************************************************************************************************
  94.   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)
  95.   ;*** User section **********************************************************************************************************
  96.   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)
  97.   ;***************************************************************************************************************************
  98.   $iif($6 && $3 == $+($network,$chan) && $5 == LAST,writeini -n $+(SRU\Users\,$replacex($1,[,@,],~,|,-),.ini) LAST $6 $ctime)
  99.   $iif($3 == $+($network,$chan) && $5 == LAST,writeini -n $+(SRU\Users\,$replacex($1,[,@,],~,|,-),.ini) LAST $iif($6 == RECEiVeT,$+(r,$2),$2) $ctime)
  100. }
Advertisement
Add Comment
Please, Sign In to add comment