@program #17356 1 1000 d i $include $lib/alynna $include $lib/money $def THRESHHOLD1 8 $def THRESHHOLD2 6 lvar temp lvar slot1 lvar slot2 lvar slot3 : slot ( -- i ) random 100 % temp ! temp @ 98 >= if 1 exit then temp @ 95 >= if 2 exit then temp @ 90 >= if 3 exit then temp @ 80 >= if 4 exit then temp @ 70 >= if 5 exit then temp @ 50 >= if 6 exit then temp @ 30 >= if 7 exit then temp @ 0 >= if 8 exit then ; : slotval ( i -- i ) temp ! temp @ 1 = if 50 exit then temp @ 2 = if 30 exit then temp @ 3 = if 20 exit then temp @ 4 = if 10 exit then temp @ 5 = if 5 exit then temp @ 6 = if 3 exit then temp @ 7 = if 2 exit then temp @ 8 = if 1 exit then ; : slottxt ( i -- i ) temp ! temp @ 1 = if "====Bar====" exit then temp @ 2 = if "$Sapphire-$" exit then temp @ 3 = if "@---Paw---@" exit then temp @ 4 = if "*---Egg---*" exit then temp @ 5 = if "!--Tails--!" exit then temp @ 6 = if "{--Melon--}" exit then temp @ 7 = if "%-Cherry--%" exit then temp @ 8 = if "(--Lemon--)" exit then ; : main me @ name "Loxorion" smatch not if me @ "~slottime" getprop dup if dup int? if systime over - 5 < if me @ "The machine is resetting (5 seconds)..." notify exit then then then then slot slot1 ! slot slot2 ! slot slot3 ! me @ money 5 >= if me @ -5 addmoney str "You insert 5 sapphires and pull the lever!" cat "Slots" pretty tellme else str "You dont have enough sapphires. " cat "Slots" pretty tellme then ( show it ) str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat "Slots" pretty tellme ( check for 3 winnings ) slot1 @ slot2 @ = slot2 @ slot3 @ = and if str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat me @ name pretty tellhere str "WIN! 3 in a row! " me @ " wins *" slot1 @ slotval 10 * "* sapphires!" cat "Slots" pretty tellhere me @ slot1 @ slotval 10 * addmoney else ( check for 2 winnings ) slot1 @ slot2 @ = slot1 @ THRESHHOLD2 <= and if str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat me @ name pretty tellhere str "WIN! 2 in a row! " me @ " wins *" slot1 @ slotval 3 * "* sapphires!" cat "Slots" pretty tellhere me @ slot1 @ slotval 3 * addmoney else ( check for 1 winnings ) slot1 @ THRESHHOLD1 <= if str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat me @ name pretty tellhere str "WIN! " me @ " wins *" slot1 @ slotval "* sapphires!" cat "Slots" pretty tellhere me @ slot1 @ slotval 1 * addmoney then then then me @ "_slottime" systime setprop ; . c q