View Full Version : MMG Martingale script
zarqon
01-04-2009, 10:26 PM
MMG Martingale Script
I never play the MMG. Danger is not my middle name. But someone requested this script, so I thought after writing it for the requester I would share it with y'all. I will say, in testing it out I made over 5000 meat! Haha.
This script does pretty much what the title says. It plays the Money Making Game using the Martingale strategy (http://kol.coldfront.net/thekolwiki/index.php/Money_Making_Game). It will abort if at any time you don't have enough meat to place the next bet, and it will run as many chains as you specify.
Variables you can edit at the top of the script:
boolean bet_hagnks - choose the source of your betting money. Default is Hagnk's (true).
float factor - every time you lose, you bet a larger amount (X times your previous bet) until you win. The Martigale strategy gives 2 for X, but you may want to change that, as mentioned on the aforelinked wiki page.
How to use it:
Download the script to your scripts directory.
Optionally, tweak the aforementioned variables.
Run the script, either by selecting it from the scripts menu or typing "martingale" in the CLI. It will ask you for your starting bet, and the number of Martingale chains to run (enter 0 for infinite chains).
...profit! (sometimes)
Note for scripters: If you have your own surefire MMG strategy and would like to script it, I made sure that the place_bet() function was flexible for other strategies. It places a bet and returns true if you win, false if you lose. If you don't have enough meat to place the bet, it aborts. Have fun!
dangerpin
01-05-2009, 12:38 AM
Very cool beans, Z.
I found a minor bug
if (amt > 100000000) print("Chain maxed out past 100000000. You are very, very, very unlucky.","red");
should be changed to
if (amt > 100000000) print("Chain maxed out past 100000000. You are very, very, very dumb.","red");
:P
zarqon
01-05-2009, 12:40 AM
Haha! :D
Maybe there's no such thing as luck, and they mean the same!
Oh -- and you definitely play the MMG right? I mean, Danger is your first name...
Hooray for automated meatsinks!
Federalist
02-18-2009, 08:30 PM
Question - does it just keep idling until someone has taken the bet? (Countdown : 10 seconds)
Thanks. :)
Also, why does it KMail you? And, finally, any chance of it logging?
zarqon
02-19-2009, 12:13 AM
1) Yes. It will idle until someone takes your bet. You could go into the script and change the number to a larger one if you're commonly waiting a long time and would like to save server hits.
2) You're welcome! :)
3) It kmails me only once the first time you run the script because I used the notify command. (http://wiki.kolmafia.us/index.php?title=Notify)
4) I believe everything that it prints to the CLI is logged, right? If not, what would you like it to log?
Federalist
02-19-2009, 12:15 AM
1) Yes. It will idle until someone takes your bet. You could go into the script and change the number to a larger one if you're commonly waiting a long time and would like to save server hits.
2) You're welcome! :)
3) It kmails me only once the first time you run the script because I used the notify command. (http://wiki.kolmafia.us/index.php?title=Notify)
4) I believe everything that it prints to the CLI is logged, right? If not, what would you like it to log?
Erm, when I said 'log', I hadn't realized that on my next login in gave me all the information. One more question - is there any way to tell me what it's doing? Such as, "Placing 1000 Meat Bet!" "Placing 2000 Meat Bet!" "Placing 4000 Meat Bet!" ?
zarqon
02-19-2009, 12:21 AM
Watch the CLI when it runs and you'll see it does that. You probably should always watch the CLI when running scripts.
Federalist
02-19-2009, 12:26 AM
Watch the CLI when it runs and you'll see it does that. You probably should always watch the CLI when running scripts.
Ah, great. Thanks. As a beggining script-user, are there any scripts/downloads other than the basic Mafia download I should look into?
zarqon
02-19-2009, 12:52 AM
Yeah, take a look all over this forum. It depends what you want to automate, but Mafia can basically do it all. (except mallbots) What scripts there are, you can find.
tamahome
03-05-2009, 07:42 AM
I would like to modify this script to run my betting strategy, but I am rather lost on even how to do it. I haven't done any programming in years, and then what I have done was just some BASIC required for my electronics program. Any help would be appreciated.
Basically, I would like to set up a certain number of bet numbers (i.e. 1000, 2000, 5000, etc) up to say, ten variables. I would then like to have them bet in batches of five. I would also like to set up a number of wins, say three out of five wins, then it would return to the beginning and start again. If the required number of wins is not met, then it would go onto the next set of five with the next bet amount. If it makes it all the way through the the listed bet variables, it would then start over at the beginning. I would also like to be able to define those bet variables and the number of variables that it is going to have. So one day I only want five bet variables. The next I want fifteen. I would like it to be flexible enough to adjust on the fly depending on how I am running my bets at the time.
So basically
five bets of 1000
2 of those bets win
five bets of 2000
1 of those bets win
five bets of 5000
4 of those bets win
Start again
five bets of 1000
etc.
zarqon
03-05-2009, 10:37 AM
This is doable, although probably not as flexible as you'd like. You can convert the script to use an external text file of your daily betting, which would be arranged as follows.
0 1000
1 2000
2 5000
3 etc
Note that those should be tabs and not spaces. Then, you can load that data into your script like so:
int[int] dailybets;
file_to_map("whateveryounamedit.txt",dailybets);
You now have a map of your daily betting. dailybets[0] will give you your first bet, in this case 1000.
So, you'd want to do something like
int wincount;
foreach bet in dailybets {
wincount = 0;
for i from 1 to 5 if (place_bet(dailybets[bet]))
wincount = wincount + 1;
if (wincount >= 3) continue;
}
That will run through your bets one time, stopping when a) you reach the end of your daily bets, or b) you win the required number of bets.
You could put that in a function and run that function X times (X perhaps being a parameter of main()) to get the behavior you describe.
I didn't write the whole thing for you because you expressed an interest in scripting it yourself. Good luck!
tamahome
03-06-2009, 04:57 AM
I hate to say it, but I have been wrestling with trying to get this to work all day long. I have been using the original script as a base and trying to implement the changes you suggested. I just can't seem to get any of it to work, and frankly at this point I am just more confused than anything. I am finding this code to be more confusing the more I look at it. I hate to ask, but could you finish it up? That may be the only way that I can figure it out.
To be honest, I also find some of this script to be rather confusing. ^_^;;
Why don't you post some of your mess. That way it can be a dialogue instead of begging. Dialogues are often more interesting and more instructive. I can promise you that you'll gain points for having actually tried it and nobody will mock your failure. Also, there's a lot more dignity in getting help than a handout.
tamahome
03-07-2009, 06:19 AM
Sorry, didn't want to sound like I was begging. I was just so frustrated at that point.
I have decided to scrap the whole thing and start over. I will build it up from the bottom and just reference this script when needed. Maybe then I can figure this out. I will post it when finished. It may be a couple of days though.
zarqon
03-07-2009, 02:01 PM
Sorry to frustrate you. And even if you're starting from scratch, I recommend keeping the place_bet() function from this script. It's portable and very handy for any MMG-playing script. It returns false if you lost and true if you won -- very easy to use.
I've written a simpler version below for you in case you'd like to use it as a starting point. It uses more linear code with less nesting, and doesn't use an external map of data:
// paste the place_bet() function here.
int bet_five_times(int numtobet) {
int wins = 0;
print("Betting "+numtobet+" five times...","blue");
if (place_bet(numtobet, true)) wins = wins + 1; // using a for loop would avoid
if (place_bet(numtobet, true)) wins = wins + 1; // this repeated code
if (place_bet(numtobet, true)) wins = wins + 1;
if (place_bet(numtobet, true)) wins = wins + 1;
if (place_bet(numtobet, true)) wins = wins + 1;
return wins;
}
void main() {
int winsneeded = 3;
if (bet_five_times(1000) >= winsneeded) return;
if (bet_five_times(2000) >= winsneeded) return;
if (bet_five_times(5000) >= winsneeded) return;
if (bet_five_times(9000) >= winsneeded) return;
if (bet_five_times(18000) >= winsneeded) return;
}
tamahome
03-09-2009, 04:10 AM
I tried to run your script and it made a bet, the bet lost, but then it just seemed to hang. It didn't make anymore bets and it didn't make any kind of notifications.
I am trying very hard to understand how to use this code language, but I am still very lost. So, how does it make the bet, and how does it determine if it wins or loses? Then of course, where does it store the win or loss value? I guess what I am really asking is can you break the place_bet down line by line for me? If the reply is going to be extremely long, you can just send me a private message instead.
zarqon
03-13-2009, 06:38 PM
@tamahome: Post the script you put together and we'll help you figure out why it's not working.
tamahome
03-16-2009, 05:16 AM
Deleted childish rant, going to try this script one more time.
zarqon
03-16-2009, 05:37 AM
I can see why you are frustrated. I'm also a bit frustrated myself, because I have been trying to help you write a script, instead of just writing it for you. "Teach a man to fish" and all that. If you post what you have so far, we can explain whatever problems are in your code bit-by-bit. But you haven't posted any code (even bad, non-working code), so it's very difficult to help you.
One possible solution to your bet hanging situation might be that you didn't have any meat in Hagnk's. The second parameter of the place_bet() function is called use_hagnks and should be true if you want to use Hagnk's meat, false if you want to use inventory meat. The example I gave you used true, but you might need to change that to false.
tamahome
03-16-2009, 09:59 PM
Ok, we can start here then.
I want to return a meat result directly from the bet page. It is much faster than going to the betarchive. I don't know about you, but it takes forever for me to load the archive. I also don't have meat coming in from anywhere else to change the values of this result, so we are safe that way.
int total() {
if usehagnksmeat = false {
string s = visit_url("bet.php");
s = substring(s,index_of(s,"You have"),index_of(s,"Meat on hand"));
int result = to_int(s);
}
else {
string s = visit_url("bet.php");
s = substring(s,index_of(s,"hand and"),index_of(s,"Meat in Hagnk's"));
int result = to_int(s);
}
print("Meat available: "+result);
return result;
}
If I have done this right, result should return a value of either hagnks or on hand. That is assuming I have understood the functions correctly.
zarqon
03-17-2009, 12:46 AM
Looks like it should work, although you need parentheses around conditions for if statements. Best way is to make a test script to try it out:
testavailablemeat.ash
boolean usehagnksmeat;
int total() {
if (!usehagnksmeat) {
string s = visit_url("bet.php");
s = substring(s,index_of(s,"You have"),index_of(s,"Meat on hand"));
int result = to_int(s);
} else {
string s = visit_url("bet.php");
s = substring(s,index_of(s,"hand and"),index_of(s,"Meat in Hagnk's"));
int result = to_int(s);
}
print("Meat available: "+result);
return result;
}
void main(boolean usehagnks) {
usehangksmeat = usehagnks;
print("Checking available meat...");
total();
}
The only problem with checking bet.php is that you might get a kmail that changes your available meat, or you might sell something in your store. If you don't have a store that's fine but kmails are a different issue.
tamahome
03-17-2009, 04:41 AM
My character I want this script for is not avery social character so it isn't going to be a huge problem with incoming meat possibilities. I also wanted to do it this way for the speed of the check. It is quite a bit faster than checking the archive.
Now for a quick question. Why does it need to be - if (!usehagnksmeat) Why the (!) , and why does it not need a qualifying equals to a value?
Also when I try to run the above test script, it has an error. Script parsing error (testavailablemeat.ash, line 1).
zarqon
03-17-2009, 06:03 AM
If statements (and while and repeat loops) require conditions, like so:
if ( condition ) { commands }
Conditions must evaluate to a boolean, i.e. true or false. When you use a boolean value as a condition, it evaluates to true or false without needing an operator like "==" or "<".
So instead of (usehagnksmeat == true) you can just use:
if (usehagnksmeat) print("Using Hagnk's.");
Also, ! means "not". So instead of (usehagnksmeat == false) you can use:
if (!usehagnksmeat) print("Not using Hagnk's.");
This is useful for functions that return a boolean value, for example:
if (!retrieve_item(1,$item[turtle totem]))
print("You were unable to get the item.");
As far as the test script, I made a few changes to it, and now it works:
boolean usehagnksmeat;
int total() {
string s = visit_url("bet.php");
if (!usehagnksmeat)
s = substring(s,index_of(s,"Add a Bet:"),index_of(s,"Meat on hand"));
else s = substring(s,index_of(s,"hand and"),index_of(s,"Meat in Hagnk's"));
int result = to_int(s);
print("Meat available: "+result);
return result;
}
void main(boolean usehagnks) {
usehagnksmeat = usehagnks;
print("Checking available meat...");
total();
}
Feel free to ask about any of the changes.
tamahome
03-17-2009, 07:14 AM
I don't know if I am doing something wrong or not. I tried to run this new script and I still get a parsing error. As for the changes, all that was really changed was to clean things up a little. I get that part. Also thanks for explaining the (!), that helps alot.
zarqon
03-17-2009, 10:49 AM
What are you using to make the file? I can run the last posted code just fine.
tamahome
03-17-2009, 06:59 PM
I am using wordpad to edit and save the files.
wordpad is not ideal. notepad is much better for this. wordpad can get you in trouble by saving formatting characters if you're not careful.
If that still doesn't work, attach your script to your next reply so we can download it and check it ourselves.
tamahome
03-17-2009, 10:30 PM
Ok, saved it using notepad and it did work.
I now have a working betting script. Just one problem. It only runs through the bets once, and if it wins it stops. How can I get it to run through and then start again at the beginning?
zarqon
03-18-2009, 12:35 AM
Change the name of your main() function, say to betchain(). Then make a new main() that calls betchain() X times.
betchain() { previous main() function }
main(int numchains) {
for i from 1 to numchains
betchain();
}
tamahome
03-18-2009, 06:57 AM
Everything seems to be working okay, except it will stop and error out sometimes after a bet. It does print out a debug log. I can attach that if so desired. Any reasons why it would error out?
The debug log and the exact text of the error would be useful.
And when you do get it running, please share your win/loss record!
tamahome
03-19-2009, 04:49 AM
It just says Unexpected error, debug log printed.
zarqon
03-19-2009, 05:45 AM
Somehow it is not finding one of the test strings for index_of(). Do those strings always exist in bet.php?
tamahome
03-19-2009, 06:58 AM
They should be there unless there are five bets running at one time.
Maybe the code should be changed to something like this.
int total() {
if (!usehagnksmeat)
s = my_meat()
else {
string s = visit_url("storage.php");
s = substring(s,index_of(s,"You have"),index_of(s,"meat in long-term"));
}
int result = to_int(s);
print("Meat available: "+result);
return result;
}
zarqon
03-19-2009, 07:35 AM
Good idea, but I don't think mafia would know that your meat has changed. (And it won't run because there is an error assigning something to s, which has not been declared.)
However, if you are OK with never using Hagnk's, this function would be waaay easy to write:
int total() {
refresh_status();
return my_meat();
}
Also, using "You have" for the beginning won't work, because that would include a lot of numbers, not just the number you want. Look at the HTML, not the displayed page. You'll see "You have" can occur above the desired place with "You have no oustanding bets" or whatever the message is. This means there are several HTML tags in there too, some which say something like "width=75%". Those extra integers will mess up your to_int() conversion.
tamahome
03-19-2009, 08:02 AM
I did think of that. That is why I decided to change it to look at Hagnk's storage for the meat value instead of the bet page. I figured that might be the best way. The string does only show up once at hagnks.
So how about this one.
int total()
if (!usehagnksmeat) {
refresh_status();
return my_meat();
}
else {
string s = visit_url("storage.php");
s = substring(s,index_of(s,"You have"),index_of(s,"meat in long-term"));
int result = to_int(s);
return result;
}
Except I don't know why it is saying that it can't do the return result.
tamahome
03-20-2009, 06:33 AM
I solved that last problem. Here is the solution.
int total() {
string s = visit_url("bet.php");
string t=visit_url("storage.php");
if (!usehagnksmeat)
s = substring(s,index_of(s,"Add a Bet:"),index_of(s,"Meat on hand"));
else
s = substring(t,index_of(t,"You have"),index_of(t,"meat in long-term storage."));
int result = to_int(s);
print("Meat available: "+result);
return result;
}
After further testing, I have found that it will go through and make all the bets it can without waiting for a win or loss confirmation. As far as I can tell, the place_bet function is supposed to wait until a result is confirmed for the win or loss. For some reason the script is placing the next bet even if the result has not been returned as a win or a loss. It should run through a loop in the place_bet and not exit the function until it returns a result. Is there some way to stop it from moving on to the next bet without a result returned? Is it possible that it is confused by the total() function that I now have defined?
This is the current code that I am testing.
tamahome
04-13-2009, 10:37 PM
I have finished my betting script. It is below.
Many thanks to Zarqon for his help in understanding the code.
It is simple. True or false to use inventory or Hagnk's.
The bets can be changed to fit your style of betting. Simply change the code in these lines.
if (bet_five_times(1000) >= winsneeded) return;
Change the 1000 to whatever you want to bet and so on.
It will make the bet five times and if it meets the required number of wins (default is set at three) it will start over.
It will prompt you on how many times you want the bet series to run. You can make it go as long or as short as you like.
Enjoy!
The script has been working great for me for a couple of weeks (thanks, btw) but a couple of days ago it started giving me an error message "There was a problem placing the bet". I've been searching for an answer and haven't found one. I redownloaded the script, didn't fix it. Any ideas?
Thanks in advance.
dangerpin
06-07-2009, 01:19 AM
Maybe the same problem everyone is having with the Kingdom servers not responding properly also applies to betting?
I'd still love to see someone's win/loss record. :)
I was really lucky. I've won over 15mil over the past couple of weeks before it stopped working.
I'm a tool. My script sold my casino pass.
I have a daily log in which I got over a million meat, if you really want to see it.
I'm curious about "lifetime" (or, at least, over a long period of time) win/loss records, but as I think about it it's probably pretty hard to get that.
A little. I can tell you my experience.
I was over 18 mill in the hole, now I am less than 3 mill in the hole. There are a couple of caveats.
1) You have to know you could lose it all at any time. If you look at a series, the odds are low, but they still exist.
2) The largest bet I've had to make to date is 10 million meat. By the time you make a 10 million meat bet, you've already lost 9,990,000 Knowing you are only making 100 meat a shot, that 20 million meat wager was hard to make. You gotta be deep and you gotta be committed. If you tuck tail and go home, it would take a couple of weeks to make back what you lost. If you press ahead, you could lose it all.
To fund a chain of 10 (1k+2K+4K+8K+16K+32K+64K+128K+256K+512K) is 1.023 million meat. Your odds of losing all 10 (you would only need 1 win anywhere in the chain) is 1/2^10, or .1% (one out of 1000). When I had to make the 10 million meat bet, it was because I had lost 13 in a row (I use 2.02 as a multiplier to counteract the house grab). The odds are on your side, but the chance to lose still exists.
Veracity
06-09-2009, 12:14 AM
The odds are on your side, but the chance to lose still exists.
:eek:
zarqon
06-09-2009, 03:46 AM
50% is 50%. But, odds which are randomly generated by computers aren't ever truly random (just very, very close), so there could be some merit to seeing a lifetime win/loss record. Regardless, I'm sure it wouldn't differ much from 50%.
@Z: I understand probability pretty well, so I'm not asking because I'm wondering what a random walk distribution looks like. What I'm curious about is folks who play all the time. Are they deluding themselves about the outcomes? bad at math? Rich enough that they don't mind the meatsink? How do they cope with their losses - farm until they can re-invest? Etc. It's a psych question, not a math one. ;)
:eek:
It's true. If we flipped a coin 10 times, the odds of you winning at least one of the 10 are pretty good. That's how that works.
Although if you were doubling your bet on every coinflip and you DID lose 10 in a row, it would be even the more painful.
@Z: I understand probability pretty well, so I'm not asking because I'm wondering what a random walk distribution looks like. What I'm curious about is folks who play all the time. Are they deluding themselves about the outcomes? bad at math? Rich enough that they don't mind the meatsink? How do they cope with their losses - farm until they can re-invest? Etc. It's a psych question, not a math one. ;)
Well, you probably wouldn't want their win loss record. You would want their psyche evals.
zarqon
06-09-2009, 06:35 AM
This script is currently sitting at 66 registered users (http://zachbardon.com/mafiatools/details.php?a=zarqon&s=martingale.ash). I too am curious about the draw given that, in theory, the risk is greater than the chance of winning.
I say in theory. Because what I'm more curious about is what role the imperfection of computer-generated random numbers plays in the probability of win/loss, and spreading the 50% chance thinner (as Martingale does) allows a greater sampling from which to possibly draw conclusions (to exploit of course). If I were to pick either 0 or 1 randomly, and kept picking 0, at some point we would say the random number algorithm was broken.
I would guess the MMG uses PHP's rand() (http://us.php.net/rand), possibly seeded with srand(). I would also note the user discussions there about "random" and seeding, which often mention the idea of making things "more random" i.e. fewer repeated numbers and less predictable. In this case, the idea of making something "more random" works in Martingale's favor. What I'm saying is that while the game is, in theory, a 50% win situation no matter how you slice it, RNG's are not exactly perfect probability machines due to the human element in the perception of randomness, so there may actually be some small merit to using Martingale if you intend to play the MMG at all. The only question is if this imperfection is enough to outweigh the strategy's net loss. I doubt it, but would still be curious to see a larger data sample.
EDIT: hahahahahaha (http://en.wikipedia.org/wiki?title=Talk:Martingale_(probability_theory))
halfvoid
06-09-2009, 07:03 AM
Hi. I have zero experience in editing ASH script but wanted to know if someone could help me alter the code to use a different betting scheme.
I bet in increments of 1k, 2k, 6k, 18k, 54k, 162k, 486k, 1458k
I start off with 5 bets of 1k, then for however many lose, i bet that many of the next increment, until all have been won, then i start over again at 1k.
i.e.
bet 1k 1k 1k 1k 1k
lose 3
bet 2k 2k 2k
lose 1
bet 6k
lose 1
bet 18k
win
(repeat)bet 1k 1k 1k 1k 1k (and so on...)
This script is currently sitting at 66 registered users (http://zachbardon.com/mafiatools/details.php?a=zarqon&s=martingale.ash). I too am curious about the draw given that, in theory, the risk is greater than the chance of winning.
I say in theory. Because what I'm more curious about is what role the imperfection of computer-generated random numbers plays in the probability of win/loss, and spreading the 50% chance thinner (as Martingale does) allows a greater sampling from which to possibly draw conclusions (to exploit of course). If I were to pick either 0 or 1 randomly, and kept picking 0, at some point we would say the random number algorithm was broken.
I would guess the MMG uses PHP's rand() (http://us.php.net/rand), possibly seeded with srand(). I would also note the user discussions there about "random" and seeding, which often mention the idea of making things "more random" i.e. fewer repeated numbers and less predictable. In this case, the idea of making something "more random" works in Martingale's favor. What I'm saying is that while the game is, in theory, a 50% win situation no matter how you slice it, RNG's are not exactly perfect probability machines due to the human element in the perception of randomness, so there may actually be some small merit to using Martingale if you intend to play the MMG at all. The only question is if this imperfection is enough to outweigh the strategy's net loss. I doubt it, but would still be curious to see a larger data sample.
EDIT: hahahahahaha (http://en.wikipedia.org/wiki?title=Talk:Martingale_(probability_theory))
Maybe, maybe not. Picking 0 100 times in a row wouldn't in and of itself mean the generator was broken, as that is statistically possible for a functioning random number generator.
Here is where the falacy comes in.
If we take the house cut out of the occasion:
On a 1 chain, you have a 50% chance of winning 1000 and a 50% chance of losing 1000. Run it over enough trials to bear out the stats your net gain is 0.
On a 2 chain, you have a 75% chance of winning 1000 and a 25% chance of losing 3000. Run it over enough trials to bear out the stats your net gain is 0.
On a 3 chain, you have an 87.5% chance of winning 1000 and a 12.5% chance of losing 7000. Run it over enough trials to bear out the stats your net gain is 0.
And so on. Even though you are incresing the chances you are going to win a chain, you aren't increasing your chances that you are going to win any money, because when you lose you lose so big. The law of large numbers says that you are going to even out over time anyway you slice it.
When you put the house cut into it, you are going to lose more (or win less, as the case may be) for every step you go over step one, so in the long run, you won't break even. You will lose.
You can alter the situation to slide wining a chain in your favor, but in the long run, the odds of wining money are the same.
@Z: I'm not quite sure if you're joking or not - any respectable RNG will show an appropriate distribution of outcomes; the problem comes from if they're truly random versus psuedorandom (e.g. there is an underlying pattern to the even distribution that could be discerned). If you'd like proof of this, no need to bang around with mafia; just run php rand() a few billion times. I've done this, incidentally, not with php rand() but with the libc implementation (which may well be what php uses). I can tell you for sure*, it's 50/50. And I can tell you for double-sure** that if I'm wrong on the previous point, the margin of error is much less than you'd see from considering every instance of the MMG played to date.
So the thing I'm interested in is - when they crash, how hard, and what do they do about it? :)
EDIT: confirmed, php rand() does use libc rand().
* sure = within one part in a trillion or so...
** guestimating - to one part within a 10^18
zarqon
06-09-2009, 03:47 PM
@halfvoid: A script very similar to what you are requesting has already been discussed and worked out on the preceding pages, with plenty of code samples. You might take a look at that and see if that gets you on the right track. Then, scrape something together, and if it doesn't work post it and ask why. People here are always happy to help fix existing code.
@dj_d: dang, I should have made this script do some data-gathering as it went, sending data to some central place. A repository of small wins and magnificent losses!
halfvoid
06-09-2009, 05:48 PM
The best i've come up with so far is a single bet version of my betting scheme. Just by removing the other 4 bets and setting the wins required to 1. works for me so far, but i don't know how to loop it to only bet again for the lost bets. Hehe. Still says betting five times when it only bets one too.
halfvoid
06-09-2009, 05:49 PM
i've made about 1mil so far with that.
halfvoid
06-09-2009, 07:04 PM
i guess what's messing me up is that i learned programming from the school of QBASIC. Ash, c++, and php all seem to belong to that exclusive rich school on the other side of town.
Ulfada
06-09-2009, 08:45 PM
If anyone is interested here is a log of over 500 bets with this script. (names have been changed to protect the innocent, and the not so innocent)
I started with ~150000 meat. I was up by a fair amount until the end when I didn't have enough meat to cover the bet!
I started with ~150000 meat. I was up by a fair amount until the end when I didn't have enough meat to cover the bet!Ah, that is the way of the martingale. When you lose, you loose BIG.
Thanks, Ulfada!
@Z: that would have been cool. :)
asturia
06-11-2009, 10:39 AM
The best i've come up with so far is a single bet version of my betting scheme. Just by removing the other 4 bets and setting the wins required to 1. works for me so far, but i don't know how to loop it to only bet again for the lost bets. Hehe. Still says betting five times when it only bets one too.
Thanks for the script Halfvoid.
Working fine for me.
halfvoid
06-11-2009, 07:21 PM
heh. no problem. screwed me over in the end just as the MMG has that tendency to do. went from the 8 mil that i made with it, down to zero as i pushed it.
halfvoid
06-11-2009, 07:36 PM
trying to rework it so it does the full betting scheme, including the loop which only bets again for losses on multiple bets. just need to find the way to highlight ASH syntax in Notepad++
halfvoid
06-11-2009, 08:42 PM
updated halfvoidian betting scheme.
with the help of mredge73 i've gotten it to run a single set of 5 bets that only bet again for the higher amount for each one that loses. now if I could ask, how do i make it so the user can input the number of times they want the entire run of bets to repeat?
halfvoid
06-11-2009, 09:16 PM
okay. now you can set the number of betting runs you want to do with my scheme.
edit the value of howmany on line 49 to the number of runs you want it to do. (default of 10)
thanks to zargon for the original code, and mredge37 for showing me how to alter it to my scheme.
asturia
06-11-2009, 09:26 PM
I'm going to test it tomorrow to see what it gives
asturia
06-12-2009, 08:13 AM
My luck turned, lost 1.4 mil :(
halfvoid
06-13-2009, 08:51 PM
is there a way to build in a way for the script to automatically dump meat beyond a certain range into the closet, to prevent huge losses?
halfvoid
06-13-2009, 09:22 PM
here's my attempt at getting that to work.
keep getting an error
Unknown variable 'int' (hvMMGbet4.ash, line 63)
Change "int closetafter" to "closetafter". You already declared it, so you don't need to specify that it's an "int" again.
halfvoid
06-14-2009, 04:08 AM
oh ok. i'll try that after maintenance and upload it if it works.
FYI, you can run scripts even when you're not connected (which will at least tell you if there are syntax errors). For example, from the Scripts menu.
halfvoid
06-14-2009, 04:23 AM
got another error saying illegal amount of parameters, got 1 expected 2 for line 64. all i did was delete the int before tocloset.
halfvoid
06-15-2009, 04:34 PM
got it to work. used the CLI execute command instead of the ash script.
now you can set a variable at the top of the script to automatically dump winnings over a certain amount to the closet.
halfvoid
06-16-2009, 01:42 AM
1.5 mil meat closeted and only 200k lost after 200 runs today. Nice.
Joshseow
07-15-2009, 01:33 PM
Sorry for the bump, but is it possible to have the first and second loss result in a bet 3x greater than the original bet, followed by 2x greater
Eg.
Bet 1000 meat - lose
Bet 3000 meat - lose
Bet 9000 meat - lose
Bet 18000 meat - lose
Bet 36000 meat - etcetcetc...
Is it possible? Thanks for your time =)
codster62
07-16-2009, 03:56 AM
Holy Crap! Thanks alot for this script. I started with 10 million and now I am at 60 million mostly because of this script! I let it run. Sorry most people haven't been as fortunate. Also, would it make to many entries into their server if I set the wait time to about 3? I didn't want to wait 10 seconds, lol. During the day bets go quick. Anyway, thanks for the script zarquon, and I hope to see several more of your scripts. And by the way, could you please message me on here, I need help with something in private. ;)
Story
07-16-2009, 04:50 PM
Holy Crap! Thanks alot for this script. I started with 10 million and now I am at 60 million mostly because of this script! I let it run. Sorry most people haven't been as fortunate. Also, would it make to many entries into their server if I set the wait time to about 3? I didn't want to wait 10 seconds, lol. During the day bets go quick. Anyway, thanks for the script zarquon, and I hope to see several more of your scripts. And by the way, could you please message me on here, I need help with something in private. ;)
I've had terrible luck with this script, to the tune of being down by several million. I've tried tweaking it several different ways, but I always end up with "you cannot bet more than you have".
Those of you who are having good luck with it, what is the amount of meat you're keeping on hand, to play with? And what amounts are you using in your "betting chain"?
I'd really like for this to work, but I'm a relative newbie to KOL, and a real newbie to mafia, so I don't have that much saved up yet.
Any input would be really appreciated.
Thanks!
codster62
07-16-2009, 05:55 PM
I've had terrible luck with this script, to the tune of being down by several million. I've tried tweaking it several different ways, but I always end up with "you cannot bet more than you have".
Those of you who are having good luck with it, what is the amount of meat you're keeping on hand, to play with? And what amounts are you using in your "betting chain"?
I'd really like for this to work, but I'm a relative newbie to KOL, and a real newbie to mafia, so I don't have that much saved up yet.
Any input would be really appreciated.
Thanks!
Well, I have my bet multiplier set to 2.3, and ususally set my bets at 100k bets. But, I usually watch my bets when I do that high in case it goes apeshit and bets everything, lol. Hope that helps...
Story
07-16-2009, 06:31 PM
Well, I have my bet multiplier set to 2.3, and ususally set my bets at 100k bets. But, I usually watch my bets when I do that high in case it goes apeshit and bets everything, lol. Hope that helps...
That helps somewhat - if you don't mind my asking, what's your limit on betting? At what point does it get dumped into the closet?
zarqon
07-17-2009, 03:41 AM
I see that you have discovered the secret "go apeshit" functionality I wrote into the script.
codster62
07-17-2009, 03:58 AM
Haha, is their really a script line of that, lol. Anyways, I never dump any meat into the close. And using this script, I am now at 80 million, not 60, lol. Every day, this script is earning me meat, so thanks zarquon!
In the MMG, you either win it all, or you lose it all. So whatever you do, the best MMG script really autosells your casio pass. :) If you can not afford mear farming equips, then go to the casino at the lemon party slot. You can usually get a pretty good chunk there with enough advents. Also, go to the castle and use a farming script. I myself am addicted to the MMG, and my in game name is CoolBufferBot. If you are successfull in the mmg, always give meat to those less fortunate than you. That is what I do!
Story
07-17-2009, 10:56 AM
Haha, is their really a script line of that, lol. Anyways, I never dump any meat into the close. And using this script, I am now at 80 million, not 60, lol. Every day, this script is earning me meat, so thanks zarquon!
In the MMG, you either win it all, or you lose it all. So whatever you do, the best MMG script really autosells your casio pass. :) If you can not afford mear farming equips, then go to the casino at the lemon party slot. You can usually get a pretty good chunk there with enough advents. Also, go to the castle and use a farming script. I myself am addicted to the MMG, and my in game name is CoolBufferBot. If you are successfull in the mmg, always give meat to those less fortunate than you. That is what I do!
Well, after further research (translation: losing my ass), I've decided to lay off the casino for a while. Thanks for answering my questions here, this seems like a friendly place.
Also, my in-game name is Story as well, maybe I'll see you there. At the risk of derailing the thread, which is the best farming script?
Good call Story. And I like Codester's MMG suggestion (autosell casino pass) too!
For farming, I suggest using eatdrink.ash to fill up with the default settings, buy a bunch of turns of buffs from the buffbots, then equipt.ash to maximize your meat drop, then just "adventure * castle". Pretty simple, but it works really well. I net (after food, spleen, and booze purchases) nearly 200k/day.
codster62
07-18-2009, 08:55 PM
Good call Story. And I like Codester's MMG suggestion (autosell casino pass) too!
For farming, I suggest using eatdrink.ash to fill up with the default settings, buy a bunch of turns of buffs from the buffbots, then equipt.ash to maximize your meat drop, then just "adventure * castle". Pretty simple, but it works really well. I net (after food, spleen, and booze purchases) nearly 200k/day.
Yes, :), and also, if you need a good buffbot, I offer all AT buffs for free including limited casts of all Hobopolis buffs. Just contact coolbufferbot for free buffs. Phat Loot, Thingfiner, and Something else will help.
halfvoid
07-19-2009, 05:30 AM
god. i got burned big time by my own version of the script. stopped using it at all. inflated myself up to 20 mil meat then lost it all two days later. bleh to the MMG.
Joshseow
07-19-2009, 08:21 AM
LOL, I got myself to 10 mil then back to nothing >_>
net loss of 1.3m though
Is it possible for this script to run 5 bets at once, rather than one?
Spiny
07-19-2009, 09:31 AM
LOL, I got myself to 10 mil then back to nothing >_>
net loss of 1.3m though
Is it possible for this script to run 5 bets at once, rather than one?
somewhere in the middle of this thread is something along those lines.
-Spiny
Joshseow
07-19-2009, 12:30 PM
... Alright... but I'll do without it first, bleh
zarqon
07-19-2009, 04:17 PM
The present algorithm is incapable of running multiple bets simultaneously.
@Z: you should get a vig. :)
zarqon
07-20-2009, 05:30 AM
Tempting! Too bad it might get me kicked off this forum. :)
Joshseow
07-20-2009, 08:32 AM
I have a suggestion, like changing 500k of your meat into 500 dense meat stacks every 1 mil you profit. Reduces your losses by quite a bit if you go on a losing spree, yes?
Story
07-20-2009, 04:46 PM
I have a suggestion, like changing 500k of your meat into 500 dense meat stacks every 1 mil you profit. Reduces your losses by quite a bit if you go on a losing spree, yes?
Putting any amount over X into the closet does the same thing. The problem is that when I'm on a roll, I have no self-control, and will keep withdrawing to try to break even, if not get super rich.
The MMG is evil.
And thanks, codster, I might have to give your bot a try :)
Right now, I'm just trying to get back to where I was before I started playing this cruel, cruel game.
@Z: How's that? Just csend 0.01*bet to yourself. Make it an option "donate_to_zarqon" that anyone can turn off. As long as people are dead set on burning their meat, they might as well waft a bit of the smoke in your direction!
Sputnik1
07-27-2009, 01:59 PM
I like Story's recommendation to add some code that will deposit a certain amount of meat into your closet after it reaches a certain point, like once you get to 500k deposit 250k into closet. Would definitely help me keep from losing it all using the bot
Story
07-28-2009, 02:07 PM
I like Story's recommendation to add some code that will deposit a certain amount of meat into your closet after it reaches a certain point, like once you get to 500k deposit 250k into closet. Would definitely help me keep from losing it all using the bot
That feature is actually in the script, however, what usually happens is that the bets keep doubling/tripling until you get the message "you can't bet more than you have".
At that time, you can, if you want, take some meat out of your closet & keep raising the stakes, or just eat the loss and start over.
I've been avoiding the MMG all together. It seems the best course of action.
Joshseow
07-30-2009, 09:18 AM
I just lost 8 mil to the MMG T-T
Not this bot though, I accidentally put all my meat in one bet -_-"
Veracity
07-31-2009, 02:59 AM
That's the fastest way available to double your meat! Or else, lose it all.
Equally likely...
Mynameissquee
05-04-2010, 09:18 PM
Been using the original script for a few hours, and its been going great. Is there a form of the original script with the feature to dump meat into a closet? Ideally what i want is every time i hit >250k , i want to deposit 50k into my closet (or make 50 dense meat stacks, i have NO idea which is easier from a script writer's stand point)
Any info would be helpful :D
Mynameissquee
05-04-2010, 09:42 PM
Running this right now, seems to be working if anyone else wants to check it out. Very new to the script making community, so not sure if its acceptable to do this, but i just took the original Martingale script, and the hvMMGbet5 script and took the closeting code out of the hvMMGbet5. Seems to working now for about an hour, although not the way i was wanting.
Every bet i win, it ditches the tiny amount over the set value (in my case 200k) into the closet.
If someone can get it to hit a benchmark and ditch meat down to another benchmark (i.e.- hits 250k, ditches 50k to closet) Either way, hope this helps :D
Mynameissquee
05-04-2010, 09:45 PM
sorry for the mutli-post. think that i got it to upload this time.
Veracity
05-05-2010, 12:19 AM
Or, you know, you could use my MMG script (http://kolmafia.us/showthread.php?2461-Veracity-s-MMG-scripts), which uses all the built-in MMG functions that I added to ASH. I think it pretty much obsoletes this script.
halfvoid
05-05-2010, 12:47 AM
It does indeed, but not as much as the MMG will obsolete your meat.
Mynameissquee
05-05-2010, 12:57 AM
Or, you know, you could use my MMG script (http://kolmafia.us/showthread.php?2461-Veracity-s-MMG-scripts), which uses all the built-in MMG functions that I added to ASH. I think it pretty much obsoletes this script.
Just looked at yours :D like it a bunch. thanks.
zarqon
05-27-2010, 06:20 AM
Yep -- this pre-MMG-in-ASH script is dead. I never officially supported it to begin with. Anyone with the power to close this thread may do so with my blessing. :)
caddel
12-27-2011, 05:27 AM
Two Week Grand Total: +546,958,784 Meat
Lifetime Grand Total: +1,461,987,430 Meat
you dont need an MMG bot just some guts.
bumcheekcity
12-27-2011, 10:48 AM
The plural of "anecdote" is not "data".
leeman27534
03-02-2012, 12:32 PM
okay, what i'd like to do is, bet 2.2 times what i lost each time, but only after like 4-5 times. and for it to automatically stop completely after i've either made 3 million, or lost 1 million total.
how would i go about doing that? i have no scripting skills or anything, and would i be able to do this while normal adventuring?
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.