Jump to content
  • 0

How to make values change automatically.


Question

Posted (edited)

When I tried Hacking Gunship Battle.

I have to change values from 4 to 1 constantly to get Diamonds again and again. But it take so much time.

Is there any way by which the value can change automatically when the value goes to 4 and automatically goes to 1 Again ?

Please help me.

Edited by KitKat_02

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

METHODE 1:
You have inbuilt freeze value option just use it without any script

METHODE 2:

Do the research, then add the value into the save list. This can be done manually if it is really complex or involves increment/decrement features (User Interaction).
Then we just pick up the value(s) from the save list and check if they changed.

 

local VALUE_FREEZE = 4

local listItems = gg.getListItems()
local listItemsSize = #listItems

if listItemsSize == 0 then
    print("List Item is empty!")
    gg.alert("List Item is empty!")
    os.exit(1)
end

while true do
    local hasChanged = false

    for i = 1, listItemsSize do
        local v = listItems[i]
        if v.value ~= VALUE_FREEZE then
            v.value = VALUE_FREEZE
            hasChanged = true
        end
    end

    if hasChanged then
        gg.setValues(listItems)
    end

    gg.sleep(100)
end

Note: this code is not tested

Edited by MAARS

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
×
×
  • 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.