0% found this document useful (0 votes)
24 views1 page

LUA Script Contsum Check 3 Conditions and Test

The document contains a script that calculates a total sum from an array of values while excluding a specific key. It sets a hidden flag based on certain conditions related to the total sum and a specific value from the array. The script also prints various outputs, including the total sum and the status of the hidden flag.

Uploaded by

Ivan Ho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

LUA Script Contsum Check 3 Conditions and Test

The document contains a script that calculates a total sum from an array of values while excluding a specific key. It sets a hidden flag based on certain conditions related to the total sum and a specific value from the array. The script also prints various outputs, including the total sum and the status of the hidden flag.

Uploaded by

Ivan Ho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

hidden_sum = 38

hidden_flag = 40
contsum_id = 36

contsum_array = getvalue(contsum_id)
total_sum = 0

count = 0

for key,value in pairs(contsum_array) do

count = count + 1

if(key == 10077) then


count = count - 1
end

total_sum = (total_sum + tonumber(value or 0))

end

setvalue(hidden_sum,total_sum)

print("total")
print(total_sum)
print("hidden total")
print(tonumber(getvalue(hidden_sum or 0)))
print("****")
print("hiddenSOflag")
print(getvalue(hidden_flag) or "empty")
print("****")

s12_pph = tonumber(contsum_array[10077] or 0)
print("PPH")
print(s12_pph)

if ((count == 0) or (total_sum < 30) or ( s12_pph < 15 )) then


setvalue(hidden_flag,"ScreenOut")
end

print("hiddenSOflag")
print(getvalue(hidden_flag) or "empty")

You might also like