Results 1 to 3 of 3

Thread: No programming skill - Need help with script

  1. #1
    Join Date
    Jan 2004
    Posts
    1,859

    Default No programming skill - Need help with script

    Like Mastiff I知 no programmer and can just about get by with this stuff, sometimes with a little help. I read the thread about sending events to girder to change TV channels and though I知 very new to this and not as technical as most here I think I understand it but just need a bit of help changing the script in girder.

    I知 using Sky Digital in the UK so all TV channels are 3 digits long (always). I think I need to do this:

    - For each channel in my CCF, set the IR command to 5001 0000 0000 0002 ffff 0000 0001 0000 and the name of the command to TV.Chan(nnn) (where nnn is the 3-digit channel number)
    - Set up commands in girder to send out IR signals for each of my buttons 0-9 with a girder event trigger like sky1, sky2 etc
    - Set up a girder command that responds to the TV.Chan event with a Variable Manipluation Script (is VMS the correct girder action?)

    If I知 right so far I just need some help with the example script I picked up from the other thread. This script handles both 1 and 2 digit channel numbers and as mine is always 3 digits I知 hoping that it will be simpler. Would someone be kind enough to alter it for me:

    local digit
    if (strsub(pld2,1,1) == '0') then
    TriggerEvent("Pana_Digit"..strsub(pld2,2,2), 18)
    else
    TriggerEvent("Pana_TwoDigits", 18)
    digit = strsub(pld2,1,1)
    TriggerEvent("Pana_Digit"..digit, 18)
    digit = strsub(pld2,2,2)
    TriggerEvent("Pana_Digit"..digit, 18)
    end
    Also, will girder (or my USB-UIRT) send these signals out one by one or do I need some sort of wait command in there? If I need a wait in between each signal how do I accomplish that?

    Thanks for any help you can give.

  2. #2
    Join Date
    Oct 2002
    Location
    Belgium
    Posts
    117

    Default

    If you're certain it's always 3 digits, just do something like this:

    Code:
    local digit
      digit = strsub(pld2,1,1)
      TriggerEvent("sky"..digit, 18) 
      digit = strsub(pld2,2,2)
      TriggerEvent("sky"..digit, 18) 
      digit = strsub(pld2,3,3)
      TriggerEvent("sky"..digit, 18) 
    end
    pld2 in Girder always receives the "parameter" you pass to your "call", in your case what's between the () when using TV.Chan(nnn).
    The script just takes a substring out of it representing each digit, append it to your "base event name" in Girder (sky in your case) and triggers the event.

    For the wait, not sure you'll need to do anything. There are checkboxes and delay settings somewhere in Girder but I don't recall where exactly, so you will need to take a look around in ther Girder UI.

  3. #3
    Join Date
    Jan 2004
    Posts
    1,859

    Default

    Quote Originally Posted by ebariaux
    If you're certain it's always 3 digits, just do something like this:

    Code:
    local digit
      digit = strsub(pld2,1,1)
      TriggerEvent("sky"..digit, 18) 
      digit = strsub(pld2,2,2)
      TriggerEvent("sky"..digit, 18) 
      digit = strsub(pld2,3,3)
      TriggerEvent("sky"..digit, 18) 
    end
    pld2 in Girder always receives the "parameter" you pass to your "call", in your case what's between the () when using TV.Chan(nnn).
    The script just takes a substring out of it representing each digit, append it to your "base event name" in Girder (sky in your case) and triggers the event.

    For the wait, not sure you'll need to do anything. There are checkboxes and delay settings somewhere in Girder but I don't recall where exactly, so you will need to take a look around in ther Girder UI.
    Thanks eric. That's just what I needed. I'll have to wait and see what happens with the trigger events as I don't understand how it works when triggered from a script. I just had visions of it triggering all 3 events synchronously. Hopefully girder or the UIRT is able to sort that out by itself.

    Thanks for your help again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •