iKnown>> Juice Bar

By BrandinA on Jan 18, 2010

Copyright © 2010 – Brandin Arsenault, Known Syntax – BOINC Services, Int. – All rights reserved.

Editing of this script is allowed.

This script is originally from the iKnown IRC Bot which is now discontinued.

-

I spent about 20 minutes of my time in this script. Everything in this script was done from SCRATCH. I did EVERY bit of CODE, TEXT, and REVIEWING by my own mind. This script works fine, I had many users test it. Its basic, a Juice Bar. Me and the users at my network enjoyed the script as many users asked for it.

-

Commands:

!jb sprite
!jb pepsi
!jb beer
!jb applejuice
!jb orangejuice
!jb drink DRINK - Replace the second 'DRINK' with what said user wants to drink.
!jb pomergrantjuice
!jb tea
!jb lemonade
!jb share NICK DRINK - Replace 'NICK' with the user of your choice and 'DRINK' with the drink you want to share.

#Juice Bar

on *:TEXT:!jb sprite:#: {
  msg $chan Sure sir; That'll be 3.50.
  describe $chan mixes the drink.
}

on *:TEXT:!jb pepsi:#: {
  msg $chan Sure sir; That'll be 3.50.
  describe $chan mixes the drink.
}

on *:TEXT:!jb beer:#: {
  msg $chan Sure sir; That'll be 4.50.
  describe $chan gets the beer out of the fridge.
}

on *:TEXT:!jb applejuice:#: {
  msg $chan Sure sir; That'll be 2.50.
  describe $chan gets a bottle of Apple Juice.
}

on *:TEXT:!jb orangejuice:#: {
  msg $chan Sure sir; That'll be 2.50.
  describe $chan gets a bottle of Apple Juice.
}

on *:TEXT:!jb drink *:#: {
  msg $chan Sure sir; your $2- shall be 1.00 per ingredient.
  describe $chan gets everything out.
  describe $chan mixes everything.
}

on *:TEXT:!jb pomegrantjuice:#: {
  msg $chan Sure sir; that comes to a total of 4.50.
  describe $chan gets everything mixed.
}

on *TEXT:!jb tea:#: {
  msg $chan With milk, thats2.50; Without, its 2.00.
  describe $chan gets the tea ready!
}

on *:TEXT:!jb lemonade:#: {
  msg $chan Thats 2.40.
  describe $chan gets the juice container with lemonade out.
  describe $chan pours the lemonade into a glass.
}

on *:TEXT:!jb share *:#: {
  describe $chan hands some of the $4- to $3.
  msg $chan Like it?
}

Comments

Sign in to comment.
Jethro   -  Jul 17, 2010

All you need is one text event. For !jb applejuice and !jb orangejuice, they have the exact, same message, the orange juice should have been "orange juice." Finally, you need a trigger control so that the client running the code doesn't get spammed or flooded.

This is my method, which saves quite a few bytes compared to BrandinA's:

on $*:text:/^!jb (sprite|pepsi|beer|drink|tea|lemonade|share|(apple|orange|promegrant)juice)\b/iS:#:{
  if !%f {
    inc -u4 %f
    goto $regml(1)
    :sprite
    msg # Sure sir; That'll be 3.50.
    describe # mixes the drink.
    halt
    :pepsi
    msg # Sure sir; That'll be 3.50.
    describe # mixes the drink.
    halt
    :beer
    msg # Sure sir; That'll be 4.50.
    describe # gets the beer out of the fridge.
    halt
    :applejuice
    msg # Sure sir; That'll be 2.50.
    describe # gets a bottle of Apple Juice.
    halt
    :orangejuice
    msg # Sure sir; That'll be 2.50.
    describe # gets a bottle of Orange Juice.
    :drink
    msg # Sure sir; your $2- shall be 1.00 per ingredient.
    describe # gets everything out and mixes everything.
    halt
    :pomegrantjuice
    msg # Sure sir; that comes to a total of 4.50.
    describe # gets everything mixed.
    halt
    :tea
    msg # With milk, thats 2.50; Without, its 2.00.
    describe # gets the tea ready!
    halt
    :lemonade
    msg # Thats 2.40.
    describe # gets the juice container with lemonade out.
    describe # pours the lemonade into a glass.
    halt
    :share
    describe # hands some of the $4- to $3.
    msg # Like it?
    halt
  }
}
 Respond  
Nodoka   -  Jul 17, 2010

great code, however, there is a colon missing in the tea command.

really fun snippet!

 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.