viernes, 14 de noviembre de 2008

Ascensor final (por Iaru)















Private Sub L1_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 4320) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 4320
pcinco.Caption = "1"
pcuatro.Caption = "1"
ptres.Caption = "1"
pdos.Caption = "1"
puno.Caption = "1"
pb.Caption = "1"
ss.Caption = "1"
cuentapisos1.Caption = Val(cuentapisos1.Caption) + 1
L1.Enabled = False
llamar1.Enabled = False
llamardos.Enabled = True
llamartres.Enabled = True
llamarcuatro.Enabled = True
llamarcinco.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L2.Enabled = True
L3.Enabled = True
L4.Enabled = True
L5.Enabled = True
LPB.Enabled = True
LSS.Enabled = True
End Sub

Private Sub L2_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 3360) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 3360
pcinco.Caption = "2"
pcuatro.Caption = "2"
ptres.Caption = "2"
pdos.Caption = "2"
pb.Caption = "2"
ss.Caption = "2"
puno.Caption = "2"
cuentapisos2.Caption = Val(cuentapisos2.Caption) + 1
L2.Enabled = False
llamardos.Enabled = False
llamar1.Enabled = True
llamartres.Enabled = True
llamarcuatro.Enabled = True
llamarcinco.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L3.Enabled = True
L4.Enabled = True
L5.Enabled = True
LPB.Enabled = True
LSS.Enabled = True
End Sub

Private Sub L3_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 2400) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 2400
pcinco.Caption = "3"
pcuatro.Caption = "3"
ptres.Caption = "3"
pdos.Caption = "3"
pb.Caption = "3"
ss.Caption = "3"
puno.Caption = "3"
cuentapisos3.Caption = Val(cuentapisos3.Caption) + 1
L3.Enabled = False
llamartres.Enabled = False
llamar1.Enabled = True
llamardos.Enabled = True
llamarcuatro.Enabled = True
llamarcinco.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L2.Enabled = True
L4.Enabled = True
L5.Enabled = True
LPB.Enabled = True
LSS.Enabled = True

End Sub

Private Sub L4_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 1440) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 1440
pcinco.Caption = "4"
pcuatro.Caption = "4"
ptres.Caption = "4"
pdos.Caption = "4"
pb.Caption = "4"
ss.Caption = "4"
puno.Caption = "4"
cuentapisos4.Caption = Val(cuentapisos4.Caption) + 1
L4.Enabled = False
llamarcuatro.Enabled = False
llamar1.Enabled = True
llamardos.Enabled = True
llamartres.Enabled = True
llamarcinco.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L2.Enabled = True
L3.Enabled = True
L5.Enabled = True
LPB.Enabled = True
LSS.Enabled = True
End Sub

Private Sub L5_Click()
If contraseña = "hola" Then
auxiliar.Caption = Sqr(((ascensor.Top - 480) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 480
pcinco.Caption = "5"
pcuatro.Caption = "5"
ptres.Caption = "5"
pdos.Caption = "5"
pb.Caption = "5"
ss.Caption = "5"
puno.Caption = "5"
cuentapisos5.Caption = Val(cuentapisos5.Caption) + 1
L5.Enabled = False
llamarcinco.Enabled = False
llamar1.Enabled = True
llamardos.Enabled = True
llamartres.Enabled = True
llamarcuatro.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L2.Enabled = True
L3.Enabled = True
L4.Enabled = True
LPB.Enabled = True
LSS.Enabled = True
End If
End Sub

Private Sub llamar1_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 4320) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 4320
pcinco.Caption = "1"
pcuatro.Caption = "1"
ptres.Caption = "1"
pdos.Caption = "1"
puno.Caption = "1"
pb.Caption = "1"
ss.Caption = "1"
cuentapisos1.Caption = Val(cuentapisos1.Caption) + 1
llamar1.Enabled = False
L1.Enabled = False
llamardos.Enabled = True
llamartres.Enabled = True
llamarcuatro.Enabled = True
llamarcinco.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L2.Enabled = True
L3.Enabled = True
L4.Enabled = True
L5.Enabled = True
LPB.Enabled = True
LSS.Enabled = True
End Sub

Private Sub llamarcinco_Click()
If contraseña = "hola" Then
auxiliar.Caption = Sqr(((ascensor.Top - 480) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 480
pcinco.Caption = "5"
pcuatro.Caption = "5"
ptres.Caption = "5"
pdos.Caption = "5"
pb.Caption = "5"
ss.Caption = "5"
puno.Caption = "5"
cuentapisos5.Caption = Val(cuentapisos5.Caption) + 1
llamarcinco.Enabled = False
L5.Enabled = False
llamar1.Enabled = True
llamartres.Enabled = True
llamarcuatro.Enabled = True
llamardos.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L2.Enabled = True
L3.Enabled = True
L4.Enabled = True
LPB.Enabled = True
LSS.Enabled = True
End If
End Sub

Private Sub llamarcuatro_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 1440) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 1440
pcinco.Caption = "4"
pcuatro.Caption = "4"
ptres.Caption = "4"
pdos.Caption = "4"
pb.Caption = "4"
ss.Caption = "4"
puno.Caption = "4"
cuentapisos4.Caption = Val(cuentapisos4.Caption) + 1
llamarcuatro.Enabled = False
L4.Enabled = False
llamarcinco.Enabled = True
llamar1.Enabled = True
llamartres.Enabled = True
llamardos.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L2.Enabled = True
L3.Enabled = True
L5.Enabled = True
LPB.Enabled = True
LSS.Enabled = True
End Sub

Private Sub llamardos_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 3360) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 3360
pcinco.Caption = "2"
pcuatro.Caption = "2"
ptres.Caption = "2"
pdos.Caption = "2"
pb.Caption = "2"
ss.Caption = "2"
puno.Caption = "2"
cuentapisos2.Caption = Val(cuentapisos2.Caption) + 1
llamardos.Enabled = False
L2.Enabled = False
llamarcinco.Enabled = True
llamar1.Enabled = True
llamartres.Enabled = True
llamarcuatro.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L3.Enabled = True
L4.Enabled = True
L5.Enabled = True
LPB.Enabled = True
LSS.Enabled = True
End Sub


Private Sub llamarpb_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 5280) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 5280
pcinco.Caption = "PB"
pcuatro.Caption = "PB"
ptres.Caption = "PB"
pdos.Caption = "PB"
pb.Caption = "PB"
ss.Caption = "PB"
puno.Caption = "PB"
cuentapisospb.Caption = Val(cuentapisospb.Caption) + 1
llamarpb.Enabled = False
LPB.Enabled = False
llamarcinco.Enabled = True
llamar1.Enabled = True
llamartres.Enabled = True
llamarcuatro.Enabled = True
llamardos.Enabled = True
llamarss.Enabled = True
L1.Enabled = True
L2.Enabled = True
L3.Enabled = True
L4.Enabled = True
L5.Enabled = True
LSS.Enabled = True

End Sub

Private Sub llamarss_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 6240) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 6240
pcinco.Caption = "SS"
pcuatro.Caption = "SS"
ptres.Caption = "SS"
pdos.Caption = "SS"
pb.Caption = "SS"
ss.Caption = "SS"
puno.Caption = "SS"
cuentapisosss.Caption = Val(cuentapisosss.Caption) + 1
llamarss.Enabled = False
LSS.Enabled = False
llamarcinco.Enabled = True
llamar1.Enabled = True
llamartres.Enabled = True
llamarcuatro.Enabled = True
llamardos.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L2.Enabled = True
L3.Enabled = True
L4.Enabled = True
L5.Enabled = True
LPB.Enabled = True

End Sub

Private Sub llamartres_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 2400) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 2400
pcinco.Caption = "3"
pcuatro.Caption = "3"
ptres.Caption = "3"
pdos.Caption = "3"
pb.Caption = "3"
ss.Caption = "3"
puno.Caption = "3"
cuentapisos3.Caption = Val(cuentapisos3.Caption) + 1
llamartres.Enabled = False
L3.Enabled = False
llamarcinco.Enabled = True
llamar1.Enabled = True
llamarcuatro.Enabled = True
llamardos.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L2.Enabled = True
L4.Enabled = True
L5.Enabled = True
LPB.Enabled = True
LSS.Enabled = True

End Sub

Private Sub LPB_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 5280) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 5280
pcinco.Caption = "PB"
pcuatro.Caption = "PB"
ptres.Caption = "PB"
pdos.Caption = "PB"
pb.Caption = "PB"
ss.Caption = "PB"
puno.Caption = "PB"
cuentapisospb.Caption = Val(cuentapisospb.Caption) + 1
LPB.Enabled = False
llamarpb.Enabled = False
llamarcinco.Enabled = True
llamar1.Enabled = True
llamarcuatro.Enabled = True
llamardos.Enabled = True
llamarss.Enabled = True
L1.Enabled = True
L2.Enabled = True
L3.Enabled = True
L4.Enabled = True
L5.Enabled = True
llamartres.Enabled = True
LSS.Enabled = True

End Sub

Private Sub LSS_Click()
auxiliar.Caption = Sqr(((ascensor.Top - 6240) / 840) ^ 2)
cuentapisos.Caption = Val(cuentapisos.Caption) + Val(auxiliar.Caption)
ascensor.Top = 6240
pcinco.Caption = "SS"
pcuatro.Caption = "SS"
ptres.Caption = "SS"
pdos.Caption = "SS"
pb.Caption = "SS"
ss.Caption = "SS"
puno.Caption = "SS"
cuentapisosss.Caption = Val(cuentapisosss.Caption) + 1
LSS.Enabled = False
llamarss.Enabled = False
llamarcinco.Enabled = True
llamar1.Enabled = True
llamarcuatro.Enabled = True
llamardos.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L2.Enabled = True
L3.Enabled = True
L4.Enabled = True
L5.Enabled = True
LPB.Enabled = True
llamartres.Enabled = True

End Sub

Private Sub luz_Click()
If ascensor.FillColor = vbBlack Then
ascensor.FillColor = vbWhite
Else
If ascensor.FillColor = vbWhite Then
ascensor.FillColor = vbBlack

End If

End If
End Sub


Private Sub stop_Click()
If llamar1.Enabled = True Then
llamar1.Enabled = False
llamardos.Enabled = False
llamartres.Enabled = False
llamarcuatro.Enabled = False
llamarcinco.Enabled = False
llamarss.Enabled = False
llamarpb.Enabled = False
L1.Enabled = False
L2.Enabled = False
L3.Enabled = False
L4.Enabled = False
L5.Enabled = False
LPB.Enabled = False
LSS.Enabled = False
luz.Enabled = False
pcinco.Enabled = False
pcuatro.Enabled = False
ptres.Enabled = False
pdos.Enabled = False
pb.Enabled = False
ss.Enabled = False
puno.Enabled = False


Else
llamar1.Enabled = True
llamardos.Enabled = True
llamartres.Enabled = True
llamarcuatro.Enabled = True
llamarcinco.Enabled = True
llamarss.Enabled = True
llamarpb.Enabled = True
L1.Enabled = True
L2.Enabled = True
L3.Enabled = True
L4.Enabled = True
L5.Enabled = True
LPB.Enabled = True
LSS.Enabled = True
luz.Enabled = True
pcinco.Enabled = True
pcuatro.Enabled = True
ptres.Enabled = True
pdos.Enabled = True
pb.Enabled = True
ss.Enabled = True
puno.Enabled = True
End If
End Sub

No hay comentarios: