Jump to content
  • 0

How to Freeze in Range in a lua script


Chupul

Question

3 answers to this question

Recommended Posts

--
revert = gg.getResults(999, nil, nil, nil, nil, nil, nil, nil, nil)
local t = gg.getResults(999, nil, nil, nil, nil, nil, nil, nil, nil)
for i, v in ipairs(t) do
	if v.flags == gg.TYPE_DWORD then
		v.value = "-1"
		v.freeze = true
		v.freezeType = gg.FREEZE_IN_RANGE
		v.freezeFrom = "-5"
		v.freezeTo = "5"
	end
end
gg.addListItems(t)
t = nil

 

Link to comment
Share on other sites

On 10/1/2021 at 7:52 AM, Chupul said:

hi im about to complete my lua script and only missing this one since and i cant seem to find anything about it, can someone help me please on how to Freeze in Range like from -5 to 5? like in the picture i attached

Untitled.png

gg.searchNumber(123, gg.TYPE_DWORD)
local found = gg.getResults(gg.getResultsCount())
local valFreeze = {}
for a, b in next, {-5, -4, -3, -2, -1, 1, 2, 3, 4, 5} do
  valFreeze[b] = a
end
for a, b in next, found do
  if valFreeze[b.value] then
    b.freeze = true--more freeze get help in gg
  --elseif b.value == 123 then--more setting
    
  end
end
gg.addListItems(found)

Like?

Link to comment
Share on other sites

On 10/2/2021 at 10:19 AM, MonkeySAN said:
--
revert = gg.getResults(999, nil, nil, nil, nil, nil, nil, nil, nil)
local t = gg.getResults(999, nil, nil, nil, nil, nil, nil, nil, nil)
for i, v in ipairs(t) do
	if v.flags == gg.TYPE_DWORD then
		v.value = "-1"
		v.freeze = true
		v.freezeType = gg.FREEZE_IN_RANGE
		v.freezeFrom = "-5"
		v.freezeTo = "5"
	end
end
gg.addListItems(t)
t = nil

 

TYVM, with a little bit of research on for i, v in pairs i managed to make it work with my script

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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