GambleBot!

mredge73

Member
[SIZE=+1]GambleBot 20100112GAM

Tired of losing your meat to the Penguin Mafia?
Introducing GambleBot, your very own clan run casino!
Now your clan can take your hard earned meat!


Current Games:

CoinFlip
Similar to the MMG game except that all bets are placed against the house (bot). Bet is placed through kmail and the coin is flipped, you call heads or tails. If you win you double your bet -5%, if you lose you get nothing. Simple enough?

Player will kmail the bot. In the text box they will use "50:50" to choose the CoinFlip game and then call either "heads" or "tails", if player does not call it default is heads.
example: 50:50 heads

[/SIZE]
[SIZE=+1]ShellGame
Very similar to the CoinFlip game but with a 3 sided die or shell game. So the you will have 1/3 chance to win 3*Bet - 5%house cut.

Player will kmail the bot. In the text box they will use "Shell" or "shell" to choose the Shell game and then pick their shell by entering "1", "2", or "3", if player does not call it default is 2 (middle shell).
example: Shell 1


They will include the meat they want to bet in the kmail. The player will be notified of the result through kmail and PM. Clan reply is also used to broadcast result in the clan channel. The house takes a cut of 5% off of all winnings, if this is a clan run bot then you can choose to donate it back to your clan as a fund raiser. Processed kmails are automatically deleted afterward.
[/SIZE]
[SIZE=+1]
[/SIZE]
[SIZE=+1]
Default Bot Use:
The default logic is that the bot will start up when called and parse your Kmail for players. If it finds players it will execute the game. All processed kmails are deleted upon completion. 0 meat bets and >maxbet bets are sent back. Bot will repeat this every 3 minutes until 5 minutes before rollover. At that time the bot will execute the exit command and terminate mafia. Typing Abort at any time will halt script execution. The script can also be imported into another and the game can be called as a function.
[/SIZE]
[SIZE=+1]
[/SIZE]
[SIZE=+1]Player statistics are kept at GambleBotPlayerStats.txt, in the form of: PlayerName Win Loss MeatWon MeatLost
example: MyBot 10 20 20000 100000
[/SIZE]


[SIZE=+1]Three vars are used and can be changed in your player_vars.txt:
MrEdge73_CoinFlipMaxBet: this sets the max single bet, default 20k
MrEdge73_ShellGameMaxBet: this sets max single bet, default 20k
MrEdge73_KarmaExempt:if true the bot will use dense meat stacks from the clan stash for backup funding in the case that the bot does not have enough to pay the winner, must be karma exempt to do this, default is false
[/SIZE]


[SIZE=+1] Known Issue:
Currently if a player wins and the bot cannot pay them, the bot ignores the kmail and moves to the next one. The Kmail is not flagged as a loser but the kmail has to win again on the next iteration to get paid. This could be considered dishonest because in order for the player to win, the bot has to have the meat to cover the winnings.
If the bot is not karma exempt I recommend that you keep 10xMaxBet in your bot's inventory at all times to eliminate this issue.
[/SIZE]

[SIZE=+1][/SIZE]
[SIZE=+1]
Required Scripts that must be placed in you script folder:
[/SIZE]
MrEdge73's Support Script -- Item Lists (Beta).ash
MrEdge73's Support Script -- Functions (Beta).ash
MrEdge73's Support Script -- ClanAdministrator(LITE).ash
Zlib.ash

[SIZE=+1]

[/SIZE]
 

Attachments

  • GambleBot.ash
    11.3 KB · Views: 114
Last edited:

Enameless

New member
I tested this out as it seemed like a neat idea. I ran into trouble with DEBUG being undefined. I tried a few things but unfortunately my scripting skills are still pretty poor.
 

mredge73

Member
Gamble Bot user

New Tool!

This is a quick kmail tool designed to be used by a someone who wishes to take advantage of bot running gamblebot.ash

After running UseGamblebot.ash it will prompt you for:
string bot: this is the gamblebot that you wish to kmail
string game: this is what you would normally enter in the text box of a kmail
int meat: this is your bet amount in meat
int runs: this is how many kmails to send to the gamble bot

Using my clan bot for example:
bot: shivermetimbers
game: 50:50
meat: 5000
runs: 10

This will send 10 kmails to shivermetimbers each with 50:50 in the text box and each with 5000 meat.

(You guys are more than welcome to use my gamble bot! The odds are in your favor!)
 

Attachments

  • UseGamblebot.ash
    435 bytes · Views: 53
Last edited:

Rahmuss

Member
I'm new to bots and trying to learn how to use them, so pardon my most likely obvious questions. Here is how I envision using this GambleBot script:

1 - Download the five files above and put them all into the desired script folder
2 - Open Mafia and log in with the char I want to be a bot
3 - Go to Scripts menue and run GambleBot.ash
4 - Log onto KoL (normal browser) and go into chat
5 - /msg [clangamblebot] 50:50 heads
6 - Reap the rewards or weap the rearwards.

Is that what I should expect?
 

Grotfang

Developer
I'm new to bots and trying to learn how to use them, so pardon my most likely obvious questions. Here is how I envision using this GambleBot script:

1 - Download the five files above and put them all into the desired script folder
2 - Open Mafia and log in with the char I want to be a bot
3 - Go to Scripts menue and run GambleBot.ash
4 - Log onto KoL (normal browser) and go into chat
5 - /msg [clangamblebot] 50:50 heads
6 - Reap the rewards or weap the rearwards.

Is that what I should expect?

Ish. I have highlighted the two sections I want to clarify some potential misconceptions.

Point 4:

Log in with a different character, I shall assume. If not, you aren't understanding how mafia works -- it is logged in as you. It just intercepts communications made between you and the game and does some magic. Be careful of seeming to abuse the multi guidelines.

Point 5:

Is best answered by mredge73

The default logic is that the bot will start up when called and parse your Kmail for players. If it finds players it will execute the game. All processed kmails are deleted upon completion. 0 meat bets and >maxbet bets are sent back. Bot will repeat this every 3 minutes until 5 minutes before rollover. At that time the bot will execute the exit command and terminate mafia. Typing Abort at any time will halt script execution. The script can also be imported into another and the game can be called as a function.

Kmail. Not chat.
 

mredge73

Member
Grotfang summed it up very well.
Bets are placed through kmail, I don't think meat can be sent through chat.
Chat is used by this bot to display results, not to take bets.

I don't know if this script abuses the multi guidelines are not, I would caution you to keep the max bet fairly low as to not attract attention.
Default is 20K but can be easily changed through vars, large transactions in the millions of meat will gain attention.
It is not intended to put MMG out of business, I use it for clan fund raising and low stake gambling.
 
Last edited:

Theraze

Active member
If you don't run it for yourself, it shouldn't abuse the multi guidelines. If you use it to transfer meat between your characters...
 

Rahmuss

Member
Grotfeng - Yes, I meant logging into a normal browser with a different character (just to test it out).
And you're right, I meant for it to be a message that I sent, not a /msg (wasn't thinking when I typed that).
Sounds great though. I'd like to get a bot to just do simple clan chat stuff. Even if it just responds with random comments that make no sense. And I'd also like it to be able to roll dice upon chat requests. Hopefully I'll be able to figure out how to do some of those things.
 

heeheehee

Developer
Staff member
chatbotScript is supported in the official builds of Mafia and could probably do quite a few of those things with chat_clan(). The only issue is that it can't do anything about non-PMs. Or PM someone specific (i.e. not replying to the most recent sender).
 

heeheehee

Developer
Staff member
Code:
void main(string sender, string message) {

}
That should be the main method, I think. Just create an ASH file that does whatever with those, then set it to your chatbotScript via the CLI: "set chatbotScript = myScript.ash" or whatever it's called.
 

Rahmuss

Member
Can I then do something like:

Code:
void main(string sender, string message) {
message:="I'm the clan chatbot.";
}

Save that as mychatbot.ash
Go to the CLI in KoL Mafia and type: set chatbotScript = mychatbot.ash
And then when anyone messages our clan chatbot it will send that message???
P.S. Sorry if my syntax is off, I've done most of my programming in C++.
 

Theraze

Active member
No... that would set any message sent to the chatbot to overwrite what was sent and instead replace it with "I'm the clan chatbot." instead of their actual message. What you'd want is more something that sends "I'm the clan chatbot." to sender...
 

Rahmuss

Member
Is there a manual page or something where I can see how to send messages using the chatbot script then? I wish I could see the scripts here at work; but they don't let us load any kind of files or software onto these computers.
 
Top