This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Dota League Script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
c
c0ll3c70r
Voice
Posts: 7
Joined: Mon Jan 19, 2009 11:52 am

Dota League Script

Post by c0ll3c70r »

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 !
c
c0ll3c70r
Voice
Posts: 7
Joined: Mon Jan 19, 2009 11:52 am

Post by c0ll3c70r »

List commands rdy! They were easier then I think. Now need help for .result .stats and .top10 commands. Thanks!
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

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.
c
c0ll3c70r
Voice
Posts: 7
Joined: Mon Jan 19, 2009 11:52 am

Post by c0ll3c70r »

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.
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

But where is the data coming from...? The player names and their scores and etc.
c
c0ll3c70r
Voice
Posts: 7
Joined: Mon Jan 19, 2009 11:52 am

Post by c0ll3c70r »

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.
R
Rustyt0n
Voice
Posts: 1
Joined: Sat Jan 31, 2009 6:55 am

Post by Rustyt0n »

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.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
c
c0ll3c70r
Voice
Posts: 7
Joined: Mon Jan 19, 2009 11:52 am

Post by c0ll3c70r »

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.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
c
c0ll3c70r
Voice
Posts: 7
Joined: Mon Jan 19, 2009 11:52 am

Post by c0ll3c70r »

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 :o) for example pico results :o)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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: Select all

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
c
c0ll3c70r
Voice
Posts: 7
Joined: Mon Jan 19, 2009 11:52 am

Post by c0ll3c70r »

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: Select all

<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: Select all

<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: Select all

<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: Select all

<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: Select all

<BOT> player1[1500],player2[1400] and so on ..
.stats [nickname] - shows nickname statistics

Code: Select all

<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.
a
al_capone[br]
Voice
Posts: 2
Joined: Wed Feb 25, 2009 8:53 pm

Post by al_capone[br] »

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.
e
ext3
Voice
Posts: 1
Joined: Sun Jan 10, 2010 4:21 am

Post by ext3 »

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.
Post Reply