(include "sci.sh")
(use "Main")
(use "sStopEggTimer")
(use "eureka")
(use "Sound")
(use "Cycle")
(use "View")
(use "Obj")
(script 202)


(local
    local0[3] = (3 4 5 )

)
(procedure public (proc202_1)
    (panel:
        cel((panel:lastCel()))
        setCycle(Beg panel)
    )
    (panelNoise:
        number(217)
        loop(1)
        play()
    )
)


(instance buttonNoise of Sound
    (properties)
)
(instance panelNoise of Sound
    (properties)
)
(instance public sPushButtons of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (rogArm:init()) (rogHand:
                    init()
                    x(
                        (if (== register 2)
                            202
                        )(else
                            200
                        )
)
                    y(
                        (if (== register 2)
                            142
                        )(else
                            144
                        )
)
                    cel(0)
                    setLoop(local0[register])
                    cycleSpeed(4)
                )
 = cycles 1  )
            )
            (case 1
                (= ticks 30  )
            )
            (case 2
                ((rogHand:setCycle(End self))  )
            )
            (case 3
                ((buttonNoise:
                    number(124)
                    loop(1)
                    play(self)
                )
  )
            )
            (case 4
                ((rogArm:dispose()) (rogHand:dispose()) 
                (switch (register)
                    (case 0
                        (
                        (if (((< (eureka:puke) 1) and not proc0_1(86)) and (> global130 0))
                            = next sPushGreen
                        )
 = cycles 1  )
                    )
                    (case 1
                        (
                        (if (< global170 2)
                            (send gTestMessager:say(6 1 0 4 self 202))
                        )(else
                            (if ((< (eureka:puke) 1) and not proc0_1(86))
                                = next sPushOrange
                                = cycles 1
                            )(else
                                = cycles 1
                            )
                        )
 )
                    )
                    (case 2
                        (= cycles 1 = next sPushRed )
                    )
                )
  )
            )
            (case 5
                ((send gSQ5:handsOn()) (buttonNoise:dispose()) (self:dispose()) )
            )
        )
    )

)
(instance sPushGreen of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) = seconds 1 (monitor1:init())  )
            )
            (case 1
                (
                (if (proc0_1(60))
                    (send gTestMessager:say(6 0 8 1 self))
                )(else
                    (send gTestMessager:say(6 0 8 2 self))
                )
 )
            )
            (case 2
                ((self:setScript(ScriptID(218 0) self))  )
            )
            (case 3
                ((monitor1:dispose()) (send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sPushOrange of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) = seconds 1 (monitor2:init())  )
            )
            (case 1
                ((send gTestMessager:say(40 0 0 1 self))  )
            )
            (case 2
                ((self:setScript(ScriptID(219 0) self))  )
            )
            (case 3
                ((monitor2:dispose()) (send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sPushRed of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (panel:
                    init()
                    cel(0)
                    setCycle(CT 5 1 self)
                )
 (panelNoise:
                    number(217)
                    loop(1)
                    play()
                )
  )
            )
            (case 1
                ((send gCast:eachElementDo(299)) = cycles 1  )
            )
            (case 2
                ((panel:setCycle(CT 9 1 self)) (panelNoise:
                    number(218)
                    loop(1)
                    play()
                )
  )
            )
            (case 3
                (proc204_1() (panel:stopUpd()) = cycles 1  )
            )
            (case 4
                ((send gSQ5:handsOn()) (panelNoise:dispose()) (self:dispose()) )
            )
        )
    )

)
(instance sCycle of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send client:
                    cel(1)
                    setCycle(Beg self)
                )
  )
            )
            (case 1
                (= seconds 1  )
            )
            (case 2
                ((send client:setCycle(End self))  )
            )
            (case 3
                ((self:changeState(0)) )
            )
        )
    )

)
(instance sBlink of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= cycles 1  )
            )
            (case 1
                ((monitor3:setCel(1)) (monitor1:setCel(1)) 
                (if ((send gCast:contains(monitor2)))
                    (monitor2:setCel(1))
                )
 = ticks 20  )
            )
            (case 2
                ((monitor1:setCel(0)) 
                (if ((send gCast:contains(monitor2)))
                    (monitor2:setCel(0))
                )
 (monitor3:setCel(0)) = state (- state 2) = ticks 45 )
            )
        )
    )

)
(instance public monitor1 of Prop
    (properties
        x 88
        y 46
        z 20
        view 201
        loop 6
        priority buttonNoise
        signal 16401
    )

    (method (init param1)
        (if (((>= (eureka:puke) 4) or proc0_1(84)) or (== (send gRoom:script) ScriptID(208 0)))
            (self:
                loop(0)
                cel(0)
                setScript(sBlink)
                noun(36)
            )
            (if (not proc0_1(84) and (<> (send gSq5Music2:number) 105))
                (send gSq5Music2:
                    number(105)
                    loop(-1)
                    play()
                )
            )
        )(else
            (self:
                loop(6)
                cel(0)
                noun(6)
                setCycle(0)
            )
        )
        (super:init(rest param1))
    )

)
(instance public monitor2 of Prop
    (properties
        x 208
        y 46
        z 20
        noun 37
        view 201
        loop 6
        cel 1
        priority 9
        signal 16401
    )

    (method (init param1)
        (if ((>= (eureka:puke) 4) or proc0_1(61))
            (self:
                loop(2)
                cel(0)
                noun(37)
            )
            (super:init(rest param1))
        )(else
            (if (not proc0_1(84))
                (self:
                    loop(6)
                    cel(1)
                    noun(40)
                )
                (super:init(rest param1))
            )
        )
    )

)
(instance public monitor3 of View
    (properties
        x 145
        y 45
        z 20
        noun 38
        view 201
        loop 1
        priority 9
        signal 16401
    )
)
(instance rogArm of View
    (properties
        x sPushOrange
        y 142
        view 200
        loop 2
        priority 9
        signal 16
    )
)
(instance rogHand of Prop
    (properties
        x 200
        y 144
        view 200
        loop 3
        signal 1
    )
)
(instance public panel of Prop
    (properties
        x 195
        y 144
        view 201
        loop 5
        priority 9
        signal 16
    )

    (method (init param1)
        (if (proc0_1(84))
            (self:
                setLoop(5)
                cel((panel:lastCel()))
                stopUpd()
            )
        )(else
            (self:
                setLoop(5)
                cel(0)
                stopUpd()
            )
        )
        (super:init(rest param1))
    )


    (method (dispose param1)
        (panelNoise:dispose())
        (super:dispose(rest param1))
    )


    (method (cue)
        (self:dispose())
    )

)
