PDA

View Full Version : can this be done ! how



sirbooker
November 7th, 2007, 07:50 PM
i have a command in girder to turn on / off my stereo it also sets a variable in netremote
to either 1 or 0 eg (NetRemote.SendLabel("amp",1) or 0
ok now
i would like to have another command in girder setup to check the variable (amp)
and if it is 1 then have the command jump to another command to turn the stereo off and
set the variable (amp to 0)

so when i go to bed say, i press a button in netremote which will trigger the command to check the variable and then do what needs to be done
any ideas anybody

thanks in advance paul

sirbooker
November 8th, 2007, 06:42 PM
can anyone help me out on this one

thanks in advance
paul
ps.
lua knowlodge = -100
script knowlodge = -100
but i want to learn...

Rob H
November 9th, 2007, 02:55 PM
I'd move most of the logic for this to Girder.

It's been a while since I used Girder 3 though, so it's a bit tricky to remember what's available there.

I've just got back online after moving house so things are still a bit hectic around here - let me know if you still need help.

sirbooker
November 9th, 2007, 06:41 PM
Hello Rob
i am trying to do this i girder (3) at the moment but have got nowhere
all i want to do in netremote is trigger the action in girder to check the variable and preform
the task at hand.
eg...
i would like to have another command in girder setup to check the variable (amp)
and if it is 1 then have the command jump to another command to turn the stereo off and
set the variable (amp to 0)
thanks in advance
paul

sirbooker
November 10th, 2007, 09:37 AM
hi
in girder i have a multi command and it that multi cmmand there are 2 cammands
1. amp = ir to send to turn amp on
2. variable amp = "1"

i also have another command to chack the variable
check amp
it is a script eg...

if (amp >= "1" ) then
TriggerEvent ("ampoff",18)
amp = "0"
end

is the best logic or is there a way to do this i am trying to learn here

thanks in advance
paul

Rob H
November 10th, 2007, 10:09 AM
I'd use actual numbers rather than strings if I were you

sirbooker
November 10th, 2007, 12:49 PM
I'd use actual numbers rather than strings if I were you

Rob could you explain please i don't understand what you mean
why is a number better then a string
thanks paul

Rob H
November 10th, 2007, 01:32 PM
It just feels wrong using strings of "1" and "0" for this rather than 1 and 0.

It won't change how things work, but I'd use the number form throughout. If this were Girder 4 or above I'd actually use true and false, but Girder 3.3 doesn't have those constants.

It does however look as though what you have should be fine.