Here is an example that you have asked for. Function to search text was taken from this post.
function searchText(text, encoding)
local bytes = gg.bytes(text, encoding)
local ret = ''
for i, b in ipairs(bytes) do
ret = ret..';'..b
end
ret = ret:sub(2)..'::'..#bytes
return gg.searchNumber(ret, gg.TYPE_BYTE)
end
function getResultsCount()
if gg.getResultsCount then
return gg.getResultsCount()
end
return gg.getResultCount()
end
local input = gg.prompt({'Input string to search:'}, nil, {'text'})
local str = ''
if input == nil then
-- Something to do if the prompt window was cancelled (this block can be omitted)
end
if input ~= nil then
str = input[1]
end
if #str > 0 then
gg.clearResults()
searchText(str, 'UTF-16')
gg.getResults(getResultsCount())
gg.editAll('1', gg.TYPE_BYTE)
end
text_search.lua