[@main]
#IF
equal P9 1
#ACT
goto @race
BreakTimeRecall 
break

#IF
equal P9 2
#ACT
goto @cube
BreakTimeRecall 
break

#IF
equal P9 9
#ACT
goto @quit
BreakTimeRecall 
break

#IF
equal P9 0
#ACT
goto @main-1
BreakTimeRecall 
break

[@main-1]
#IF
#ACT
mov P9 0
#SAY
ӭ<$USERNAME>ٶĳ. \
Ƕĳ7䷿. \
Ĳ? \
Ļ߲ȫ<$USERNAME>. \
ҪӮĻ.  \
<ƶ./@race> \
<Ĳ./@presen> \
<̫ˣҰ./@bind> 

[@bind]
#IF
checkitem  6
#ACT
take  6
give  1
#SAY
Ѿѳ. \ \
</@main-1>
#ELSESAY
붼ûУô밡ȷһ. \ \
</@main-1>

[@race]
#IF
#ACT
mov P9 1
#SAY
ҸṩͶӵĻ. \
ף. \ \
<һ/@pre_cube>

[@presen]
#IF
#SAY 
{3,4,5,6}  :  40  ,  {2,3,4,5}  :  35\
{1,2,3,4}  :  35  ,  {6,6,6,6}  :  30\
{5,5,5,5}  :  28  ,  {4,4,4,4}  :  26\
{3,3,3,3}  :  24  ,  {2,2,2,2}  :  22\
{1,1,1,1}  :  20  \
ͬ3λʱ   :   10\
ͬ2ʱ     :   8\
ͬ2λʱ   :   1\
<һ/@dicestart>

[@Quit]
#IF
#ACT
map B011

[@dicestart]
#IF
checkitem  2
#ACT
take  2
movr d0 6
movr d1 6
movr d2 6
movr d3 6
inc d0 1
inc d1 1
inc d2 1
inc d3 1
playdice 4 @next
#SAY
Ͷ. \ \
<һ/@next>
#ELSESAY
ûг. \
޷Ĳ. \ \
<һ/@dicestart>

[@next]
#IF
equal d0 3
equal d1 4
equal d2 5
equal d3 6
#ACT
goto @Dedice1
break

#IF
equal d0 2
equal d1 3
equal d2 4
equal d3 5
#ACT
goto @Dedice2
break

#IF
equal d0 1
equal d1 2
equal d2 3
equal d3 4
#ACT
goto @Dedice3
break

#IF
equal d0 6
equal d1 6
equal d2 6
equal d3 6
#ACT
goto @4dice1
break

#IF
equal d0 5
equal d1 5
equal d2 5
equal d3 5
#ACT
goto @4dice2
break

#IF
equal d0 4
equal d1 4
equal d2 4
equal d3 4
#ACT
goto @4dice3
break

#IF
equal d0 3
equal d1 3
equal d2 3
equal d3 3
#ACT
goto @4dice4
break

#IF
equal d0 2
equal d1 2
equal d2 2
equal d3 2
#ACT
goto @4dice5
break

#IF
equal d0 1
equal d1 1
equal d2 1
equal d3 1
#ACT
goto @4dice6
break

#IF
equal d0 6
equal d1 6
equal d2 6
#ACT
goto @3dice
break

#IF
equal d0 5
equal d1 5
equal d2 5
#ACT
goto @3dice
break

#IF
equal d0 4
equal d1 4
equal d2 4
#ACT
goto @3dice
break

#IF
equal d0 3
equal d1 3
equal d2 3
#ACT
goto @3dice
break

#IF
equal d0 2
equal d1 2
equal d2 2
#ACT
goto @3dice
break

#IF
equal d0 1
equal d1 1
equal d2 1
#ACT
goto @3dice
break

#IF
equal d1 6
equal d2 6
equal d3 6
#ACT
goto @3dice
break

#IF
equal d1 5
equal d2 5
equal d3 5
#ACT
goto @3dice
break

#IF
equal d1 4
equal d2 4
equal d3 4
#ACT
goto @3dice
break

#IF
equal d1 3
equal d2 3
equal d3 3
#ACT
goto @3dice
break

#IF
equal d1 2
equal d2 2
equal d3 2
#ACT
goto @3dice
break

#IF
equal d1 1
equal d2 1
equal d3 1
#ACT
goto @3dice
break

#IF
equal d0 6
equal d1 6
#ACT
goto @2dice1
break

#IF
equal d0 5
equal d1 5
#ACT
goto @2dice1
break

#IF
equal d0 4
equal d1 4
#ACT
goto @2dice1
break

#IF
equal d0 3
equal d1 3
#ACT
goto @2dice1
break

#IF
equal d0 2
equal d1 2
#ACT
goto @2dice1
break

#IF
equal d0 1
equal d1 1
#ACT
goto @2dice1
break

#IF
equal d1 6
equal d2 6
#ACT
goto @2dice
break

#IF
equal d1 5
equal d2 5
#ACT
goto @2dice
break

#IF
equal d1 4
equal d2 4
#ACT
goto @2dice
break

#IF
equal d1 3
equal d2 3
#ACT
goto @2dice
break

#IF
equal d1 2
equal d2 2
#ACT
goto @2dice
break

#IF
equal d1 1
equal d2 1
#ACT
goto @2dice
break

#IF
equal d2 6
equal d3 6
#ACT
goto @2dice
break

#IF
equal d2 5
equal d3 5
#ACT
goto @2dice
break

#IF
equal d2 4
equal d3 4
#ACT
goto @2dice
break

#IF
equal d2 3
equal d3 3
#ACT
goto @2dice
break

#IF
equal d2 2
equal d3 2
#ACT
goto @2dice
break

#IF
equal d2 1
equal d3 1
#ACT
goto @2dice
break
#ELSEACT
goto @normal

[@Dedice1]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸40Ϊ. \
ĻǷ? \ \
<./@main-1> \
<./@dicestart> \
#ACT
give  40

[@Dedice2]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸35Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  35

[@Dedice3]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸35Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  35

[@4dice1]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸30Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  30

[@4dice2]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸28Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  28

[@4dice3]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸26Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  26

[@4dice4]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸24Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  24

[@4dice5]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸22Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  22

[@4dice6]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸20Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  20

[@3dice]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸10Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  10

[@2dice1]
#IF
equal d2 1
equal d3 1
#ACT
goto @2pair
break

#IF
equal d2 2
equal d3 2
#ACT
goto @2pair
break

#IF
equal d2 3
equal d3 3
#ACT
goto @2pair
break

#IF
equal d2 4
equal d3 4
#ACT
goto @2pair
break

#IF
equal d2 5
equal d3 5
#ACT
goto @2pair
break

#IF
equal d2 6
equal d3 6
#ACT
goto @2pair
break
#ELSEACT
goto @2dice

[@2pair]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸8Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  8

[@2dice]
#IF
#SAY
ף!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
͸1Ϊ. \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>
#ACT
give  1

[@normal]
#IF
#SAY
ܿϧ, һҲûõ!! \ 
 <$STR(D0)> , <$STR(D1)> , <$STR(D2)> , <$STR(D3)> \
ĻǷ? \ \
<./@dicestart> \
<./@main-1>

[@pre_cube]
#IF
checkitem  1
#ACT
mov P9 2
take  1
movr d0 6
inc d0 1
playdice 1 @cube
#SAY
Ͷ.\\
<һ/@cube>
#ELSESAY
<$USERNAME>ûг. \
޷Ĳ. \ 
,׼ó\ \
<˳/@Quit>
#ELSEACT
mov P9 9

[@cube]
#SAY
ӵĵ <$STR(D0)>  \
ǰ <$STR(D0)>  \ \
<ƶ/@next_cube>

[@next_cube]
#IF
equal d0 1 
#ACT
goto @posi1
break

#IF
equal d0 2 
#ACT
goto @posi2
break

#IF
equal d0 3 
#ACT
goto @posi3
break

#IF
equal d0 4 
#ACT
goto @posi4
break

#IF
equal d0 5
#ACT
goto @posi5
break

#IF
equal d0 6 
#ACT
goto @posi6
break

[@Posi1]
#IF
#ACT
batchDelay 1
addbatch B108
batchmove

[@Posi2]
#IF
#ACT
batchDelay 1
addbatch B108
addbatch B109
batchmove

[@Posi3]
#IF
#ACT
batchDelay 1
addbatch B108
addbatch B109
addbatch B110
batchmove

[@Posi4]
#IF
#ACT
batchDelay 1
addbatch B108
addbatch B109
addbatch B110
addbatch B111
batchmove

[@Posi5]
#IF
#ACT
batchDelay 1
addbatch B108
addbatch B109
addbatch B110
addbatch B111
addbatch B112
batchmove

[@Posi6]
#IF
#ACT
batchDelay 1
addbatch B108
addbatch B109
addbatch B110
addbatch B111
addbatch B112
addbatch B113
batchmove