Jump to content
  • 0

How to write command


OraOraOra

Question

5 answers to this question

Recommended Posts

55 minutes ago, OraOraOra said:

I need help

Example i search value : 1;2;3;4::14

value show : 1;2;3;4

i want to edit :

1 to 10, 2 to 20, 3 to 30, 4 to 40. simultaneously

How i write command in the script?

a = gg.searchNumber("1;2;3;4::14", gg.TYPE_DWORD)
a = gg.getResults(gg.getResultsCount())
b = gg.refineNumber("1", gg.TYPE_DOWRD)
gg.getResults(gg.getResultsCount())
gg.editAll(10, gg.TYPE_DWORD)
gg.clearResults()
gg.loadResults(a)
b = gg.refineNumber("2", gg.TYPE_DOWRD)
gg.getResults(gg.getResultsCount())
gg.editAll(20, gg.TYPE_DWORD)
gg.clearResults()
gg.loadResults(a)
b = gg.refineNumber("3", gg.TYPE_DOWRD)
gg.getResults(gg.getResultsCount())
gg.editAll(30, gg.TYPE_DWORD)
gg.clearResults()
gg.loadResults(a)
b = gg.refineNumber("4", gg.TYPE_DOWRD)
gg.getResults(gg.getResultsCount())
gg.editAll(40, gg.TYPE_DWORD)
gg.clearResults()
 

Link to comment
Share on other sites

1 hour ago, OraOraOra said:

I need help

Example i search value : 1;2;3;4::14

value show : 1;2;3;4

i want to edit :

1 to 10, 2 to 20, 3 to 30, 4 to 40. simultaneously

How i write command in the script?

gg.searchNumber("1;2;3;4::14", 4)
local t = gg.getResults(10)

for i,v in ipairs(t) do
      local value = v.value
      if value == 1 then
         v.flags = 4
         v.value = 10
      end    
      if value == 2 then
         v.flags = 4
         v.value = 20
      end
      if value == 3 then 
         v.flags = 4
         v.value = 30
      end

       if value == 4 then 

            v.flags = 4

            v.value = 40
end

Link to comment
Share on other sites

10 minutes ago, El_dorado said:

gg.searchNumber("1;2;3;4::14", 4)
local t = gg.getResults(10)

for i,v in ipairs(t) do
      local value = v.value
      if value == 1 then
         v.flags = 4
         v.value = 10
      end    
      if value == 2 then
         v.flags = 4
         v.value = 20
      end
      if value == 3 then 
         v.flags = 4
         v.value = 30
      end

       if value == 4 then 

            v.flags = 4

            v.value = 40
end

Use pairs instead of ipairs.

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.