Hello Guest it is April 18, 2024, 02:28:32 PM

Author Topic: need help with simple script  (Read 2866 times)

0 Members and 1 Guest are viewing this topic.

need help with simple script
« on: December 10, 2010, 07:10:01 PM »
I currently use this one line in a macro file to toggle the THC on/off.

 DoOEMButton(123)  ' toggle THC on/off

This works perfectly. The problem I have is that the program does not know the current state of the THC. So I am trying to make separate THC on and off macros.

' to turn THC on
Cur_THC_status = GetOemLed(24)           'get the state of the THC
  If Cur_THC_status  = 0 Then                ' if the THC is off
   DoOEMButton(123)                              'push the THC button to toggle it on
  End If                                        'end condition statement

' to turn THC off
Cur_THC_status = GetOemLed(24)           'get the state of the THC
  If Cur_THC_status  = 1 Then                ' if the THC is on
   DoOEMButton(123)                             ' push the THC button to toggle it off
  End If                                        'end condition statement

These do not work and I don't know why. I know very little about scripting. Suggestions would be appreciated.
Re: need help with simple script
« Reply #1 on: December 10, 2010, 09:11:15 PM »
' to turn THC on
' get the state of the THC
  If GetOemLed(24)  = false Then                ' if the THC is off
   DoOEMButton(123)                              'push the THC button to toggle it on
  End If                                        'end condition statement

' to turn THC off
' get the state of the THC
  If GetOemLed(24)  = true Then                ' if the THC is on
   DoOEMButton(123)                             ' push the THC button to toggle it off
  End If                                        'end condition statement

Re: need help with simple script
« Reply #2 on: December 11, 2010, 11:28:54 AM »
Works great, thank you.