Unit One's Slotto Machine

@name Slotto Machine V2 [TouchScreen]
@inputs G:wirelink S:wirelink MPStored
@outputs A Spawn [S1 S2 S3]:string SpawnAmount
@persist [N1 N2 N3 J C Cost Theme Text X1 X2 Y1 Y2 Spin]:number [Backround BackroundB]:vector

interval(50)
if(first()){S[2041]=1
    N1=0
    N2=0
    N3=0
    C=2000}

# Global
            Theme = 3 #1= Black And White | 2=Chill |3= Rainbow
if(first()){J=500    }# Jackpot Beggining Number 
            Cost=20

##### BODY     
S1=N1:toString()
S2=N2:toString()
S3=N3:toString()
if(duped()){selfDestruct()}
if(Theme==1){
    ## Black And White
    Backround=vec(255,255,255)
    Text=111
    S[2042]=999
timer("refresh",1000)}   
if(Theme==2){
    ## Chill Thanks For The Idea  [email protected] | Kuhlide
    Backround=vec(100,100,255)
    Text=111
    S[2042]=669
    timer("refresh",1000)}   
if(Theme==3){
    ## Rainbow
    Backround=vec(255,255,255)
    Text=111
    S[2042]=random(111,999)
    timer("refresh",1000)}
if(clk("refresh")){
        S:writeString("                              ",0,0,999,Backround)
        S:writeString("                              ",0,1,999,Backround)
        S:writeString("                              ",0,2,999,Backround)
        S:writeString("Slot Machine",9,0,Text,Backround)
        S:writeString("Credits: "+C:toString(),0,1,Text,Backround)
        S:writeString("Cost: "+Cost,18,1,Text,Backround)
        S:writeString("______________________________",0,2,Text,Backround)
        S:writeString("                              ",0,16,999,900)
        S:writeString("                              ",0,17,999,900)
        S:writeString("                              ",0,15,999,900)
        S:writeString("SPIN",13,16,Text,900)
    }
## GTABS
## X Y
## X Y
X1 = G["X",number]
Y1 = G["Y",number]
Use = G["Use",number]
X2 = X1*100
Y2 = Y1*100



if(MPStored>=Cost){
 TBA=   MPStored/Cost
 C += TBA
TBA=0
Spawn=1
Spawn=1
Spawn=0
TBA=0}

if(X2>0&X2<100&Y2>80&Y2<100&Use&C>=1 & Spin==0){
    Spin=1
    N1=round(random(1,5))
    timer("N1Run",1000)
    C=C-1
    }
if(clk("N1Run")){
        stoptimer("N1Run")
        N2=round(random(1,5))
        timer("N2Run",1000)}
if(clk("N2Run")){
        stoptimer("N2Run")
        N3=round(random(1,5))
        timer("BoB",1000)}
        if(clk("BoB")){
Spin=0

N1=0
N2=0
N3=0
}
 if(N1==N2 & N2==N3 & N2!=0){
    S:writeString("JACKPOT",10,13,Text,Backround)
    soundPlay(1,2,"/music/class_menu_bg.wav")
    SpawnAmount = J
    SpawnAmount= J
    SpawnAmount= 0
timer("JReset",1000)}
if(clk("JReset")){
    S:writeString("       ",10,13,Text)
soundStop(1)}






if(duped()){selfDestruct()}
#By UnitOne   

#-----------------------------------------

S goes to Console Screen
G goes to GraphicTablet
MPStored Goes To Stored Amount
SpawnAmount Goes To The Jackpot MP
Spawn Goes To the Credit MP
S1-3 Goes To Text Screens

1 Like