THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.

Revision history  [back]

Lua Script (if condition judgement) is invalid

I just have next script in next,

tox_flag_frag = 0
tox_flag_reliablesn = 1
tox_flag_life = 0

I expect cmdindex = 14, but finally cmdindex is 26 , not sure why (tox_flag_frag > 0) judgement is invalid?

cmdindex = 10

if (tox_flag_frag > 0) then
    cmdindex = cmdindex + 12
end
if (tox_flag_reliablesn > 0) then
    cmdindex = cmdindex + 4
end   
if (tox_flag_life > 0) then
    cmdindex = cmdindex + 4
end

Lua Script (if condition judgement) is invalid

I just have next script in next,

tox_flag_frag = 0
tox_flag_reliablesn = 1
tox_flag_life = 0

I expect cmdindex = 14, but finally cmdindex is 26 , not sure why (tox_flag_frag > 0) judgement is invalid?

 cmdindex = 10

 if (tox_flag_frag > 0) then
     cmdindex = cmdindex + 12
 end
 if (tox_flag_reliablesn > 0) then
     cmdindex = cmdindex + 4
 end   
 if (tox_flag_life > 0) then
     cmdindex = cmdindex + 4
 end

Lua Script (if condition judgement) is invalid

I just have next script in next,

tox_flag_frag = 0 tox_flag_reliablesn = 1 tox_flag_life = 0

0

I expect cmdindex = 14, but finally cmdindex is 26 , not sure why (tox_flag_frag > 0) judgement is invalid?

===================================

 cmdindex = 10

   if (tox_flag_frag > 0) then
        cmdindex = cmdindex + 12
    end
    if (tox_flag_reliablesn > 0) then
        cmdindex = cmdindex + 4
    end   
    if (tox_flag_life > 0) then
        cmdindex = cmdindex + 4
    end

===================================