Page 2 of 13 FirstFirst 1 2 3 4 12 ... LastLast
Results 11 to 20 of 124

Thread: MMG Martingale script

  1. #11
    Junior Member
    Join Date
    Mar 2009
    Location
    Western, USA
    Posts
    16

    Default

    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.

  2. #12
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,559

    Default

    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.

    Code:
    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:

    Code:
    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

    Code:
    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!
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  3. #13
    Junior Member
    Join Date
    Mar 2009
    Location
    Western, USA
    Posts
    16

    Default

    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.

  4. #14
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    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.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  5. #15
    Junior Member
    Join Date
    Mar 2009
    Location
    Western, USA
    Posts
    16

    Default

    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.

  6. #16
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,559

    Default

    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:

    Code:
    // 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;
    }
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  7. #17
    Junior Member
    Join Date
    Mar 2009
    Location
    Western, USA
    Posts
    16

    Default

    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.

  8. #18
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,559

    Default

    @tamahome: Post the script you put together and we'll help you figure out why it's not working.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  9. #19
    Junior Member
    Join Date
    Mar 2009
    Location
    Western, USA
    Posts
    16

    Default

    Deleted childish rant, going to try this script one more time.
    Last edited by tamahome; 03-16-2009 at 10:43 PM.

  10. #20
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,559

    Default

    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.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

Similar Threads

  1. Script Registry -- for script authors; track your script usage
    By zarqon in forum Informational Scripts
    Replies: 211
    Last Post: 07-19-2018, 07:05 AM
  2. Replies: 1
    Last Post: 09-28-2015, 10:43 PM
  3. Replies: 0
    Last Post: 06-09-2015, 01:53 PM
  4. Replies: 1
    Last Post: 05-09-2012, 04:02 AM
  5. Replies: 0
    Last Post: 02-19-2012, 10:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •