Update 2!
alright, i have almost everything working. The bot .Notice\'s people when they come in and tells them about the system, the commands to use the like. i have the Drink list set up, the drinks themselves set up, even the Tabs and Payment system! I have to give PunkTuReD the credit for being able to keep the Tabs system, so i greatly thank you :P
the only thing that ISN\'t working right now is my \"Limit\" system, ergo if someone reaches a certain limit in money (100 silver) then it cuts them off until they pay the bill. I can show you the code
On *:TEXT:!Bloodwine:#: {
if (% $+ $nick > = 100) {
.Describe $chan ~The bartender shakes his head and continues wiping down his glasses, \"Sorry there $nick you have racked up too high of a tab. I can\'t serve you anymore untill you pay me.\"
}
Else {
describe $Chan ~ He grasps a large glass from under the counter, a large flat base pointing into a long thin stem, branching out in an elegant pattern to support a large bowel. kneeling down he then lifted a large bottle, wrapped in cord to the bar top, drilling a>>
.timer 1 2 describe $Chan ~ Corkscrew inside the bottle. Lifting the bottle off the counter, he began pouring the crimson liquid into the glass, letting it settle before sliding it over to the drinker, \"Hope that satisfies ya. I\'ll put it on your tab.\"<D>
.inc % $+ $nick 7
.Inc %total
.timer 1 3 .notice $nick you have a % $+ $nick silver tab running
}
}
So the part that i am having trouble with is the
if (% $+ $nick > = 100) {
.Describe $chan ~The bartender shakes his head and continues wiping down his glasses, \"Sorry there $nick you have racked up too high of a tab. I can\'t serve you anymore until you pay me.\"
}
Part. Even if these people have a tab of 642 it still lets them buy drinks! Its maddening! I mean, whats the point of having a payment system if you can\'t force people to use it!!
So i will break down parts of it so you get the general idea of whats going on
Ok, so when someone types !bloodwine it checks their tab to see if its over 100, if it is, it denies them the drink until they pay for their other drinks. If they have a tab under 100 (Even 99 works) then it gives them the drink, and adds money to their tab (in this case 7 silver) then it adds a 1 to a Total\'s value, which will tell people the total number of drinks ever served on this script. It then .Notice\'s them and tells them what their tab is currently at (Something i will embellish later)
So here is my delema one more time. The bot gives people drinks even though i tell it not to, any tips or tricks on what i may need done?
Update
Well, i finally got my timers working properly, so the bot runs MUCH smoother now, But i have a few coding problems:
Alright, so i have been trying to get the bot to give me a Tab (There seems to be come confusion about what a Tab is. A tab is essentially a Credit Card. buy your drinks now, but you pay for them later. The Tab refers to how much is owed)
now my problem is that using the %tab variable puts it as a generic variable so someone who didn\'t order a drink, would have a tab, and such. So how would i write an individual tab for everyone? I am not sure, but would it be something like:
On *:JOIN:#:
.Write $nick %tab 0
And then for adding to the tab each time they buy a drink
On *:TEXT:!Ale:#:
.describe $chan Here you go, some fresh Ale
.Read $nick
.inc %tab 5
.notice $nick your tab has reached (.Read $nick(%tab))
And for paying the tab
.describe $chan Takes the money happily
.write $nick %tab 0
.notice $nick Your tab has been erased, Thank you!
Or am I WAY off? I checked the Help Section, and it didn\'t.. Well give me much help...
Ok thanks, i\'ll post a Report on how it works ^^
As a side note, none of my timers work, i just get \"unknown command 1\" If i have the timer set as .timer 1 2 /me do this OR .timer 1 2 describe $chan Does This
Regardless, it keeps saying Unknown Command 1. I am building the script for Oasiz, so if anyone is more fammiler with their style of coding then that would be most helpful ^^
And if i wanted it to say different things based on how much they had would i write
If (%tab. [ $+ [ $address($nick,2) ] ] < 33){
.notice %nick Your tab is pretty low, so don\'t worry about it too much
}
If (%tab. [ $+ [ $address($nick,2) ] ] = 34 - 66) {
.notice $nick Your tab is getting up there, you might want to slow down a little
}
Else (%tab. [ $+ [ $address($nick,2) ] ] > 67) {
.notice $nick Wow mate, your tab is getting really high, you had best pay soon so you don\'t embarras yourself.
}
On *:TEXT:!ale*:#: {
if (%tab. [ $+ [ $address($nick,2) ] ] >= 100) {
.notice $nick Oya, your tab is to high, pay me before you ask more!
.halt
}
Else {
.msg $chan Ohai have fun with the ale ...
.inc %tab. [ $+ [ $address($nick,2) ] ] 10
.notice $nick You have $calc(100 - %tab. [ $+ [ $address($nick,2) ] ]) tabs remaining
}
}
If you want to change the amount of tabs he receives, just change the 10 to a number you want ( line 8 )
So Describe is the eqivilant of using a /me or Action type of text? Cool o.o
As for the Payment thing, what i really want to do is assign each drink with its own value, and every time someone buys a drink, it adds that much to their tab, and using !pay they get rid of their tab and reset the counter for them.
And if i do end up making this, if i wanted to restrict people\'s tabs from going over a certain amount of money, wouldn\'t it go something like
if (%tab >= 100) say Oye, your tab is to high, pay me before you ask for more!