Jump to content
  • 0

Help Lua Script (How To Compare Value When GG Hide)


Vaster
 Share

Question

Sory I have bad English Langue I hope,people can understand , i need help if value other 0/16777473 gg auto delete it 

if old > ( 0 or 16777473 )then

 

 

 

function run()
gg.setVisible(false)
while not gg.isVisible() do
local rem = gg.getListItems()
for i, v in ipairs(rem) do
  if v.name ~= "ChangeEquip" then
    rem[i] = nil
  end
end
rem=tonumber(1) 
x = gg.getListItems(rem)
v = rem
local v = gg.getListItems(rem)
    local old = v[1].value
    v = gg.getValues(v)
    if old ~= v[1].value then
        gg.toast('Changed Party Equipment Removed: '..old..' -> '..v[1].value)
    end
    if old > 16777473 then gg.removeListItems(v) return end
gg.toast(" ! Party Change Equipment Active !")

This for last remnant remastered  game the value changed every i open Menu Game and can crash the game if gg freeze it ,.... 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

Here is an example of the code to remove saved list items that don't match allowed values: 

local allowedValues = {
  [0] = true,
  [16777473] = true
}

local items = gg.getListItems()
for i, v in ipairs(items) do
  if allowedValues[v.value] then
    items[i] = nil -- not including items with allowed values in table with items to be removed
  end
end
gg.removeListItems(items)
Link to comment
Share on other sites

  • 0
On 4/10/2023 at 3:16 AM, CmP said:

Here is an example of the code to remove saved list items that don't match allowed values: 

local allowedValues = {
  [0] = true,
  [16777473] = true
}

local items = gg.getListItems()
for i, v in ipairs(items) do
  if allowedValues[v.value] then
    items[i] = nil -- not including items with allowed values in table with items to be removed
  end
end
gg.removeListItems(items)

sory late reply , and many thankss for ur time Sir

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.