Hi,
I've made a little script that searches for a string on addresses with the tags 'CL'. Then I replace a string with another and and want to add 'AUTO' tag to those adresses that have no tags from before. addresses with RT_MODE has the tag 'CL' and addresses with LL_COLORVAL does not have any tag
The script works, but not allways. So if theres alot of addresses that doesn't have a tag like 70-90% of them gets the tag. Can anyone see through my script and see if its any issues with it?
I've made a little script that searches for a string on addresses with the tags 'CL'. Then I replace a string with another and and want to add 'AUTO' tag to those adresses that have no tags from before. addresses with RT_MODE has the tag 'CL' and addresses with LL_COLORVAL does not have any tag
The script works, but not allways. So if theres alot of addresses that doesn't have a tag like 70-90% of them gets the tag. Can anyone see through my script and see if its any issues with it?
Code:
myobjects = grp.tag('CL')
--log(myobjects[1])
for index, value in pairs(myobjects) do
if string.find(value.name, 'RT_MODE') then
b = string.gsub(value.name, "RT_MODE", "LL_COLORVAL")
x = grp.find(b)
if x.tagcache == '' then grp.addtags(b, 'AUTO') end
end
end