Help - Search - Members - Calendar
Full Version: Whisper-based League System
StealthBot.net > StealthBot > Scripting and Plugins > Plugin Projects
Faedrik
So it's occured to me that people like to have leagues on Battle.Net, which is cool, but when other people who can't compete with them catch wind of them the use flood-bots to "deal" with it.

So why don't we make it a versatile script that will be dealt by all whispers, with a devoted queue system that distributes queues to every bot that is involved with the script and a local database.

We'd use a database to store all information possible of a user and even have scrimmage teams for complete and utter versatility.

We could integrate cross-server information logging, allowing players from Azeroth to check out how a player on Lordaeron is doing, etc.

This would all be done through whispers and would allow more than 40 people to be looking for a game at any given time from any location on Battle.Net.

If given the time, we could integrate a website so people could access the bots through a website instead of through whispers which would be a lot more user-friendly and a lot easier to access in entirety.

---

If this sounds like something you'd like to hear more about or would like to voice your opinion about or support suggestions or offer your assistance, I am more than willing to listen, allow, etc.

Thank you in advance, Faedrik.

---

If this gets finished, it will kick ass.
The-Black-Ninja
I'll help.
Faedrik
What would you like to "help" with, The-Black-Ninja?
The-Black-Ninja
Anything lol Do you have a starting point in mind?
Faedrik
We can discuss our goals and take it from there, how we should approach the majority of the plugin before any programming starts.
The-Black-Ninja
Okay well...since you're wanting to have it all read and update to a webpage, do you want to get the webpage first and we can get the plugin to write to and read from it for testing? Then from there, work on the rest of the stuff like commands and queue management?
Faedrik
That was a secondary plan, actually, I'd like to integrate that later if we have time or if this even happens. Planning out the website and stuff is something I'm not particularly familiar with, so it wouldn't be the best place to start.

We can develop an advanced queue system that delegates queues to bots that have not sent messages in a particular length of time, etc.

What I'm thinking is each bot will have a status and a time from their last sent message. (This would work better with the Beta, etc because of it's whispertouser sub-routine which would get the exact timing and would ensure outputs are in the correct order)
The-Black-Ninja
The one that I use will add the request or command or whatever to a database first, before actually processing the output, then the bot will call a function to the queue manage plugin. From there, that function will check the database for duplicate requests from that user or if they're sending too many commands. Meanwhile, the plugin will also re-arrange the database and equally spread the load to all bots, making sure to preserve the first come, first serve basis...unless it's a priority message.
Faedrik
Each message will be sent to an output table of a database that every bot reads from periodically.

They're pre-assigned to a bot's username that is "online" and it will only check for their queues.

It will have a priority field, the higher the priority, the more urgent the message is.

I was also thinking of a "must be sent after" field that will only be sent if the specified message has been sent to the user. This would make sure the queues are in the right order, because in whispers if you get a continuation of a message before the starting, it can be confusing.

Make any sense?
Sui(C)ide
Just thought i'd help with a database idea.
CODE

Sub PREFIX_SUBNAME()

   Set Catalog = CreateObject("ADOX.Catalog")
   Catalog.Create "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source=" & PREFIX_FILEPATH

   PREFIXConnect()
  
   PREFIXConn.Execute("CREATE TABLE `Azeroth` (`Username` varchar(32), `Vouched_by` varchar(32), `Date_added` varchar(32), `Vouched` varchar(32), `Experience` INT, `wins` INT, `losses` INT, Draws INT, `Games_played` INT, `Warns` INT, Banned varchar(32), `Rank` varchar(32))")
   PREFIXConn.Execute("CREATE TABLE `Lordaeron` (`Username` varchar(32), `Vouched_by` varchar(32), `Date_added` varchar(32), `Vouched` varchar(32), `Experience` INT, `wins` INT, `losses` INT, Draws INT, `Games_played` INT, `Warns` INT, Banned varchar(32), `Rank` varchar(32))")
   PREFIXConn.Execute("CREATE TABLE `Kalimdor` (`Username` varchar(32), `Vouched_by` varchar(32), `Date_added` varchar(32), `Vouched` varchar(32), `Experience` INT, `wins` INT, `losses` INT, Draws INT, `Games_played` INT, `Warns` INT, Banned varchar(32), `Rank` varchar(32))")
   PREFIXConn.Execute("CREATE TABLE `Northrend` (`Username` varchar(32), `Vouched_by` varchar(32), `Date_added` varchar(32), `Vouched` varchar(32), `Experience` INT, `wins` INT, `losses` INT, Draws INT, `Games_played` INT, `Warns` INT, Banned varchar(32), `Rank` varchar(32))")
   PREFIXConn.Close
End Sub


Of course the league would have more tables (For the games) so it's just a base idea.
Faedrik
Yup, I was planning on storing a lot more information, but thanks for the input.

If you'd like to see something integrated that you haven't seen done before, then suggest it and I'll see if I can make it happen!
Sui(C)ide
QUOTE(Faedrik @ Jun 7 2009, 12:49 PM) *

Yup, I was planning on storing a lot more information, but thanks for the input.

If you'd like to see something integrated that you haven't seen done before, then suggest it and I'll see if I can make it happen!



What else would you want in there? I can add to it.
The-Black-Ninja
QUOTE(Faedrik @ Jun 6 2009, 10:15 PM) *

Each message will be sent to an output table of a database that every bot reads from periodically.

They're pre-assigned to a bot's username that is "online" and it will only check for their queues.

It will have a priority field, the higher the priority, the more urgent the message is.

I was also thinking of a "must be sent after" field that will only be sent if the specified message has been sent to the user. This would make sure the queues are in the right order, because in whispers if you get a continuation of a message before the starting, it can be confusing.

Make any sense?
Yup, it's more/less what I've got right now.

Also, did you have a type of database structure in mind? Flat, relational, etc.?
googlexx
make the database mysql?
Faedrik
Overview of information that will be kept in different database tables:

User Table:
  • Username
  • Rating
  • Wins
  • Losses
  • Current Streak
  • Best Streak
  • Worst Streak
  • Current Game
  • Most-recent Game
  • League rank (moderator, administrator, etc)
  • Their game result votes (for each player [truancy, dropper or a leaver]) and the end-game result. This can be in a different table
  • League status (-1 = inactive, 1 = active [safelisted], 2 = unknown [shitlisted])

---

Games Table:
  • Game host
  • Game challengee (for a challenge game)
  • Game type (1 = teams [5v5], 2 = ffa)
  • Rating Upper Limit (the highest applicable rating to join the game)
  • Rating Lower Limit (the lowest applicable rating to join the game)
  • Status (1 = open [players can join], 2 = drafting [captains are picking players], 3 = active [game is in progress], 4 = closed)
  • Start time
  • Finish time
  • Maximum Player Count
  • Minimum Player Count
  • Usernames for players 1-12
  • Ratings for players 1-12
  • The change of rating for players 1-12
  • The result of the player for players 1-12 (truancy, victory, defeat, dropper, leaver)

---

Virtual Channel Table:
  • Username
  • Last activity (last message received)
  • Last command used (used to detect "spamming")

---

Ignore Table:
  • Event ID (to keep track of a players' history)
  • The username of the person causing the player to become ignored
  • The user being ignored
  • The description (reason) the player is ignored
  • The length of the ignore
  • The status of this event (1 = active, 2 = inactive)

---

Warnings Table:

This table is pretty much identical to the ignore table

---

Notes Table:

This table is pretty much identical to the warnings and the ignore tables

---

Adjustment Table:
  • Event ID (to keep track of a players' history)
  • The person who is adjusting the other person's statistics
  • The persons' who's statistics are being adjusted
  • The type of adjustment (wins, losses, streak, rating, etc)
  • The value of the adjustment (+50, -25, etc)
  • The date this adjustment was issued
  • Status (1 = in effect, 2 = passive)

---

That's all I have for now, but more are sure to come. If you have any changes or any additional information you'd like to have kept track of, please list them.

The-Black-Ninja
This will definitely be a relational database then; this many tables belonging to many users be way too much for a flat database. Are you familiar with a relational type of database or did you need a quick overview of what it does?
Faedrik
Give me an overview, not sure of the terminology.
The-Black-Ninja
Well basically, a flat database is something like what you would see in Excel or in a single mdb file. It's called flat because all the information you need will be in that one table, so it would get kind of messy trying to mash all the data for a user into that one file; this is why you'll see some plugins with multiple tables to keep everything organized. What a relational database does is improve this system by having a common field in each entry in a table so that each table becomes "linked" to on another. In this example, every table has a common Username table so when you want to find information about someone that spans a few tables, you will only need to say
CODE
"WHERE Username ='" & Username & "'"
once at the very end rather than doing some other weird stuff because instead of usernames, you've got like, host_name instead of username or whatever. When you think about it, it's pretty much common sense in how it works. You probably did this with your other plugins and not even know what it was called lol so yeah, I don't know how useful this would be to you, you probably were wanting it to be done this way anyway. Users table
Wins
Losses
Username
Virtual table
Username
Last activity
Games table
Username (host)
Start Time
Faedrik
Makes sense to me. That is how I've done it before and planned to do it this time. Thanks for the suggestion, though.

If anyone would like to assist in the programming and the concept, please post in this thread.

---

The programming has begun, if you'd like to hop on the band-wagon, feel free!
We're only at 827 lines, which is mostly taken up by the queue system.
The-Black-Ninja
The programming and concept seems pretty straight forward, however, the big question is; manual data entry or automatic for wins and losses? If manual, how?

Oh, I guess I should've asked this before...what kind of league is this for? lol
Faedrik
This will be a versatile league script (but for the most-part, DotA).

It will allow the user to make "presets" for league types, say a FFA thing or a preset 2v2 system.

All the user would have to do would type something like

-create [game type] [mode]

If the game type matches one in the database (linked to what it is when it was created and an ID number) it will have the customized options.

Ranging from a total minimum of 2 players to a maximum of 12 in any assortment of teams.

As for game resulting, it would be on a vote-casting system.

After the game is "done", users would have to define the respective winners.
The-Black-Ninja
Mmmkay, very nice. Could you give me an example of the customized options thing?
Faedrik
Say I wanted to make a preset 2v2v2 thing. I would do something like this

-gamepreset <minimum number of players> <maximum number of players> <players per team> <identifier>

So, for example:

-gamepreset 6 6 2 2v2v2

---

Or a 10 player FFA system

-gamepreset 10 10 1 10-FFA

Or a FFA system with 6 to 12 players

-gamepreset 6 12 1 6-12-FFA

Then to utilize this after the "creation", it would be as easy as this:

-create 6-12-FFA
The-Black-Ninja
Ohhhh okay, so what role would the identifier be? Is it the gameType column in the games table?
Faedrik
It would just be for accessibility when creating it.

I could make one for "DotA", for instance.

-gamepreset 10 10 5 DotA, but this would be the default if none were specified.

-create DotA RD

The game type in the games column is just to log information on what kind of game it is.

I could, say, make a command to track how many games player by a user under a particular type of game.
The-Black-Ninja
OH!! Okay, I understand now, the identifier is the preset name and stuff, so you could make a present of DotA5 need 5v5 or Dota4 need 4v4, cause the preset already has all the options and restrictions built into it, right????
Faedrik
Yes, precisely the idea.

It would pass the data to the games table, for the minimum amount of players, maximum, etc.
The-Black-Ninja
That's super cool, I like that. There should be a separate table for those, something called like...game_identifiers or something. Now, for the recording wins and stuff, I've always assumed most people are douchebags and would try to screw up the end-game info, like, if a team was mad, the voting would be totally screwed if they wouldn't cooperate...
googlexx
thats why u require %60 or %70 of the ppl that played the game to validate the winner. and you can make it so they cant join another game until they report a winner
Sui(C)ide
The same applies with any voting. E.g. Truants.
The-Black-Ninja
QUOTE(googlexx @ Jun 7 2009, 09:32 PM) *
thats why u require %60 or %70 of the ppl that played the game to validate the winner. and you can make it so they cant join another game until they report a winner
I'm saying that if something happens in the game and, say, team 2 thinks team 1 cheated or whatever, they won't vote that team 1 won the game and if you make it so they can't play again unless they vote and they're all stubborn, they won't vote and the win will never be recorded and now you have an argument dry.gif
Faedrik
That is what moderators and administrators are designed to help deal with, The-Black-Ninja, nothing is perfect, but there are obviously ideal ways for situations to be handled.
The-Black-Ninja
Alrighty. Well, I can start working on somethin whenever you're ready smile.gif
Sui(C)ide
QUOTE(Faedrik @ Jun 8 2009, 11:57 AM) *

That is what moderators and administrators are designed to help deal with, The-Black-Ninja, nothing is perfect, but there are obviously ideal ways for situations to be handled.


Not only that, but there is commands for 'reporting' people.
FiftyToo
I can help crank out the database for you. From the sounds of it, you have big ideas that require a ton of information to be stored. I can create a very flexible and normalized database schema that will store everything nice and neat.

PM me if you want to over the data requirements and I will whip up some tables for you :0

52
Faedrik
Progress Report:

Ignore system functional

- You can ignore, unignore, check history, etc.

Queue System

- Creating new queues, reading queues (all output is either to the bot screen or a whisper, should I allow overrides that will create an emote or a normal-chat message?)

Virtual Channel

- Whenever a message is received, it updates their activity to when it was received.
- Users are never removed from the list, they are merely updated in activity.

Logging in

- The bot must be using the same product that the league is intended for. A Warcraft III product for a WC3 league, etc.
- This is to make sure the bots don't get flooded by other products that cannot participate in the league.
- All users with a "#" or a "@" in their name are automatically ignored in attempt to ignore floodbots and multi-accounters.

More to come:

Various other script statistics:
Total amount of lines: 1187
Blank Lines: 60
Commented Lines: 94
Percentage of "programming: 87%
AbsoluteMSTR
if you want to work the web end

http://fiftytoo.no-ip.com:45000/websvn/fil...2Fmysql.inc.vbs

Recommend you use MYSQL database
bambambigellow
That seem like a script that i would really like to use. Any advancement since the last update is on june 09.

My ideas:
A feature that could be implemented is different game type.

King of the hill (1v1) ->
2 players fight each other, the winner stays to fight another opponent. If you win you keep playing, if you lose can't play anymore and the winner keeps playing until undefeated.

BO3 (1v1-2v2-3v3-4v4) ->
Best of 3, where there would be 3 matches, and the first one who get 2-0 our 3-1 wins the bracket, and would continue to the next round.

1v1-2v2-3v3-4v4-FFA ->
People would pick their teamate and the bot would pick 2 random teams to fight each other. The winner continue and the loser loses


My idea might not be a good idea for that kind of script, but im giving my ideas. ^^


Have a good day!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.