| View previous topic :: View next topic |
| Author |
Message |
c0ll3c70r Voice
Joined: 19 Jan 2009 Posts: 7
|
Posted: Mon Jan 19, 2009 12:16 pm Post subject: Dota League Script |
|
|
Hi there,
I'm looking for dota ihl (inhouse league) bot and I can't find .. So I decide to write my own tcl but have some troubles ... I need somebody help me with some commands :
.listsentinel - Displays the nicks of the players who played in sentinel team
(this command should .match sentinel and displays the host added to this user at the channel).
.listscourge - Displays the nicks of the players who played in scourge team (this command should .match scourge and displays the host added to this user at the channel)
.result - after the game the leaders put .result sentinel/scourge/draw. When .result draw is typed there will be no changes. When the .result is for sentinel/scourge the bot have to give +50 points to each player of the winning team and take -50 points from each player of the loosing team. The worst part of it is that the bot should store this points and make something like ladder for example someone have 3 wins and 1 loose, so he's stats will be 50 + 50 + 50 - 50 = 100 points
.stats [nickname] - Displays the current points that nickname got.
.top10 - Display the top 10 players (based on points)
Sorry for my bad english. I hope that someone will help me. Thanks ! |
|
| Back to top |
|
 |
c0ll3c70r Voice
Joined: 19 Jan 2009 Posts: 7
|
Posted: Mon Jan 19, 2009 3:39 pm Post subject: |
|
|
| List commands rdy! They were easier then I think. Now need help for .result .stats and .top10 commands. Thanks! |
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Mon Jan 19, 2009 4:19 pm Post subject: |
|
|
I probably won't work on this but just as an fyi, it probably will help you (and all the other people lately) if you post data sources, so that they can see what and WHERE you are trying to parse data from.
Otherwise nobody knows what you really need or want. _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
c0ll3c70r Voice
Joined: 19 Jan 2009 Posts: 7
|
Posted: Mon Jan 19, 2009 4:45 pm Post subject: |
|
|
Erm this is .top
[22:45] <FloRida> .top
[22:45] -BGIHL-BOT- Top 10: 1. ILL1DAN[1317], 2. GaLaHai[1266], 3. WAPS[1230], 4. naix4o[1215], 5. DPG[1193], 6. Hellokitty[1188], 7. botko[1184], 8. RET|IvO-[1169], 9. RET|sekunnda[1151], 10. edko[1135]
The stats are based on XP that players get with .result
[22:45] <FloRida> .stats
[22:45] -BGIHL-BOT- Finli has 4 wins, 7 losses, 955 experience, ranked 62/87, Rated [Below Average]; Current losing streak: -4 [Feeding Spree] Confidence factor: Average
This thing like streak, factor, rated noneed .. Only wins, losses and expirience.
I can't paste you .result because I haven't access for this, but it's something like :
For example Scourge team is : Player1, Player2, Player3, Player4, Player5
Sentinel team is : Player6, Player7, Player8, Player9, Player10
And should looks like : Player1[+50], Player2[+50], Player3[+50], Player4[+50], Player5[+50], Player6[-50], Player7[-50], Player8[-50], Player9[-50], Player10[-50]
The bot have to store these points into a db or sth like that and calculate them. This points can be seen with .stats and there is top10 with .top command. I'm sorry for my bad english again. |
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Mon Jan 19, 2009 5:30 pm Post subject: |
|
|
But where is the data coming from...? The player names and their scores and etc. _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
c0ll3c70r Voice
Joined: 19 Jan 2009 Posts: 7
|
Posted: Tue Jan 20, 2009 3:17 am Post subject: |
|
|
All the players are added in the bot. With every lossed game the player losses 50 points and with every winned game the player gains 50 points. When the game starts they're added as a hostmask of users sentinel and scourge so you know where they played last. If this is too hard maybe something like point system will work pretty good for me ... Like .addpoints nick .delpoints nick .stats and .top10. Just need to have some ladder statistics for the players.
edit: wherem add and delpoints commands added default number of points for example 50 or add's 1 win/losse to stats. |
|
| Back to top |
|
 |
Rustyt0n Voice
Joined: 31 Jan 2009 Posts: 1
|
Posted: Sat Jan 31, 2009 7:00 am Post subject: |
|
|
Hi c0ll3c70r, this is what i use for result in my bot
alias result {
if $1 { var %gameid = $1 }
return $readini(%games.ini,%gameid,result)
}
alias w { return $gettok($wl($1),1,32) }
alias l { return $gettok($wl($1),2,32) }
alias wu { writeini -n %users.ini $1 $2 $3 }
alias wg { writeini -n %games.ini $1 $2 $3 }
alias ru { return $readini(%users.ini,$1,$2) }
alias rg { return $readini(%games.ini,$1,$2) }
thats only the main alias, if u need help with ur bot contact me, my msn is xboludox@hotmail.com Ive got made alot of IHL bots for alot of leagues. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Jan 31, 2009 12:06 pm Post subject: |
|
|
Not to be rude, but that looks alot like mircscript to me...
You'll have a very hard time getting that running on an eggdrop.
@Collector: I think I have a basic idea on what you're trying to build. The big question is where/how you store the scores aswell as team associations. Are you using global variables, custom user fields, some custom "scorefile"?
The format of your output is, not to be rude, rather non-interesting from a coder's perspective. What we're interested in, is the internal data structures. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
c0ll3c70r Voice
Joined: 19 Jan 2009 Posts: 7
|
Posted: Wed Feb 04, 2009 11:18 am Post subject: |
|
|
Erm I was quite busy, sorry for the late answer.
@Rustyt0n: 10q for sharing.
@nml375: Hmm I'll try to explain you as clear as well. When the game is started once the players are picked to two different teams - scourge and sentinel. Each team have 5 players. These players picked by .pick sentinel nick, which add's nick into bot's userlist as a hostmask of user sentinel. When there are .result sentinel after the game, all 5 players of this team should get +50 XP points and 1 win, the oposite team should loose -50 XP and gets 1 loose. In other IHL's that I played on uses mIRC based bots, and store that information in .ini files, so I'm sure that it'll be pretty enough if the eggdrop just pico/nano or sth some file and write them down. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Feb 04, 2009 2:14 pm Post subject: |
|
|
That explained things alittle better indeed.
Neither tcl nor eggdrop have any native support for handling ini-based registers, yet there is an extension known as "tcllib" that does support them. Should you need support for ini registers, tcllib would be pretty much mandatory.
Regarding how you handle players team assignments, I would very much recommend you do not use your current model with assigning player hostmasks to fixed handles. If possible, I would instead suggest each player gets his or her own handle within the bot, making use of the XTRA data fields and custom flags (I believe you mentioned all players are already added to the bot?).
Or perhaps simply storing the players, teams and stats in simple tcl-lists? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
c0ll3c70r Voice
Joined: 19 Jan 2009 Posts: 7
|
Posted: Wed Feb 04, 2009 4:26 pm Post subject: |
|
|
Erm Flags and custom fields are already used
Could you please explain me a little bit about "tcl-lists"?
Thanks.
PS: The bot have to write down the results into some file not .ini ) for example pico results ) |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Feb 04, 2009 8:06 pm Post subject: |
|
|
tcl-lists is a kind of data structure, which can be saved in variables. I suppose it would've been abit clearer if I'd used that name instead. But simply put, you have a list of members for each team, and you have an array (indexed variable, vector) to store each player's score.
You'd pretty much store team association and player scores like this:
| Code: | set teamSentinel [list player1 player2 player3 player4 player5]
set teamScourge [list player6 player7 player8 player9 player10]
set playerScore(player1) 50
set playerScore(player6) -50 |
This has huge advantages over storing them as hostmasks, such that you don't have to bother with complex cleanup of hostmasks, don't risk messing up user detection (a channel member was never intended to match two handles), allows easy "record updates" through foreach-loops, and others.
Similar advantages could also be achieved with individual user records and custom flags, as the userlist command actually returns a valid tcl-list.
======================
"Has to be saved to a file":
Some format your eggdrop needs to interpret (restore scores upon restart), some file for ppl to just download, some format to be used with webpages, stats-scripts etc?
"Flags and custom fields are already used":
Would that interfere with use of flags'n'fields in this script?
Since you've got some work done already, might be a good idea to post that here. Could give us a better idea as to what we're up against. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
c0ll3c70r Voice
Joined: 19 Jan 2009 Posts: 7
|
Posted: Fri Feb 06, 2009 7:51 am Post subject: |
|
|
Well when hostmask are not a good decision, maybe it's better to try something new ...
When there is .startgame command the bot have to change by topic and send privmsg to the channel. That's already done by me. Startgame also opens up the .sign command. The question here is how to make the bot when 10 users are already .sign to randomly make the teams - 5 users in sentinel and 5 in scourge.
When there is .challenge [nick] $nick has to be the captain of team sentinel and $arg has to be the captain of team scourge. When there is 10 users signen in (.sign) the bot have to announce that the pick is started like that :
| Code: | <BOT> nick starts the pick, use .pick [nickname]
<nick> .pick someone
<BOT> nick has picked someone, it's nick2's turn
<nick2> .pick somewho
<BOT> nick2 has picked somewho, nick2 it's again your turn.
|
and so on ... The system is 1-2-2-2-2-1 (nick has to pick 1 player; then nick2 has to pick 2 players; then nick has to pick 2 players; then nick2 has to pick 2 players ; then nick has to pick 2 players; then nick2 has to pick 1 player)
When a player is picked by nick he should be added to team sentinel.
When a player is picked by nick2 he should be added to team scourge.
.listteams command shoud display all the players on both teams.
.result sentinel/scourge/draw
on result sentinel :
| Code: | <BOT> The winner is team SENTINEL.
Player1[+50], Player2[+50], Player3[+50], Player4[+50], Player5[+50]
Player6[-50], Player7[-50], Player8[-50], Player9[-50], Player10[-50] |
on result scourge :
| Code: | <BOT> The winner is team SENTINEL.
Player1[-50], Player2[-50], Player3[-50], Player4[-50], Player5[-50]
Player6[+50], Player7[+50], Player8[+50], Player9[+50], Player10[+50] |
on result draw :
| Code: | | <BOT> There is no winner. Game successfuly closed |
After the game is once closed (.close for startgame and .ready for challenge) the teams should be erased.
There are also vouch/unvouch commands (.vouch [nickname]) should add this user to the bot's db with a 1000 points and .unvouch should del this user.
.top10 shows the top 10 players based on XP.
| Code: | | <BOT> player1[1500],player2[1400] and so on .. |
.stats [nickname] - shows nickname statistics
| Code: | | <BOT> somewho is on place [place] with [xxxx] XP. |
where place is 3/100 for example where 3 is current position and 100 is all the players that are vouched.
Hope that's possible. |
|
| Back to top |
|
 |
al_capone[br] Voice
Joined: 25 Feb 2009 Posts: 2
|
Posted: Wed Feb 25, 2009 9:00 pm Post subject: |
|
|
Hello collector, your project of league bot is very good.
I am seeking one league bot too, but I am not a programmer.
Actually, I am the moderator of brazilian community in the server eurobattle.net. We have one public channel (brasil) and have one project for made one private channel with league.
Can you help us with your league bot?
Regards.
Capone. |
|
| Back to top |
|
 |
ext3 Voice
Joined: 10 Jan 2010 Posts: 1
|
Posted: Sun Jan 10, 2010 4:33 am Post subject: |
|
|
Hello,
i am Dota Pride Coder and i finished this project.I am using 4 bots where i can manage unlimited users and games.
Last calculate: 10.000 users and 10.000 games on 19ms.
-------------------------------------------------------------------------------------
1 eggdrop = info bot
3 mirc bots = league source
I had helped dp,gm.dota,naihl.dota,nihl,deihl leagues "more.."
My project has 1 mysql database,1 eggdrop for .stats/.info/.gameinfo and 3 mirc bots with hashtables.All bots can load the data from the mysql database.
I can make 4 eggdrops + mysql if it is required.
My irc bots online:7
My bnet bots online:5
Pm me about prize. |
|
| Back to top |
|
 |
|
|
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
|
|