If Initializing script Then Show message "This script plays a win and/or loss progression on the Passline and/or Don't Pass. " & cr & cr & "The script will ask you to enter a number of qualification levels. Each level is a pattern " & "of Passline and/or Don't Pass winners which will be used to qualify the table before any bets " & "are made. Multiple patterns can be entered for each level." & cr & cr & "The script will then ask for a list of bet amounts (steps) and what to do on wins and loses." & cr & cr & "Betting begins on the specified side (Passline or Don't Pass) when the table qualifies " & "with one of your listed patterns for the specified level." & cr & cr & "Winning and losing bets can progress, regress, stay the same, return to step 1, or " & "return to qualification mode at any level per your selected commands. " & cr & cr & "Note that come-out 12's are not counted as either P or D in the recorded decisions." & cr & cr & "Also note that you can re-run this script using the same numbers (and thus avoid answering " & "all initial questions) by selecting 'Preserve Checkstacks' when you start." If csn1 = "# of sessions desired" Then Yes / No question "Would you like to initialize this script?" & cr & cr & "(You should only select NO if you've already run the script at least once " & "and just want to re-run it with the same beginning values.)" If answer = no Then cs2.#sessions = 0 : GoTo "Begin new session" EndIf EndIf Clear all(CheckStacks, CheckStackNames) : AutoHandle Winning bets = "Take Bet and Winnings" : AutoHandle Losing bets = "No Bet/Take Remainder (if any)" : Name cs1.#sessionsdesired as "# of sessions desired" : Name cs2.#sessions as "# of sessions completed" : Name cs3.stoploss as "Stop loss" : Name cs4.stopwin as "Stop win" : Name cs5.decisionlimit as "# of decisions desired" : Name cs6.#decisons as "# of decisions" : Name cs7.bettingactive as "Betting active (-1=true, 0=false=qualify mode)" : Name cs8.betside as "Side to bet on (1=pass, 2=don't)" : Name cs9.qualifylevel as "Qualify level" : 'csn10.decisions reserved for record of decisions 'csn11 thru csn29 reserved for qualifying patterns (levels) 'cs11 thru cs29 reserved for initial side to bet (levels) Name cs30.betpointer as "Pointer to current progression step" : 'cs31 thru cs98 reserved for bet amounts (steps) 'csn31 thru csn98 reserved for win/lose commands (steps) cs0.level = 1 : : "Get qualifying level patterns" : csn(cs0.level + 10) = input$( "Enter the P/D pattern(s) needed to qualify for level " & cs0.level & "." & cr & cr & "P=Passline winner, D=Don'tPass winner." & cr & "Multiple patterns (if desired) should be separated by single spaces." & cr & cr & "For example: if DD PP is entered, then the shooter must roll either two consecutive " & "Passline winners or two consecutive Don't Pass winners to qualify and activate betting." & cr & cr & "(leave blank to stop entering levels)" & cr & cr) : If csn(cs0.level + 10) <> "" Then ' ensure only P, D, or spaces are entered cs99 = 0 Do cs99 = cs99 + 1 : csn99 = mid$(csn(cs0.level + 10), cs99, 1) : If csn99 <> "P" And csn99 <> "D" And csn99 <> " " Then GoTo "Get qualifying level patterns" EndIf If cs99 = len(csn(cs0.level + 10)) Then ExitDo EndIf Loop csn(cs0.level + 10) = csn(cs0.level + 10) & " " : : "Get initial side" : cs(cs0.level + 10) = input( "When the table qualifies at level " & cs0.level & "," & cr & "where would you like your initial bet?" & cr & cr & "1 On the side that scored the last win" & cr & "2 On the side opposite the last win" & cr & "3 Passline" & cr & "4 Don't Pass" & cr & cr) If cs(cs0.level + 10) < 1 Or cs(cs0.level + 10) > 4 Then GoTo "Get initial side" EndIf add 1 to cs0.level : GoTo "Get qualifying level patterns" EndIf cs30.betpointer = 31 : : "Get progression steps" : cs(cs30.betpointer) = input("How much would you like to bet on step #" & cs30.betpointer - 30 & cr & cr) If cs(cs30.betpointer) < 0 Then GoTo "Get progression steps" ElseIf cs(cs30.betpointer) = 0 Then If cs30.betpointer = 31 Then show message "At least one step is required in order to make bets." Else show message "Step #" & cs30.betpointer - 31 & " included a progression to step #" & cs30.betpointer - 30 & ", so an amount is required for step #" & cs30.betpointer - 30 EndIf GoTo "Get progression steps" Else csn99 = "WINS" GoSub "Get commands" : csn(cs30.betpointer) = csn0 : csn99 = "LOSES" GoSub "Get commands" : csn(cs30.betpointer) = csn(cs30.betpointer) & csn0 : csn99 = "" : If instr(1, csn(cs30.betpointer), "4") And cs30.betpointer < 98 Then add 1 to cs30.betpointer : GoTo "Get progression steps" Else GoTo "Get odds" EndIf : "Get commands" : cs0 = 0 : csn0 = input$( "Step #" & cs30.betpointer - 30 & " $" & cs(cs30.betpointer) & cr & "If this bet " & csn99 & ", what would you like to do?" & cr & cr & "A Stay on same side" & cr & "B Switch sides" & cr & "C Requalify" & cr & "D End session" & cr & cr & "1 Bet same amount" & cr & "2 Reset bet amount to first step" & cr & "3 Regress bet amount one step" & cr & "4 Progress bet amount one step" & cr & cr & "Please select both one letter and one number (e.g. A2)" & cr & cr) If len(csn0) <> 2 Or left$(csn0, 1) < "A" Or left$(csn0, 1) > "D" Or right$(csn0, 1) < "1" Or right$(csn0, 1) > "4" Then GoTo "Get commands" ElseIf left$(csn0, 1) = "C" Then : "Get level" : cs0 = input( "Step #" & cs30.betpointer - 30 & " $" & cs(cs30.betpointer) & cr & "When this bet " & csn99 & ", at what level would you like to requalify?" & cr & cr) : If cs0 < 1 Or cs0 > 29 Or csn(cs0 + 10) = "" Then show message "That level doesn't exist. Try again." GoTo "Get level" EndIf csn0 = csn0 & right$("0" & str$(cs0), 2) Else csn0 = csn0 & "00" EndIf Return EndIf : "Get odds" : yes / no question "Would you like to take odds on your passline bets?" If answer = yes Then autotake full odds = true Else autotake full odds = false EndIf yes / no question "Would you like to lay odds on your don't pass bets?" If answer = yes Then autolay full odds = true Else autolay full odds = false EndIf : "Get limits" : cs3.stoploss = -input( "What's your stop loss (max amount to lose) per session?" & cr & "(leave blank to ignore)" & cr) : cs4.wingoal = input( "What's your win goal (max amount to win) per session?" & cr & "(leave blank to ignore)" & cr) : cs5.decisionlimit = input( "What's your max # of decisions per session?" & cr & "(leave blank to ignore)" & cr) : cs1.#sessionsdesired = input( "How many sessions would you like?" & cr) : If cs1.#sessionsdesired < 1 Then cs1.#sessionsdesired = 1 EndIf cs30.betpointer = 31 : cs9.qualifylevel = 1 GoTo "End" EndIf : "Begin new session" : If beginning new session Then cs6.#decisons = 0 : cs7.bettingactive = 0 : cs9.qualifylevel = 1 : csn10.decisions = "" : cs30.betpointer = 31 EndIf '===================================================================================== : "Check stop loss/win" : If cs2.#sessions = cs1.#sessionsdesired Then Stop AutoRolling / HyperDrive : show message "Simulation complete" : ElseIf (bankroll - beginning bankroll <= cs3.stoploss And cs3.stoploss < 0) Or (bankroll - beginning bankroll >= cs4.wingoal And cs4.wingoal > 0) Or (cs6.#decisons = cs5.decisionlimit And cs5.decisionlimit > 0) Then add 1 to cs2.#sessions : start new session(preserve checkstacks) EndIf : "Record passline and don't pass wins" : If shooter passes Then csn10.decisions = csn10.decisions & "P" ElseIf shooter misses And dice total <> 12 Then csn10.decisions = csn10.decisions & "D" : EndIf If len(csn10.decisions) > 30 Then csn10.decisions = removeleft$(csn10.decisions, 1) EndIf : "Qualify" : If not cs7.bettingactive Then cs0 = 0 : ' starting point for string search cs99 = 0 : ' location of pattern separators, used with cs0 to parse strings Do cs99 = instr(cs0 + 1, csn(cs9.qualifylevel + 10), " ") If cs99 Then csn0 = mid$(csn(cs9.qualifylevel + 10), cs0 + 1, cs99 - cs0 - 1) If right$(csn10.decisions, len(csn0)) = csn0 Then cs7.bettingactive = true : If cs(cs9.qualifylevel + 10) = 1 Then ' side that last won If right$(csn0, 1) = "P" Then cs8.betside = 1 Else cs8.betside = 2 EndIf ElseIf cs(cs9.qualifylevel + 10) = 2 Then ' side opposite last winner If right$(csn0, 1) = "P" Then cs8.betside = 2 Else cs8.betside = 1 EndIf ElseIf cs(cs9.qualifylevel + 10) = 3 Then ' passline cs8.betside = 1 ElseIf cs(cs9.qualifylevel + 10) = 4 Then ' don't pass cs8.betside = 2 EndIf ExitDo EndIf cs0 = cs99 Else ExitDo EndIf Loop EndIf : "Wins and losses" : If any(PassLine wins, Dontpass wins) Then csn0.command = left$(csn(cs30.betpointer), 4) : ElseIf any(PassLine loses, Dontpass loses) Then csn0.command = mid$(csn(cs30.betpointer), 5, 4) Else GoTo "Make bets" EndIf add 1 to cs6.#decisons If left$(csn0.command, 1) = "B" Then ' switch sides add 1 to cs8.betside If cs8.betside > 2 Then cs8.betside = 1 EndIf ElseIf left$(csn0.command, 1) = "C" Then ' requalify cs7.bettingactive = false : csn10.decisions = "" : cs9.qualifylevel = val(right$(csn0.command, 2)) ElseIf left$(csn0.command, 1) = "D" Then ' end session add 1 to cs2.#sessions : start new session(preserve checkstacks) EndIf If mid$(csn0.command, 2, 1) = "2" Then ' reset to first step cs30.betpointer = 31 ElseIf mid$(csn0.command, 2, 1) = "3" Then ' regress one step If cs30.betpointer > 31 Then subtract 1 from cs30.betpointer EndIf ElseIf mid$(csn0.command, 2, 1) = "4" Then ' progress one step add 1 to cs30.betpointer : EndIf : "Make bets" : If cs7.bettingactive Then If next roll is a comeout roll Then If cs8.betside = 1 Then bet cs(cs30.betpointer) on passline Else bet cs(cs30.betpointer) on dontpass EndIf EndIf EndIf : "End" :