Jump to content
ThienTeakee

How to group values to edit in a search?

Recommended Posts

6 minutes ago, Enyby said:

No. Any loop work one-by-one. But you do same work again and again.

You can compile both examples to LASM and compare count of instructions.

You will be unpleasantly surprised by the number of instructions in your code.


for i = 1 ,#t1 do
if(t1[i].value==1014350479)then -- get t1[i]
    t1[i].value = 1011011011 -- get t1[i] again
    elseif(t1[i].value==1050253722 or t1[i].value ==1031127695)then -- get t1[i] two times
    t1[i].value = 1 -- get t1[i] again
	end
end

Lua do not optimize any code. So if you write get same value few times - lua do it for you. With decrease performance, because it is pointless work.

Aight, this refreshed my knowledge of how the loop actually works. Thanks

Share this post


Link to post
Share on other sites

4 minutes ago, CmP said:

it does not really matter when results count is relatively small.

Depends on the specific situation. For example, if the code needs to be executed within a certain time frame or 30 such code sections must be executed. In this case, even for 100 elements there can be a noticeable difference.

Share this post


Link to post
Share on other sites
14 minutes ago, Enyby said:

You can make it is faster, by cache get 'value' from inner table:


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

 

the previous one was already gave a big improvement in my script.

lots new things i had learned today from this topic only.

Share this post


Link to post
Share on other sites

so i had this code = 0;2;800;0::13

want to change = 2;800 

i want to give user to change =  2 to any value they like

but change = 800 to a fixed value.

how can i do that??

Share this post


Link to post
Share on other sites
7 minutes ago, zam535582 said:

so i had this code = 0;2;800;0::13

want to change = 2;800 

i want to give user to change =  2 to any value they like

but change = 800 to a fixed value.

how can i do that??

use prompt for help and do the same as the iterate, just v.value = prompt[1]

Share this post


Link to post
Share on other sites
5 minutes ago, ItsSC said:

use prompt for help and do the same as the iterate, just v.value = prompt[1]

many thanks.

got it now.

Share this post


Link to post
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

  • Similar Content

    • By danihelios10
      Look that video,anyone know how to do it, if anyone knows i can explain how to hack stats 
    • By argarrize
      Pocong Hunter — 
      🇮🇩 Woi njir script pertama gua nih
      🇺🇸 Hello Everyone this my first post 
      Feature look at screenshot
       
      Password : 333
      sorry im forget to add password
    • By argarrize
      View File Pocong Hunter Script V1
      Pocong Hunter — 
      🇮🇩 Woi njir script pertama gua nih
      🇺🇸 Hello Everyone this my first post 
      Feature look at screenshot
       
      Password : 333
      sorry im forget to add password
      Submitter argarrize Submitted 02/26/2020 Category LUA scripts  
    • By RikiVeron
      gg.setRanges(32)
      gg.searchNumber("256;100F;30F::65", 4, false, 536870912, 0, -1)
      gg.getResults(1)
      gg.searchNumber("256", 4, false, 536870912, 0, -1)
      gg.getResults(1)
      gg.setValues({ -- table(f0daf39)
          [1] = { -- table(34d297e)
              ['address'] = 0xabf68a54,
              ['flags'] = 4, -- gg.TYPE_DWORD
              ['value'] = 1,
          },
      })
      gg.addListItems({ -- table(ff33edf)
          [1] = { -- table(733e72c)
              ['address'] = 0xabf68a54,
              ['flags'] = 4, -- gg.TYPE_DWORD
              ['freeze'] = true,
              ['value'] = 1,
          },
          [2] = { -- table(99105f5)
              ['address'] = 0xabf68a60,
              ['flags'] = 4, -- gg.TYPE_DWORD
              ['freeze'] = true,
              ['value'] = 0,
          },
      })
       
      PM me= rikiveron44@gmail.com
      Because i rarely online in game guardian forum. Thanks
      Please help me...
    • By nio04
      First, i am very beginning at this lua script hacking. And i am running sooo trouble doing every search (group, basic search, finding stuff)
       
      The reason i knock -- i hope someone here, can help me, how should i run these codes!!! or how to do these stuff (practical). or basic rules, how things should be done
       
      the tuts r here... is direct. impossiblefor me, to understand
       
      if someone r so friendly amd know about how to find stuff and modify them then plz knock here. i will install any other social media to join and have some conversation with you about it. 
       
      plz i do it for my curious. only education purpose. 
       
      And lastly, veryy soory for my bad English.
×
×
  • Create New...