Jump to content
Alma3zol

Can we freeze the values in the script after you change them?

Recommended Posts

Hi 

Can we freeze values after they change them?

if Ba[4] == true then

for i=1,#t1 do

local t2={{address=t1.address-0x8,flags=16}}

if (MXI.getNum(t2)==1) then

local t3={{address=t1.address+0xBAC,flags=16,value=''..buf..''},{address=t1.address+0xBB0,flags=16,value=''..bug..''},{address=t1.address+0xBB4,flags=16,value=''..buh..''},{address=t1.address+0xBB8,flags=16,value=1}}

gg.setValues(t3)

 end end end end

Example Can I Freeze (bac) with 5

Share this post


Link to post
Share on other sites

1 hour ago, Enyby said:

My friend, this is freezing a live search number, but how will it work with this code?

gg.setRanges(4)

gg.clearResults()

gg.searchNumber(''..(Ba[1]-1)..'~'.. (Ba[1] + 1)..'',16)

gg.searchAddress('58')

local t1=gg.getResults(15)

if Ba[2] == true then

for i=1,#t1 do

local t3={{address=t1.address+0x128C,flags=16,value=0},{address=t1.address+0x1290,flags=16,value=1}}

gg.setValues(t3)

   end end  

If I want to freeze.If I want to freeze every address at a different value.

Share this post


Link to post
Share on other sites

Same as you setValues, add it to Saved list with freeze = true.

Also you do it setValues wrong, because call setValues in loop. You need add all values in table, inside loop, and call setValues with this table, outside loop.

Share this post


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

Same as you setValues, add it to Saved list with freeze = true.

Also you do it setValues wrong, because call setValues in loop. You need add all values in table, inside loop, and call setValues with this table, outside loop.

Can you give me an example because I'm a beginner?

And the sucbet works properly without freezing, it gives the result I want.

[added 1 minute later]
7 minutes ago, Enyby said:

Same as you setValues, add it to Saved list with freeze = true.

Also you do it setValues wrong, because call setValues in loop. You need add all values in table, inside loop, and call setValues with this table, outside loop.

function CO()

Ba=gg.prompt({

[1] ='Alma3zol, Enter your hp',

[2] = 'on',

[3] = 'of',

}, {

}, {

 [2] = 'checkbox',

 [3] = 'checkbox',

})

if Ba~=nil then

 

MXI={}

MXI.getNum=function(tab,index)

  temp=0

 if (not index)then index=1 end

 temp=tonumber(gg.getValues(tab)[index].value)

 if (not temp) then temp=-1 end

 return temp

end 

gg.setRanges(4)

gg.clearResults()

gg.searchNumber(''..(Ba[1]-1)..'~'.. (Ba[1] + 1)..'',16)

gg.searchAddress('58')

local t1=gg.getResults(15)

if Ba[2] == true then

for i=1,#t1 do

local t3={{address=t1.address+0x128C,flags=16,value=0},{address=t1.address+0x1290,flags=16,value=1}}

gg.setValues(t3)

   end end

 

if Ba[3] == true then

for i=1,#t1 do

 local t3={{address=t1.address+0xB8C,flags=16,value=5},{address=t1.address+0x1290,flags=16,value=0}}

 gg.setValues(t3)

 end end end

 Ba={}

gg.toast("please relog the game") end

CO () 

This is the whole script code to know with what I'm dealing with

Share this post


Link to post
Share on other sites

Just because it works does not mean that it is done correctly.
You can dig a foundation pit for the foundation of the house with a shovel. This will work. But it is better to take an excavator.

Here freeze with different values:

gg.searchNumber('10', gg.TYPE_DWORD)
local t = gg.getResults(7)
for i, v in ipairs(t) do
	t[i].value = i
	t[i].freeze = true
end
gg.addListItems(t)

As you see addListItems outside loop.

For your code:

local t3 = {}
for i, v in ipairs(t1) do
	table.insert(t3, {address=v.address+0x128C,flags=16,value=0,freeze=true})
	table.insert(t3, {address=v.address+0x1290,flags=16,value=1,freeze=true})
end
gg.setValues(t3)
gg.addListItems(t3)

 

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

×
×
  • Create New...