Aetherbashing

by Mirami

Back to Mechanic's Corner.

Mirami2009-08-22 22:24:49
still doesn't seem to work, trigger is as follows:

CODE
firing = GetVariable("firing")
targetting = GetVariable("targetting")

if firing == "1" then
Send("turret fire")
elseif targetting == "1" then
targetting
elseif targetting == "0" then
Note ("NO TARGET")
Note ("NO TARGET")
end


And comes up with the following error:

CODE
Compile error
World: Lusternia (Mirami)
Immediate execution
:8: '=' expected near 'elseif'


Any help?

EDIT: Oh, and both variables involved are 0, for this test.
Ayisdra2009-08-22 23:34:52
CODE
if GetVariable("firing") == "1" then
Send("turret fire")
elseif GetVariable("targetting") == "1" then
targetting
elseif GetVariable("targetting") == "0" then
Note ("NO TARGET")
Note ("NO TARGET")
end


You forgot the "GetVariable" for the targetting. (and targetting only has one 't', but as long as you are spelling it wrong like that throughout you should be find)
Mirami2009-08-22 23:41:18
QUOTE (Ayisdra @ Aug 22 2009, 04:34 PM) <{POST_SNAPBACK}>
CODE
if GetVariable("firing") == "1" then
Send("turret fire")
elseif GetVariable("targetting") == "1" then
targetting
elseif GetVariable("targetting") == "0" then
Note ("NO TARGET")
Note ("NO TARGET")
end


You forgot the "GetVariable" for the targetting. (and targetting only has one 't', but as long as you are spelling it wrong like that throughout you should be find)


No, I have it in my Code...

EDIT: if targetting == 1, I want it to execute the "targetting" alias, which auto-targets with priority.
Gregori2009-08-22 23:47:53
You have a local variable called 'targetting'. You can't call your alias 'targetting' as well in that function.

What you have is.

Set local variable targetting

check what targetting equals then call targetting

So in effect.

if 1 = 1 then 1
Unknown2009-08-23 00:08:30
If you have an alias called "targetting," you need to use Execute("targetting") to call that alias. If it's a Lua function, you need to use targetting() to call it.
Mirami2009-08-23 00:27:05
thanks!

EDIT: And... it looks like it works now! Just need to get on a turret to find out...

EDIT2: Simulated, it works! Thanks, everybody!