MYS: add promotion mystery cup

This commit is contained in:
Pakin 2025-05-26 14:32:46 +07:00
parent fa49f87ae3
commit 4e79d45ebc
26 changed files with 22429 additions and 32 deletions

View file

@ -0,0 +1,174 @@
DEBUGVAR "Syncing Pool ..."
Var RandomCoffeeCheckIdx = 0
Var RandomCoffeeCheckOkIdx = 0
For RandomCoffeeCheckIdx < 5 Loop
Var CurrentPd = RandMystCoffee[RandomCoffeeCheckIdx]
Var CurrentState !assigned @AutoVar ${CurrentPd}.Button
If CurrentState = "Enable" Then
DEBUGVAR CurrentPd
DEBUGVAR CurrentState
Var RandMystCoffeeEnabled[RandomCoffeeCheckOkIdx] = CurrentPd
Var RandomCoffeeCheckOkIdx = RandomCoffeeCheckOkIdx + 1
EndIf
Var RandomCoffeeCheckIdx = RandomCoffeeCheckIdx + 1
EndFor
DEBUGVAR RandomCoffeeCheckOkIdx
Var RandomTeaCheckIdx = 0
Var RandomTeaCheckOkIdx = 0
For RandomTeaCheckIdx < 7 Loop
Var CurrentPd = RandMystTea[RandomTeaCheckIdx]
Var CurrentState !assigned @AutoVar ${CurrentPd}.Button
If CurrentState = "Enable" Then
Var RandMystTeaEnabled[RandomTeaCheckOkIdx] = CurrentPd
Var RandomTeaCheckOkIdx = RandomTeaCheckOkIdx + 1
EndIf
Var RandomTeaCheckIdx = RandomTeaCheckIdx + 1
EndFor
DEBUGVAR RandomTeaCheckOkIdx
Var RandomMilkCheckIdx = 0
Var RandomMilkCheckOkIdx = 0
For RandomMilkCheckIdx < 7 Loop
Var CurrentPd = RandMystMilk[RandomMilkCheckIdx]
Var CurrentState !assigned @AutoVar ${CurrentPd}.Button
If CurrentState = "Enable" Then
Var RandMystMilkEnabled[RandomMilkCheckOkIdx] = CurrentPd
Var RandomMilkCheckOkIdx = RandomMilkCheckOkIdx + 1
EndIf
Var RandomMilkCheckIdx = RandomMilkCheckIdx + 1
EndFor
DEBUGVAR RandomMilkCheckOkIdx
; TODO: check all state of each menu (Hot, Cold, Blend)
Var RandomOtherCheckIdx = 0
Var RandomOtherCheckOkIdx = 0
Var DisabledOtherPds = ""
For RandomOtherCheckIdx < 12 Loop
Var CurrentPd = RandMystOther[RandomOtherCheckIdx][0]
SPLIT CurrentPd "-" 1 CountryCode
SPLIT CurrentPd "-" 2 DrinkCategory
SPLIT CurrentPd "-" 3 DrinkType
SPLIT CurrentPd "-" 4 DrinkId
Var TypeIdx = 0
SPLIT RandMystOther[RandomOtherCheckIdx][1] "," 1 CurrentType[0]
SPLIT RandMystOther[RandomOtherCheckIdx][1] "," 2 CurrentType[1]
SPLIT RandMystOther[RandomOtherCheckIdx][1] "," 3 CurrentType[2]
Var AtLeastOneEnable = 0
STRCONTAIN "x" CurrentPd HasXInPd
If HasXInPd = "true" Then
; 12-type-0x-id
For TypeIdx < 3 Loop
Var CurrentTypeI = CurrentType[TypeIdx]
If CurrentTypeI = "X" Then
Else
Var DrinkType !assigned @AutoVar "0{CurrentTypeI}"
Var NewCurrentPd !assigned @AutoVar "{CountryCode}-{DrinkCategory}-{DrinkType}-{DrinkId}"
Var CurrentStateByType !assigned @AutoVar ${NewCurrentPd}.Button
If CurrentStateByType = "Enable" Then
Var AtLeastOneEnable = AtLeastOneEnable + 1
EndIf
;
EndIf
Var TypeIdx = TypeIdx + 1
EndFor
If AtLeastOneEnable >= 1 Then
Var RandMystOtherEnabled[RandomOtherCheckOkIdx] = RandomOtherCheckIdx
Var RandomOtherCheckOkIdx = RandomOtherCheckOkIdx + 1
Else
Var DisabledOtherPds = DisabledOtherPds + NewCurrentPd
Var DisabledOtherPds = DisabledOtherPds + ","
EndIf
Else
; single-state-menu
Var CurrentState !assigned @AutoVar ${CurrentPd}.Button
If CurrentState = "Enable" Then
Var RandMystOtherEnabled[RandomOtherCheckOkIdx] = RandomOtherCheckIdx
Var RandomOtherCheckOkIdx = RandomOtherCheckOkIdx + 1
Else
Var DisabledOtherPds = DisabledOtherPds + NewCurrentPd
Var DisabledOtherPds = DisabledOtherPds + ","
EndIf
EndIf
Var RandomOtherCheckIdx = RandomOtherCheckIdx + 1
EndFor
DEBUGVAR RandomOtherCheckOkIdx
DEBUGVAR DisabledOtherPds
; disable-random-by-status
If RandomMilkCheckOkIdx = 0 Then
Var SubRandMilkButtonEnable = "Disable"
SAVELOG "Disable Random Milk"
Else
Var SubRandMilkButtonEnable = "Enable"
EndIf
If RandomTeaCheckOkIdx = 0 Then
Var SubRandTeaButtonEnable = "Disable"
SAVELOG "Disable Random Tea"
Else
Var SubRandTeaButtonEnable = "Enable"
EndIf
If RandomCoffeeCheckOkIdx = 0 Then
Var SubRandCoffButtonEnable = "Disable"
SAVELOG "Disable Random Coffee"
Else
Var SubRandCoffButtonEnable = "Enable"
EndIf

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,72 @@
; BigBigbutton
Var OreoGuarantee = 0
; load-from-persist
CacheVarStr "get" OreoGuarantee
INT OreoGuarantee
If OreoGuarantee = "" Then
Var OreoGuarantee = 0
EndIf
Var ResultRandomIndexCofee = 0
Var ResultRandomIndexTea = 0
Var ResultRandomIndexMilk = 0
Var ResultRandomIndexOtherTemp = 0
Var RandomCoffeeCheckOkLength = RandomCoffeeCheckOkIdx - 1
Var RandomTeaCheckOkLength = RandomTeaCheckOkIdx - 1
Var RandomMilkCheckOkLength = RandomMilkCheckOkIdx - 1
Var RandomOtherCheckOkLength = RandomOtherCheckOkIdx - 1
Random2 0 RandomCoffeeCheckOkLength ResultRandomIndexCofee
Random2 0 RandomTeaCheckOkLength ResultRandomIndexTea
Random2 0 RandomMilkCheckOkLength ResultRandomIndexMilk
Random2 0 RandomOtherCheckOkLength ResultRandomIndexOtherTemp
Var OreoGuarantee = OreoGuarantee + 1
If OreoGuarantee = 10 Then
; reset
Var OreoGuarantee = 0
Var ResultRandomIndexTea = 0
Var ResultRandomIndexMilk = 0
SAVELOG "Woosh! Secret Rare (Rateup!)"
Else
If ResultRandomIndexTea = 0 Then
Var OreoGuarantee = 0
SAVELOG "Holy Moly! Tearala Oreore poom pow!"
EndIf
If ResultRandomIndexMilk = 0 Then
Var OreoGuarantee = 0
SAVELOG "Holy Jeez! Miluku Oreore poom pow pow!"
EndIf
EndIf
CacheVarStr "put" OreoGuarantee
DEBUGVAR ResultRandomIndexCofee
DEBUGVAR ResultRandomIndexTea
DEBUGVAR ResultRandomIndexMilk
DEBUGVAR ResultRandomIndexOtherTemp
Var ProductCodeRandomCoffee = RandMystCoffeeEnabled[ResultRandomIndexCofee]
Var ProductCodeRandomTea = RandMystTeaEnabled[ResultRandomIndexTea]
Var ProductCodeRandomMilk = RandMystMilkEnabled[ResultRandomIndexMilk]
Var ResultRandomIndexOther = RandMystOtherEnabled[ResultRandomIndexOtherTemp]
; ProductCodeRandom -> ProductCodeRandomCoffee
DEBUGVAR ProductCodeRandomCoffee
DEBUGVAR ProductCodeRandomTea
DEBUGVAR ProductCodeRandomMilk
DEBUGVAR ResultRandomIndexOther

View file

@ -0,0 +1,118 @@
DEBUGVAR "Random Pool Setup"
Var PriceProMystRandom = 0
Var RandMystCoffeePrice = 550
; Thai Espresso Smoothie
Var RandMystCoffee[0] = "12-31-03-0001"
; Peach Cafe Latte Smoothie
Var RandMystCoffee[1] = "12-21-03-0060"
; Cafe Latte Smoothie
Var RandMystCoffee[2] = "12-21-03-0002"
; Mint Cafe Latte Smoothie
Var RandMystCoffee[3] = "12-21-03-0057"
; Taiwanese Tea Cafe Latte Smoothie
Var RandMystCoffee[4] = "12-21-03-0030"
Var RandMystTeaPrice = 450
; JASMINE MILK TEA\nOREO SMOOTHIE ----- Secret Rare
Var RandMystTea[0] = "12-02-03-0048"
; Thai Milk Tea Smoothie
Var RandMystTea[1] = "12-02-02-0039"
; Taiwanese Milk Tea Smoothie
Var RandMystTea[2] = "12-02-03-0025"
; Matcha Latte Smootie
Var RandMystTea[3] = "12-02-03-0026"
; Coconut Thai Milk Tea Smoothie
Var RandMystTea[4] = "12-02-03-0062"
; Coconut Matcha Latte Smoothie
Var RandMystTea[5] = "12-02-03-0060"
; Coconut Jasmine Milk Tea Smoothie
Var RandMystTea[6] = "12-02-03-0064"
Var RandMystMilkPrice = 350
; Oreo Volcano Smoothie ----- Secret Rare
Var RandMystMilk[0] = "12-03-03-0009"
; Strawberry Mint Milk Smoothie
Var RandMystMilk[1] = "12-03-03-0037"
; Melon Milk Smoothie
Var RandMystMilk[2] = "12-03-03-0022"
; Coconut Milk Smoothie
Var RandMystMilk[3] = "12-03-03-0058"
; Peach Milk Smoothie
Var RandMystMilk[4] = "12-03-03-0038"
; Straw Milk Smoothie
Var RandMystMilk[5] = "12-03-03-0011"
; Mint Milk Smoothie
Var RandMystMilk[6] = "12-03-03-0036"
; Caramel Latte,1-2-3
Var RandMystOther[0][0] = "12-21-0x-0004"
Var RandMystOther[0][1] = "1,2,3"
Var RandMystOther[0][2] = "12-21-03-0004"
; LYCHEECANO,1-2-X
Var RandMystOther[1][0] = "12-21-0x-0017"
Var RandMystOther[1][1] = "1,2,X"
Var RandMystOther[1][2] = "0017"
; Matcha Latte Mint,1-2-3
Var RandMystOther[2][0] = "12-02-0x-0050"
Var RandMystOther[2][1] = "1,2,3"
Var RandMystOther[2][2] = "0050"
; Lime Tea,1-2-3
Var RandMystOther[3][0] = "12-02-0x-0040"
Var RandMystOther[3][1] = "1,2,3"
Var RandMystOther[3][2] = "0040"
; Caramel Cocoa,1-2-3
Var RandMystOther[4][0] = "12-03-0x-0004"
Var RandMystOther[4][1] = "1,2,3"
Var RandMystOther[4][2] = "12-03-03-0004"
; Cocoa Mint,1-2-3
Var RandMystOther[5][0] = "12-03-0x-0035"
Var RandMystOther[5][1] = "1,2,3"
Var RandMystOther[5][2] = "0035"
; Protein Shake
Var RandMystOther[6][0] = "12-04-02-0011"
Var RandMystOther[6][1] = "X,X,X"
Var RandMystOther[6][2] = "12-04-02-0011"
; Espresso Shake
Var RandMystOther[7][0] = "12-24-02-0004"
Var RandMystOther[7][1] = "X,X,X"
Var RandMystOther[7][2] = "12-24-02-0004"
; Matcha (Healthy),1-2-X
Var RandMystOther[8][0] = "12-02-0x-1027"
Var RandMystOther[8][1] = "1,2,X"
Var RandMystOther[8][2] = "1027"
; Black Tea (Healthy),1-2-X
Var RandMystOther[9][0] = "12-02-0x-1039"
Var RandMystOther[9][1] = "1,2,X"
Var RandMystOther[9][2] = "1039"
; Pepsi Black Plum,X-2-3
Var RandMystOther[10][0] = "12-05-0x-0074"
Var RandMystOther[10][1] = "X,2,3"
Var RandMystOther[10][2] = "0074"
; Strawberry Mint Soda
Var RandMystOther[11][0] = "12-05-02-0063"
Var RandMystOther[11][1] = "X,2,3"
Var RandMystOther[11][2] = "0063"
Var RandomVendingCode = "BLND25"

File diff suppressed because it is too large Load diff

View file

@ -6,14 +6,16 @@
DEBUGVAR ProThaiTeaEnable
DEBUGVAR ProYuzuEnable
DEBUGVAR ProMelonEnable
DEBUGVAR ProMysteryCup
DEBUGVAR IgnoreProfileFromRunEV
If OpenFromPageBoard = 1 Then
; has-ongoing-pro
If ProMelonEnable = 1 Then
OpenInst 2 "ROOT/taobin_project/inter/mys/xml/event/promotion_melonzy.lxml"
If ProMysteryCup = 1 Then
Var BigButtonEnable = "Enable"
OpenInst 2 "ROOT/taobin_project/inter/mys/xml/event/promotion_mystery_cup.lxml"
Var OpenFromPageBoard = 0
Else
@ -22,8 +24,9 @@ If OpenFromPageBoard = 1 Then
Else
; has-ongoing-pro
If ProMelonEnable = 1 Then
OpenInst 2 "ROOT/taobin_project/inter/mys/xml/event/promotion_melonzy.lxml"
If ProMysteryCup = 1 Then
Var BigButtonEnable = "Enable"
OpenInst 2 "ROOT/taobin_project/inter/mys/xml/event/promotion_mystery_cup.lxml"
Var OpenFromPageBoard = 0
Else

View file

@ -8,28 +8,6 @@
Var Propepsi99Enable = 0
; FruityRaya Promo
Var FruityRayaEnable = 0
Var FromFruityRaya = 0
; ThaiTea Promo
Var ProThaiTeaEnable = 0
Var FromProThaiTea = 0
; Yuzu Promo
Var ProYuzuEnable = 0
Var FromProYuzu = 0
; Yuzu Promo
Var IgnoreProfileFromRunEV = 0
Var FromProYuzu250 = 0
; Melon Promo
Var ProMelonEnable = 0
Var FromProMelon = 0
; Pro free oreo topping
Var PromotionOreoToppingFreeEnable = 0
@ -37,6 +15,22 @@ Var PromotionOreoToppingFreeEnable = 0
Var SetProReduceByBO = 0
Var ProReducedPriceEnable = 0
Var ProMysteryCup = 0
If SystemDateMonthInt = 6 Then
If SystemDateDayInt >= 17 Then
Var ProMysteryCup = 1
EndIf
EndIf
If SystemDateMonthInt = 7 Then
Var ProMysteryCup = 1
EndIf
If XMLProfile = "PromoReduced" Then
Var SetProReduceByBO = 1
EndIf
@ -76,6 +70,8 @@ If BoxID = 177746 Then
;Var ProReducedPriceEnable = 0
;Var IgnoreProfileFromRunEV = 1
Var ProMysteryCup = 1
EndIf
If ProMelonEnable = 1 Then
@ -98,3 +94,10 @@ EndIf
; Var EnablePayLaterMode = 1
;
;EndIf
If ProMysteryCup = 1 Then
TRY "/mnt/sdcard/coffeevending/taobin_project/inter/mys/xml/event/mystery_cup/random_list.ev"
TRY "/mnt/sdcard/coffeevending/taobin_project/inter/mys/xml/event/mystery_cup/check_menu.ev"
DEBUGVAR "Syncing Pool Done!"
EndIf