|
Lilith383 Beginner
Joined: 10 Mar 2003 Posts: 17 Location: USA
|
Posted: Tue Mar 09, 2004 2:36 am
trivia score & name tracker |
I've tried to look all over for something that can help me with this. I'm pretty sure it's a simple solution but I'm not that advanced yet.
If anyone could help me with this, that would be great.
Ok.
I'm trying to build a trivia bot and I got stuck at the part where you keep track of names and scores. I'll tell you what I have so far.
Ok, it starts off as once someone enters the channel they are greeted by the bot and also shown a menu of options they can use on the bot.
One of the options is join, the other is score, and the last is question submit.
The join option obviously tells everyone in the channel that they have joined the game and internally their name is declared with a value of 0. They are also added to a variable named @active using the #additem function to show who is currently playing in the game.
The 2nd option is what I'm having trouble with. This is keeping track of people who are activly playing and also their current score.
Say someone joins the channel in the middle of a trivia game and then wants to find out what the current scores are. So he asks the bot for the scores. This is where I get stuck. What I tried to do was spout out the @active list but that just gives out the names of the people who are currently playing and not their current score. How would one do both? So the format would be something like this:
Scores: Tina - 8, John - 16, Benjamin - 28
I don't know if I explained that well enough. If you have any questions about what I asked, I'll try to re-explain it. Thanks again.
I know how to do the counting part of scores, i just don't know how to regergitate it in the format i want. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Tue Mar 09, 2004 4:18 am |
you need a database variable to hold your information, not just a vriable array
#VAR active {}
#ADDKEY active {Name=Soandso|Score=50}
#SHOW Soandso - %db(@active, Soanddo) |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|