send "get sip from " & getvariable("activecontainer")
and send to: script.
Or, you can have an alias (which will expand variables), and then the timer sends the alias text (with send to execute).
My earlier errors were probably with the "&" they should be "AND", I was crossing my languages.
You can also use Select Case (for multiple if thens) if you have a long list of possible outcomes. (look in the VBScript Docs)
if var1 = 0 And var2 = 0 And var3 = 0 Then
send "command1"
Elseif var3 = 1
send "command3"
end if
if var1 = 1 And var2 = 0 And var3 = 0 then
send "command2"
end if
Amended on Tue 24 Aug 2004 11:07 PM (UTC) by Flannel
Message
Yes, that is possible.
Except you'd use ElseIf.
And you can also break it down and nest them, such as...
if world.GetVariable("A") = "0" Then
if world.Getvariable ("B") = "0" then
if World.getvariable("C") = "0" Then
send "command1"
Elseif World.getvariable("C") = "1"
send "command3"
end if
end if
elseif world.GetVariable("A") = "1" & world.Getvariable ("B") = "0" & world.Getvariable ("C") = "0" then
send "command2"
end if
Or if you just used 0 and 1, then you could disreguard that elseif (for checking c, since if C isnt 0, its 1)
like this:
if world.GetVariable("A") = "0" Then
if world.Getvariable ("B") = "0" then
if World.getvariable("C") = "0" Then
send "command1"
Else
send "command3"
end if
end if
Amended on Tue 24 Aug 2004 10:53 PM (UTC) by Karl_Newbie
Message
I know how to do simple 'if then' statements for triggers
-----------------
if world.GetVariable("pa") = "0" then
send "command1"
else
end if
--------------
(I have another trigger which changes that variable to 1 at times)
But how can I take it up a notch to include more cause variables with possible alternative conclusions. Ideally it would be sort of like this.
if world.GetVariable("A") = "0" & world.Getvariable ("B") = "0" & world.Getvariable ("C") = "0" then
send "command1"
else
if world.GetVariable("A") = "1" & world.Getvariable ("B") = "0" & world.Getvariable ("C") = "0" then
send "command2"
else
if world.GetVariable("A") = "0" & world.Getvariable ("B") = "0" & world.Getvariable ("C") = "1" then
send "command3"
end if
Is something like that possible?
Basically I have triggers for hunger/thirst/spells status which switch their respective variable to 1 or 0. I want MC to evaluate those variables and send the appropriate command upon matching a generic balance regained trigger and or timer. IE "eat from bowl" if the "I'm hungry" status variable is 1, "drink sip from glass" if the thirsty variable is 1, or go ahead with a "perform action" if all the previous variables are 0.
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.