|
darkcourtjester Newbie
Joined: 27 Mar 2010 Posts: 1
|
Posted: Sat Mar 27, 2010 2:31 am
Point Counter |
I'm a bit stuck, it's probably because my mind is drawing blanks.
What I'm trying to achieve is a character bot that will keep track of arena scores, trivia point scores and any other 'quest' type scores. It will obviously be a manual thing. The mud I play on allows for up to 3 character multi-play, 1 character will be running the counter and I'd like to have it where I could controller it with another.
example would be:
Quote: |
Player0 tells BotCharacter, 'add point Player1'
Player0 quest-says, 'score'
BotCharacter quest-says, 'Player1 has 1 point(s), Player2 has 3 point(s), Player4 has 1 point(s), Player3 has 0 point(s).'
|
I have a bot list which seperates into a string list for player names (i.e. "Player1|Player2|Player3|" and so on) and I can individually keep track of player scores(i.e. Variable for <Playername>points and an add trigger of #add <Playername>points 1) but the problem is combining them so that I can get it to display something like the example's "BotCharacter quest-says, 'Player1 has 1 point(s), Player2 has 3 point(s), Player4 has 1 point(s), Player3 has 0 point(s).'" text. It's easy to use this for getting a players points individually, if the player quest-says score then give them their current score but what I'm really shooting for here is for all players that are added to the string list/bot list will get their scores at once.
If anyone has any ideas, simpler way or anything I'd appreciate it. |
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: Fri Apr 02, 2010 1:20 pm |
I did something similar to this once. The hardest part is not adding points, but sorting them out into who has the most points. That's fun.
Here's something for you:
#trigger {{@PlayerList} quest-says, 'score'} {#execute qsay %expandlist( %subregex( @PlayerList, "(\w+)", "%%1 has @%%1points point(s)."))}
*EDIT* I forgot to say, in case you don't realize, to just replace @PlayerList with the name of whatever variable you use to store the list of competitors. |
|
|
|
|
|
|
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
|
|