system "Hot Nuffdark Numbers IV v1"
{
*************************************
*        System by Nuffdark         *
*        on the VIP Lounge          *
*************************************
          Rx-ed by St0rm0r
-------------------------------------
            00-c0mpatible
-------------------------------------
Qualification:
The method qualifies as soon as
1. A single number hits twice in no more then 13 spins
2. Take the last 13 spins and take all repeaters

During a session:
1. continue qualifying for new repeaters
2. don't continue qualifying for new repeaters

After a session requalification is performed:
1. From scratch on newly generated spins
2. On the last 13 spins

A number is bet on for a maximum of 12 spins at all times

After a hit:
1. Don't remove the number from betting
2. Remove the number from betting

A session ends, when there are no qualified numbers left"

Progression: win on any hit.
-------------------------------------
}
method "main"
begin
// section 1: do this once
while starting new session
    begin
    call "init"
    exit
    end

// section 2: do the tracking
track last number for 1 time record"last#"layout
track last number for 13 times record"last13#"layout

add 100% net record"total loss"data
if record"total loss"data > 0
    begin
    put 0 record"total loss"data
    end

//eliminate numbers above 12 bets
clear record"temp1"layout
clear record"temp2"data
put 1 record"play"layout index
loop until record"play"layout index > record"play"layout count
    begin
    put 100% record"play"layout index record"#spins"data index
    if record"#spins"data < 12
        begin
        copy record"play"layout record"temp1"layout
        add 1 record"temp1"layout index
        put 100% record"#spins"data record"temp2"data
        add 1 record"temp2"data index
        end
    add 1 record"play"layout index
    end
duplicate record"temp1" record"play"
duplicate record"temp2" record"#spins"

if record"play"layout count < 1 and flag "return" true
    begin
    set flag "session ended" true
    end
// section 3: act on a loss

// section 4:act on a win
if net > 0
    begin
    if record"I6"data = 2 //2. Remove the number from betting
        begin
        clear record"temp1"layout
        clear record"temp2"data
        put 1 record"play"layout index
        loop until record"play"layout index > record"play"layout count
            begin
            put 100% record"play"layout index record"#spins"data index
            if record"play"layout not = record"last#"layout
                begin
                copy record"play"layout record"temp1"layout
                add 1 record"temp1"layout index
                put 100% record"#spins"data record"temp2"data
                add 1 record"temp2"data index
                end
            add 1 record"play"layout index
            end
        duplicate record"temp1" record"play"
        duplicate record"temp2" record"#spins"
        end
        else
        begin
        //1. Keep betting the number
        end
    end

if flag "session ended" true
    begin
    set flag "session ended" false
    set flag "return" false

    if record"I4"data = 1 //Requalification is performed:1. From scratch on newly generated spins
        begin
        clear record"last13#"layout
        set flag "clear" false
        end
        else
        begin
        //Requalification is performed:2. On the last 13 spins
        end
    set flag "qualified"false
    exit
    end

if flag "qualified" false
    begin
    if record"I3"data = 1 //Requalification:1. Erases all previously qualified numbers
        begin
        clear record"play"layout
        clear record"#spins"data
        end
    if record"I3"data = 2
        begin
        //Requalification:2. Keeps all previously qualified numbers
        end

    if record"I1"data = 1 //The method qualifies as soon as 1. A single number hits twice in no more then 13 spins
        begin
        call "get repeaters"
        if record"repeaters"layout count > 0
            begin
            put 1 record"play"layout index
            loop until record"play"layout index > record"play"layout count
                begin
                add 1 record"play"layout index
                end
            put 1 record"repeaters"layout index
            if record"repeaters"layout is not found in record"play"layout
                begin
                copy record"repeaters"layout record"play"layout
                put 100% record"play"layout index record"#spins"data index
                put 0 record"#spins"data
                end
            set flag "qualified" true
            clear record"last13#"layout
            end
        end
    if record"I1"data = 2 //The method qualifies as soon as 2. Take the last 13 spins and take all repeaters
        begin
        if record"last13#"layout count = 13
            begin
            call "get repeaters"
            if record"repeaters"layout count > 0
                begin
                put 1 record"play"layout index
                loop until record"play"layout index > record"play"layout count
                    begin
                    add 1 record"play"layout index
                    end
                put 1 record"repeaters"layout index
                loop until record"repeaters"layout index > record"repeaters"layout count
                    begin
                    if record"repeaters"layout is not found in record"play"layout
                        begin
                        copy record"repeaters"layout record"play"layout
                        put 100% record"play"layout index record"#spins"data index
                        put 0 record"#spins"data
                        add 1 record"play"layout index
                        end
                    add 1 record"repeaters"layout index
                    end
                set flag "qualified" true
                end
            end
        end
    end

if flag "qualified" true
    begin
    if record"I2"data = 1 // "During a session:1. continue qualifying for new repeaters"
        begin
        set flag "qualified" false
        end
    end

//bet
if record"play"layout count > 0
    begin
    set flag "return" true
    call "get bet amount"
    put 100% record"bet unit"data record"play"layout list

    put 1 record"#spins"data index
    loop until record"#spins"data index > record"#spins"data count
        begin
        add 1 record"#spins"data
        add 1 record"#spins"data index
        end
    end

end

// subroutines
method "init"
begin
clear record"play"layout
clear record"#spins"data
group
    begin
    display "Hot Nuffdark Numbers IV v1"
    display "-----------------------------------"
    input dropdown "The method qualifies as soon as:
    1:= A single number hits twice in no more then 13 spins
    2:= Take the last 13 spins and take all repeaters" record"I1"data
    input dropdown "During a session:
    1:= continue qualifying for new repeaters
    2:= don't continue qualifying for new repeaters" record"I2"data
    input dropdown "After a session requalification is performed:
    1:= From scratch on newly generated spins
    2:= On the last 13 spins" record"I4"data
    display "A number is bet on for a maximum of 12 spins at all times"
    input dropdown "After a hit:
    1:= Don't remove the number from betting
    2:= Remove the number from betting" record"I6"data
    display "Session ends, When there are no qualified numbers left"
    end

set flag "qualified" false
set flag "clear" false
set flag "return" false
put 0 record"total loss"data
end

method "get bet amount"
begin
//determine amount of numbers to play
put 0 record"amount of numbers active"data
put 1 record"play"layout index
loop until record"play"layout index = record"play"layout count
    begin
    add 1 record"amount of numbers active"data
    add 1 record"play"layout index
    end
//calculate bet
put 100% record"total loss"data record"count"data
put 0 record"bet unit"data
loop until record"count"data > 0
    begin
    subtract 100% record"amount of numbers active"data record"count"data
    add 36 record"count"data
    add 1 record"bet unit"data
    end
end

method "get repeaters"
begin
clear record"repeaters"layout
put 1 record"last13#"layout index
loop until record"last13#"layout index = record"last13#"layout count
    begin
    add 1 record"last13#"layout index
    end
loop until record"last13#"layout index = 0
    begin
    if record"last13#"layout is not found in record"repeaters"layout
        begin
        set flag "repeater" false
        put 100% record"last13#"layout index record"save"data
        copy record"last13#"layout record"ref"layout

        put 1 record"last13#"layout index
        loop until record"last13#"layout index = record"last13#"layout count
            begin
            add 1 record"last13#"layout index
            end
            loop until record"last13#"layout index = 0
            begin
            if record"ref"layout = record"last13#"layout
                begin
                if flag "repeater" true
                    begin
                    if record"ref"layout is not found record"repeaters"layout
                        begin
                        copy record"ref"layout record"repeaters"layout
                        add 1 record"repeaters"layout index
                        set flag "repeater" false
                        end
                    end
                    else
                    begin
                    set flag "repeater" true
                    end
                end
            subtract 1 record"last13#"layout index
            end

        put 100% record"save"data record"last13#"layout index
        end
    subtract 1 record"last13#"layout index
    end
end
