Joker0 Posted May 19, 2021 Share Posted May 19, 2021 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 More sharing options...
MonkeySAN Posted May 19, 2021 Share Posted May 19, 2021 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 More sharing options...
Joker0 Posted May 19, 2021 Author Share Posted May 19, 2021 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 More sharing options...
Question
Joker0
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.
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
Archived
This topic is now archived and is closed to further replies.