There are more than 30 code combination buttons.
Instead of processing a value for all: in a single code,
How do I make the ProgressBar active and max?
Could you please give an example with the following codes
Thanks in advance for your answers and ideas.
Code: Select all
----------------------------------------- 1
function DEC_HEX(IN)
local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
if IN<1 then
OUT=0
return OUT
end
while IN>0 do
I=I+1
IN,D=math.floor(IN/B),math.fmod(IN,B)+1
OUT=string.sub(K,D,D)..OUT
end
return OUT
end
-------------------------------------------------- 2
function Aobswap(search, change)
aobs = AOBScan(search)
if(aobs ~= nil) then
j = stringlist_getCount(aobs)
for i = 1, j do
address=stringlist_getString(aobs,i-1)
for i = 1, string.len(change), 3 do
z = string.sub(change, i, i+2)
x, y = string.find(z, "%?+")
if (x == nil) then
script=[[
]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
db ]]..z..[[
]]
autoAssemble(script)
end
end
end
object_destroy(aobs);
aobs=nil
end
end
-----------------------------------------------------------
function byteTableToAobString(t)
for k,v in ipairs(t) do
t[k] = ('%02X'):format(v)
end
return table.concat(t, ' ')
end
-------------------------------------------------- 3
function search()
if not initializeSearch() then return end
local a,b=SearchSendCommand('status aobs')
return tonumber(b) or 0
end
function change()
if not initializeChange() then return end
local a,b=ChangeSendCommand('status Aobswap')
return tonumber(b) or 0
end
-----------------------------------------------------
progressTimer = createTimer(nil,false)
progressTimer.Interval = 10
progressTimer.OnTimer = function ()
UDF1.CEProgressbar1.Position = Aobswap(search)
UDF1.CEProgressbar1.Max = Aobswap(change)
end
----------------------------------------------------- 4
function CEButton1Click(sender)
progressTimer.Enabled = true
codescan1 = 'A0 86 01'
Aobswap(codescan1,('B0 86 01'))
progressTimer.Enabled = false
end