Jump to content
  • 0

How to 'os.exit' it, while someone peek at searching value, when gg are searching values?


nio04
 Share

Question

How to 'os.exit' it, while someone peek at searching value values, when gg are searching values? 

 

Saw some script hav this weird feature... They can immediately terminate their script, while someone peeked when gg were searching

 

Do anybody hav clue? Plz share it

Link to comment
Share on other sites

Recommended Posts

  • 0

Actualy my pseudo code is
 

-- Create a coroutine with infinite loop that check if gg.isVisible(true) then os.exit 

-- everytime you call gg.searchNumber make sure to resume the coroutine first then after the search in ended make sure to yield the coroutine 

but i got one problem, my coroutine is getting killed i dont know why

script.lua

Link to comment
Share on other sites

  • 0

Never mind i have just done some research and find out coroutine actually block the main thread even it is executed in another state
i have done some test
 

local thread2 = coroutine.create(function ()
  for i =1, 10 do
    print ("thread2")
  end
end)

local thread1 = coroutine.create(function ()
  coroutine.resume(thread2)
  print ("thread1")
end)

coroutine.resume(thread1)

 

Link to comment
Share on other sites

  • 0

It's because of fundamentals of how Lua is implemented. The implementations (official one and LuaJ) are single-threaded, therefore only one operation can be performed at a time. Nothing can be done about it without changing the implementation.

Link to comment
Share on other sites

  • 0
function Test() -- function name
gg.setVisible(false) -- set visibility to false
gg.setRanges(gg.REGION_ANONYMOUS) -- ranges name
gg.searchNumber("your value", gg.TYPE_DWORD) -- input your value
if gg.isVisible() then -- if the user tap the gg btn execute the code below
while true do -- set true to trigger
gg.clearResults() -- clear result
gg.clearList() -- clear list so user can't peak the code
gg.alert("Don't open GG while executing") -- alert
os.exit() -- then exit
end
end
end
On 8/25/2021 at 8:37 PM, nio04 said:

How to 'os.exit' it, while someone peek at searching value values, when gg are searching values? 

 

Saw some script hav this weird feature... They can immediately terminate their script, while someone peeked when gg were searching

 

Do anybody hav clue? Plz share it

 

Link to comment
Share on other sites

  • 0

Is this correct?

function Clear_Results_List()
  gg.clearResults()  -- clear result
  gg.clearList()     -- clear list so user can't peak the code
end

function Foo_Bar()
  gg.setVisible(false)              -- set visibility to false
  gg.hideUiButton()                 -- At the beginning of every search function write>
  -- SEARCH
  gg.setRanges(gg.REGION_ANONYMOUS) -- ranges name
  gg.searchNumber(':foo')
  -- END-SEARCH
  if gg.isClickedUiButton() then
    Clear_Results_List()
    gg.alert("Do not open GG while executing, causing an error")         -- alert
    os.exit()                                                            -- then exit
  end
  if gg.isVisible() then                                                 -- if the user tap the gg btn execute the code below
    while true do                                                        -- set true to trigger
      Clear_Results_List()
      gg.alert("Do not open GG while executing, causing an error")       -- alert
      os.exit()                                                          -- then exit
    end
  end
  -- EDIT
  gg.getResults(gg.getResultsCount())
  gg.editAll(':bar', gg.TYPE_BYTE)
  -- END-EDIT
  Clear_Results_List()
  gg.alert("DONE")   -- alert
  -- gg.setVisible(true) -- set visibility to true
  -- gg.showUiButton()   -- After all the searching and editing is done in the function write. That way the game guardian ui doesn't remain hidden
end

Foo_Bar()

 

Edited by MitsuhaMone
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.