Jump to content

Want to know a way for a pause function without terminating execution


Recommended Posts

Posted

Hi, I need help with the prompt command, I want to know if it's possible to replace sleep function in the code below with some other method in which I can choose when to execute the refine function 

local fi = gg.prompt({"Enter Clip Size"},
{[1] ="0"},
{[1] ="number"})
gg.searchNumber(fi[1],gg.TYPE_DWORD)
gg.getResults(20000)
gg.sleep(3000)
local gi = gg.prompt({"Shoot And Enter Clip Size"},
{[1] ="0"},
{[1] ="number"})
gg.refineNumber(gi[1], gg.TYPE_DWORD)
gg.getResults(100)
gg.sleep(5000)
local gti = gg.prompt({"Shoot And Enter Clip Size last time"},
{[1] ="0"},
{[1] ="number"})
gg.refineNumber(gti[1], gg.TYPE_DWORD)
local t = gg.getResults(3)
     for i, v in ipairs(t) do
         t[i].freeze = true
      end
gg.addListItems(t)
gg.setRanges(gg.REGION_CODE_APP,gg.REGION_C_ALLOC, gg.REGION_C_DATA,gg.REGION_ANONYMOUS)

One thing that just came to my mind is using functions, sleep and a loop and asking to either sleep or use refine in prompt, please give ideas and new methods to use.

I used setranges function in the beginning but it was only searching in anonymous region,why??

 

 

Posted (edited)

someone gave me this a very long time ago..dont know if this what you need.

TEST_PromptInput.lua 

it still has gg.sleep in it but this time around the second prompt in the script will not open until you tap GG logo.

Edited by MonkeySAN
Posted

Ohh, okay, thank you so much

Oh ya, that's what I needed, thank you so much, let me try the script and find out if it works for me, I guess it will cuz it sounds like the only exact solution as using loops for asking will cause unnecessary prompts and is inefficient.

Tysm!!<3

Love ya bruh, no homo

Posted
7 hours ago, MonkeySAN said:

someone gave me this a very long time ago..dont know if this what you need.

TEST_PromptInput.lua 596 B · 3 downloads  

it still has gg.sleep in it but this time around the second prompt in the script will not open until you tap GG logo.

gg.searchNumber(input[1], 4)

If you can tell what does the second argument mean in this function, I'll be very grateful again.

 

Posted (edited)

@MonkeySANby using the method you provided for tapping gg for executing script, I used it thrice, but it  infinitely looped second one(shoot and enter clip size)

   gg.setRanges(gg.REGION_CODE_APP | gg.REGION_C_ALLOC | gg.REGION_C_DATA | gg.REGION_ANONYMOUS)

gg.setVisible(false)

while true do

if gg.isVisible() then

   gg.setVisible(false)

   local fi = gg.prompt({"Enter Clip Size"},

{[1] ="0"},

{[1] ="number"})

gg.searchNumber(fi[1],gg.TYPE_DWORD)

gg.getResults(20000)

   gg.sleep(100)

end

gg.setVisible(false)

while true do

if gg.isVisible() then

   gg.setVisible(false)

   local gi = gg.prompt({"Shoot And Enter Clip Size"},

   {[1] ="0"},

   {[1] ="number"})

   gg.refineNumber(gi[1], gg.TYPE_DWORD)

   gg.getResults(100)

   end

   gg.sleep(100)

end

gg.setVisible(false)

while true do

if gg.isVisible() then

   gg.setVisible(false)

   local gti = gg.prompt({"Shoot And Enter Clip Size last time"},

{[1] ="0"},

{[1] ="number"})

gg.refineNumber(gti[1], gg.TYPE_DWORD)

local t = gg.getResults(3)

     for i, v in ipairs(t) do

           t[i].freeze = true

                 end

                 gg.addListItems(t)

   end

   gg.sleep(100)

end

end

 

 

Edited by JoxxApart
Mistake, update,mistake
Posted
1 hour ago, JoxxApart said:

@MonkeySANby using the method you provided for tapping gg for executing script, I used it thrice, but it  infinitely looped first one( enter clip size)

   gg.setRanges(gg.REGION_CODE_APP | gg.REGION_C_ALLOC | gg.REGION_C_DATA | gg.REGION_ANONYMOUS)
gg.setVisible(false)
while true do
if gg.isVisible() then
   gg.setVisible(false)
   local fi = gg.prompt({"Enter Clip Size"},
{[1] ="0"},
{[1] ="number"})
gg.searchNumber(fi[1],gg.TYPE_DWORD)
gg.getResults(20000)
end
   gg.sleep(100)
end
gg.setVisible(false)
while true do
if gg.isVisible() then
   gg.setVisible(false)
   local gi = gg.prompt({"Shoot And Enter Clip Size"},
   {[1] ="0"},
   {[1] ="number"})
   gg.refineNumber(gi[1], gg.TYPE_DWORD)
   gg.getResults(100)
   end
   gg.sleep(100)
end
gg.setVisible(false)
while true do
if gg.isVisible() then
   gg.setVisible(false)
   local gti = gg.prompt({"Shoot And Enter Clip Size last time"},
{[1] ="0"},
{[1] ="number"})
gg.refineNumber(gti[1], gg.TYPE_DWORD)
local t = gg.getResults(3)
     for i, v in ipairs(t) do
              t[i].freeze = true
                    end
                    gg.addListItems(t)
   end
   gg.sleep(100)
end

 

 

Posted
41 minutes ago, MonkeySAN said:

Thanks for telling 4 is dword in ur script.

I don't wanna edit any value as it freezes the game, I just wanna freeze the refined values.

The initial search shows less than 20K results, second refine can either be 2(final) or 100 results. Third refine is the last and final, you didn't include refine function, will it still work?

And there's no need to loop the script, please don't mind😅

And a huge thanks for being so great!

Posted (edited)

To pause a function there is library in lua called coroutine that permit you to suspend your code and resume at anytime. but the actual version of gg do not include this library, you will need to find a moded gg that include it

Edited by MAARS

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