;;;QQ:67762207
[@LottoSystem]
{
#ACT
ClearDelaygoto 1000
ClearDelaygoto 1001
TimeCall 21 25 @LottoSystem_Reset
Delaygoto [Grobal] 5 @LottoSystem_Initial 1000

[@LottoSystem_Initial]
#ACT
ReadValueSql "TBL_LottoServer" "FLD_Name='Current'" "FLD_Sequence" @LottoSystem_Initial_Next

[@LottoSystem_Initial_Next()]
#IF
Mov N90 %ARG(1)

#IF
Equal N90 0	;如果序列号为0
#ACT
Inc N90 1
Movr N91 15	;彩票第一个号码存储	
Movr N92 15	;2
Movr N93 15	;3
goto @LottoSystem_NumberDbinput

#IF
#ACT
goto @LottoSystem_Initial_SpeaklineMsg
break

[@LottoSystem_Initial_SpeaklineMsg]
#IF	;读取总金额
DayofWeek Fri
hour 21 21
#ACT
Delaygoto [Grobal] 3600 @LottoSystem_Initial 1000
#ELSEACT
FormatStr "FLD_Name='Lotto' and FLD_Sequence=%s" %N90
ReadValueSql "TBL_LottoServer" %A9 "FLD_TotalPrice" @LottoSystem_TotalGoldSpeak

[@LottoSystem_TotalGoldSpeak()]
#ACT	;全服通告结果
Mov N95 %ARG(1)
LineMsg [Grobal] "<传奇 新闻快递>：第'<$OUTPUT(N90)>'期传奇彩票总奖金是'<$OUTPUT(N95)>'个积分卷。"
Delaygoto [Grobal] 3600 @LottoSystem_Initial 1000 ;;1个小时

[@LottoSystem_Reset]
#ACT	;初始化彩票
ReadValueSql "TBL_LottoServer" "FLD_Name='Current'" "FLD_Sequence" @LottoSystem_Dairy

[@LottoSystem_Dairy()]
#ACT
Mov N90 %ARG(1)

#IF
DayofWeek Fri
#ACT
Inc N90 1
Movr N91 15
Movr N92 15
Movr N93 15
goto @LottoSystem_NumberDbinput
Delaygoto [Grobal] 300 @LottoSystem_Dairy_ResultTime 1001

[@LottoSystem_NumberDbinput]
#ACT
FormatStr "'Lotto',%s,%s," %N90 %N91
Mov A8 %A9
FormatStr "%s,%s,%s" %N92 %N93 0
AddStr A8 %A9
FormatStr "FLD_Name='Lotto' and FLD_Sequence=%s" %N90
WriteValueSql "TBL_LottoServer" %A9 "FLD_Name,FLD_Sequence,FLD_Num1,FLD_Num2,FLD_Num3,FLD_HumanCount" %A8

[@LottoSystem_Dairy_ResultTime]
#CALL [System\LottoSystem\LottoResult.txt] @LottoSystem_Result
}
;;;QQ:67762207