Jump to content
  • 0

Help-me simple script correction


Boardoptions
 Share

Question

gg.alert('Sucess')

function start()

end

function menuC()

menu = gg.choice({'Life','Sair'},nill,'Bypass')

if menu == 1 then life() end
if menu == 2 then os.exit() end

end

function life()

gg.searchNumber('5,53552857e-315',gg.TYPE_DOUBLE)

gg.getresult('22')

gg.editAll(freeze)

end

function exit()

os.exit()

end

menuC()

in gg.searchnumber I need a group search with the following code:

100F;5.53552857e-315E::5

in gg.results I need 22 results

and in the gg.editall part I need to freeze all 22 values that appear in the search

can someone give me a hand?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

 

local t = gg.getResults(22)

for i,v in ipairs(t) do
   if v.flags == gg.TYPE_DOUBLE then
      v.freeze = true
   end
end
gg.setValues(t)
gg.addListItems(t)
t = nil
gg.clearResults()
gg.toast("Done")

see if this work.

Edited by zam535582
Link to comment
Share on other sites

  • 0
9 hours ago, zam535582 said:

 


local t = gg.getResults(22)

for i,v in ipairs(t) do
   if v.flags == gg.TYPE_DOUBLE then
      v.freeze = true
   end
end
gg.setValues(t)
gg.addListItems(t)
t = nil
gg.clearResults()
gg.toast("Done")

see if this work.

I found the solution, here is the missing code for my search;

 

function life()

gg.searchNumber("100F;5.53552857e-315E::5", gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)

revert = gg.getResults(991, nil, nil, nil, nil, nil, nil, nil, nil)
local t = gg.getResults(991, nil, nil, nil, nil, nil, nil, nil, nil)
for i, v in ipairs(t) do
	if v.flags == gg.TYPE_DOUBLE then
		v.value = "5.53552857e-315"
		v.freeze = true
	end
end
gg.addListItems(t)
t = nil

end

 

Edited by Boardoptions
solution
Link to comment
Share on other sites

  • 0
  • Administrators
2 hours ago, Boardoptions said:

5.53552857e-315E

Usually, if you use such numbers, then you are mistaken with the choice of data type. In your case, it should be qword instead of double. If you have a float with strange numbers, you need to use dword.

Link to comment
Share on other sites

  • 0
8 hours ago, Enyby said:

Usually, if you use such numbers, then you are mistaken with the choice of data type. In your case, it should be qword instead of double. If you have a float with strange numbers, you need to use dword.

boss, I'm developing a script, this is a group search where I need to edit each value separately, in this case there are 3 float values, I need to edit each one for other specific values. gg.editall is not for this case because it edits all values in list for a single one, and in my case I would need to edit one by one how would that edition look in a script?

my group search is 

gg.searchNumber("1151.92004394531F;-262.89999389648F;17.30963516235F::9", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)

and those are the separate numbers;

1°)  1151.92004394531

2°) -262.89999389648

3°) 17.30963516235

I need to edit the numbers for these;

1°) -1.106,31103515625

2°) 523,13757324219

3°) 68,24115753174

(Obs: it is a teleportation so the big numbers)

Link to comment
Share on other sites

  • 0
10 hours ago, Boardoptions said:

boss, I'm developing a script, this is a group search where I need to edit each value separately, in this case there are 3 float values, I need to edit each one for other specific values. gg.editall is not for this case because it edits all values in list for a single one, and in my case I would need to edit one by one how would that edition look in a script?

my group search is 

gg.searchNumber("1151.92004394531F;-262.89999389648F;17.30963516235F::9", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)

and those are the separate numbers;

1°)  1151.92004394531

2°) -262.89999389648

3°) 17.30963516235

I need to edit the numbers for these;

1°) -1.106,31103515625

2°) 523,13757324219

3°) 68,24115753174

(Obs: it is a teleportation so the big numbers)

Or you can do this. 

Local r = gg.getResult(22)

r[1].value = 'any value you wanna put'

r[2].value = 'value'

So basically all I did was I assigned r with all the list and then you can use the r with square brackets to edit those specific search values as you wish.

Link to comment
Share on other sites

  • 0
11 minutes ago, CoyFanatic said:

Ou você pode fazer isso. 

Local r = gg .getResult (22)

r [1] .value = 'qualquer valor que você queira colocar'

r [2] .value = 'valor'

Então, basicamente, tudo o que fiz foi atribuir r com toda a lista e, em seguida, você pode usar r com colchetes para editar esses valores de pesquisa específicos, conforme desejar.

Fantastic! What if I want to move items from the saved list to the search list?

Link to comment
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
 Share

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