Announcement

Collapse
No announcement yet.

script to slowwwww

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    script to slowwwww

    hi,

    i wrote this script to control a software call Cobra 2 (multimedia) via a x10 mini controller. But i find it pretty slow to respond my command.

    here the script :

    'script pour controler le programme Cobra2 avec homeseer

    sub main()

    dim devstatus1
    dim devstatus2
    dim devstatus3
    dim devstatus4

    hs.SetDeviceStatus "m1","17"
    hs.Launch "cobraii.exe","C:\CobraII"

    do
    hs.waitsecs ("1")

    devstatus1=hs.devicestatus ("m1")
    devstatus2=hs.devicestatus ("m2")
    devstatus3=hs.devicestatus ("m3")
    devstatus4=hs.devicestatus ("m4")

    if devstatus1 = "3" then
    hs.keys "12{ENTER}","mp3 cobra player",1
    hs.SetDeviceStatus "m1","17"
    exit do
    end if

    if devstatus2 = "2" then
    hs.keys "{UP}","mp3 cobra player",1
    hs.SetDeviceStatus "m2","17"
    end if

    if devstatus2 = "3" then
    hs.keys "{DOWN}","mp3 cobra player",1
    hs.SetDeviceStatus "m2","17"
    end if

    if devstatus3 = "2" then
    hs.keys "{ENTER}","mp3 cobra player",1
    hs.SetDeviceStatus "m3","17"
    end if

    if devstatus3 = "3" then
    hs.keys "{ESC}","mp3 cobra player",1
    hs.SetDeviceStatus "m3","17"
    end if

    if devstatus4 = "2" then
    hs.keys ".7","mp3 cobra player",1
    hs.SetDeviceStatus "m4","17"
    end if

    if devstatus4 = "3" then
    hs.keys ".8","mp3 cobra player",1
    hs.SetDeviceStatus "m4","17"
    end if


    loop

    end sub

    i try it without the hs.waitsecs "1", but homeseer lock-up when i do that. Does someone know how to speed up this script?

    Stan05
Working...
X