alias bill {
var %b = %x + %y
return %b
}
on $*:TEXT:$(/[!](coffee|chips)/Si):#: {
if ($regml(1) == coffee) {
msg # that will be £1.99, do you want !white or !black?
set %coffee coffee | set %x 1.99
}
if ($regml(1) == chips) {
msg # That will be £0.86. Thank you.
.timerchips 1 3 describe # Bot hands $nick a plate of chips.
set %chips chips | set %y 0.86
}
}
on *:TEXT:*:#: {
if ($1 == !bar) { msg # Welcome $nick $+ , welcome to the bar! On today's menu we have, !coke , !coffee , and !chips }
if ($1 == !milk) { describe # Bot hands $nick a teaspoon of milk. }
if ($1 == !sugar) { describe # Bot hands $nick a teaspoon of sugar. }
if ($1 == !bill) && (coffee isin %coffee) { msg # $nick $+ , you bought %coffee which cost: £ $+ %x | msg # $nick !cash or !card ? }
if ($1 == !bill) && (chips isin %chips) { msg # $nick $+ , you bought %chips which cost: £ $+ %y | msg # $nick !cash or !card ? }
if (coffee isin %coffee) && (chips isin %chips) {
msg # $nick $+ , your total comes down to: £ $+ $bill | Do you wish to pay by !cash or !card ?
}
if ($1 == !cash) { describe # Bot took $nick $+ 's cash for the purchase and gave $nick a receipt. }
if ($1 == !card) { describe # Bot took $nick $+ 's card for the purchase and match $nick $+ 's ID and signature. }
elseif ($1 == !bill) && (coffee !isin %coffee) && (chips !isin %chips) {
msg # $nick $+ , you haven't bought anything yet.
}
if ($regex($1-,[!](black|white))) {
if ($regml(1) == black) {
describe # Bot hands $nick a cup of black coffee.
.timerwb1 1 3 msg # Any !milk or !sugar?
}
if ($regml(1) == white) {
describe # Bot hands $nick a cup of white coffee.
.timerwb1 1 3 msg # Any !milk or !sugar?
}
}
}