Jump to content

Enyby

Administrators
  • Posts

    8,811
  • Joined

  • Last visited

  • Days Won

    1,012

Posts posted by Enyby

  1. 11 minutes ago, ItsSC said:

    for i = 1 ,#t1 do

    better use ipairs for speed. or you need make local variable for store

    t[i]

    . Index over table is not a free. Better use it one time per loop iteration if it is possible.

    for i, v in ipairs(results) do

    Already do it for you.

  2. Strictly speaking fastest is reuse results table:

    local results = gg.getResults(5000)
    for i, v in ipairs(results) do
      if v.value == 1014350479 then
        v.value = 1011011011
      elseif v.value == 1050253722 or v.value == 1031127695 then
        v.value = 1
      else
        results[i] = nil
      end
    end
    gg.setValues(results)
    results = nil

     

  3. 38 minutes ago, ItsSC said:

    gg.searchNumber("1014350479;1050253722;1031127695",4)-- refine the three values that you want to edit

    gg.editAll("1011011011;1;1",4) -- edit all of them individually

    Search not ordered, so order can be any and this code not work properly.

    This is not even taking into account the fact that there may be duplicates of the same values in a row.

    [added 1 minute later]
    38 minutes ago, ThienTeakee said:

    I want to find a shortcut

    Iterate over results, build table and pass it to setValues.

    Best solution if you have small amount of results.

  4. You use sleep

    изображение.png

    For me no any problem

    gg.setVisible(false)
    while true do
    	if gg.isVisible() then
    		gg.setVisible(false)
    		local v = gg.alert('Action?', 'ON', 'OFF', 'EXIT')
    		if v == 1 then
    			revert = gg.getListItems(1)
    			rev = gg.getListItems(6)
    			t = gg.getListItems(10)
    			for i, v in ipairs(t) do
    				v.flags = gg.TYPE_DWORD 
    				v.value = 5
    			end
    			gg.setValues(t)
    		elseif v == 2 then
    			gg.setValues(revert)
    			gg.setValues(rev)
    		else
    			gg.setVisible(true)
    			return
    		end
    	else
    		gg.sleep(100)
    	end
    end

     

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