Jump to content
  • 0

Group Search edit - LUA Script


Joker0

Question

Hello

I'm trying to implement a group search on a script, I wanna modifiy each number in the group on its own.

Like searching for 10;10;5, I want to edit each one of them to a different number.

I make the following code but it doesn't seem to work.

gg.searchNumber("70;29;1::", gg.TYPE_FLOAT)
results = gg.getResults(100)

for i,v,f in pairs(results) do
     if i.value == 70 then
        i.value = 0
     end
     if v.value == 29 then
        v.value = 0
     end
     if f.value == 1 then
        f.value = 100
     end
end

gg.setValues(results)
gg.addListItems(results)
gg.clearResults()

I'm still learning LUA scripting so idk how to solve this for now.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

try this..

gg.searchNumber("70;29;1::", gg.TYPE_FLOAT)
local result = gg.getResults(100)

for i,v in pairs(result) do
     if v.value == 70 then
        v.value = 0
     elseif
        v.value == 29 then
        v.value = 0
     elseif
        v.value == 1 then
        v.value = 100
     end
end

gg.setValues(result)
gg.addListItems(result)
gg.clearResults()

 

Link to comment
Share on other sites

8 minutes ago, MonkeySAN said:

try this..


gg.searchNumber("70;29;1::", gg.TYPE_FLOAT)
local result = gg.getResults(100)

for i,v in pairs(result) do
     if v.value == 70 then
        v.value = 0
     elseif
        v.value == 29 then
        v.value = 0
     elseif
        v.value == 1 then
        v.value = 100
     end
end

gg.setValues(result)
gg.addListItems(result)
gg.clearResults()

 

Thank u

it did work

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.