-- Define the menu options
menu = gg.choice({
"1. Enter Value and Search",
"2. Refine Search",
"3. Edit Results",
"4. Exit"
}, nil, "Game Guardian Script")
-- Function to search for the value in memory
function searchValue()
gg.clearResults()
value = gg.prompt({"Enter the value to search:"}, {[1] = "0"}, {[1] = "number"})
if value == nil then return end
dataType = gg.choice({
"1. Dword",
"2. Float",
"3. Double",
"4. Word",
"5. Byte"
}, nil, "Select Data Type")
if dataType == nil then return end
local typeMap = {
[1] = gg.TYPE_DWORD,
[2] = gg.TYPE_FLOAT,
[3] = gg.TYPE_DOUBLE,
[4] = gg.TYPE_WORD,
[5] = gg.TYPE_BYTE
}
gg.searchNumber(value[1], typeMap[dataType])
gg.toast("Search completed!")
end
-- Function to refine the search results
function refineSearch()
value = gg.prompt({"Enter the new value to refine search:"}, {[1] = "0"}, {[1] = "number"})
if value == nil then return end
gg.refineNumber(value[1], gg.TYPE_DWORD) -- Default to DWORD for refinement
gg.toast("Refinement completed!")
end
-- Function to edit the search results
function editResults()
value = gg.prompt({"Enter the new value to set:"}, {[1] = "0"}, {[1] = "number"})
if value == nil then return end
local results = gg.getResults(100) -- Get up to 100 results
for i, v in ipairs(results) do
v.value = value[1]
end
gg.setValues(results)
gg.toast("Values updated!")
end
-- Main loop
while true do
if menu == 1 then
searchValue()
elseif menu == 2 then
refineSearch()
elseif menu == 3 then
editResults()
elseif menu == 4 then
gg.toast("Exiting script...")
os.exit()
end
menu = gg.choice({
"1. Enter Value and Search",
"2. Refine Search",
"3. Edit Results",
"4. Exit"
}, nil, "Game Guardian Script")
end