system "Trojan's Graphical Raindrop System II"
{
*************************************
*          System by Trojan         *
*         on the VIP Lounge         *
*************************************
        Rx-ed by St0rm0r
-------------------------------------
          NOT 00-c0mpatible
-------------------------------------
Qualification: track spins until out off all dozens and columns (6),
there is only 1 of them that didn't hit.
(zero is part of column B)
When qualified: play the dozen or column that qualified for maximum 5 spins
with progression 1,1,2,3,4
-------------------------------------
}
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 record"last N"layout
if record"last N"layout not = number 0
    begin
    track last dozen for 1 record"last D"layout
    track last column for 1 record"last C"layout
    end
    else
    begin
    copy number 0 record"last D"layout
    copy column B record"last C"layout
    end

// section 3: act on a loss
if net < 0
    begin
    add 1 record"pro"data index
    if record"pro"data index > record"pro"data count
        begin
        call "reset"
        exit
        end
    end

// section 4:act on a win
if net > 0
    begin
    call "reset"
    exit
    end

// section 5:act when not qualified
if flag "qualified" false
    begin
    call "update hit frequencies"
    call "check for only 1 remaining"
    end

// section 6:act when  qualified
if flag "qualified" true
    begin
    //bet
    put 100% record"pro"data record"play"layout
    end

end

// subroutines
method "init"
begin
copy list [1st dozen, 2nd dozen, 3rd dozen, column A, column B, column C] to record"CDs"layout
set list [1,1,2,3,4] record"pro"data
call "reset"
end

method "reset"
begin
set flag "qualified" false
set list [0,0,0,0,0,0] record"hits"data
put 1 record"pro"data index
end

method "update hit frequencies"
begin
put 1 record"CDs"layout index
loop until record"CDs"layout index > record"CDs"layout count
    begin
    put 100% record"CDs"layout index record"hits"data index
    if record"CDs"layout = record"last D"layout
        begin
        add 1 record"hits"data
        end
    if record"CDs"layout = record"last C"layout
        begin
        add 1 record"hits"data
        end
    add 1 record"CDs"layout index
    end
end

method "check for only 1 remaining"
begin
put 0 record"total"data
put 1 record"hits"data index
loop until record"hits"data index > record"hits"data count
    begin
    if record"hits"data = 0
        begin
        add 1 record"total"data
        put 100% record"hits"data index record"CDs"layout index
        end
    add 1 record"hits"data index
    end
if record"total"data = 1
    begin
    copy record"CDs"layout record"play"layout
    set flag "qualified" true
    end
if record"total"data = 0
    begin
    call "reset"
    end
end

