Jump to content
  • 0

How can I make game guardian wait the value change on scripts?


Estrelad

Question

I'm creating a script and I can't make game guardian wait to value be changed by my actions on game.

 

This is my script::

:start:: 

menu=gg.choice({1,2,3,4,5,6,7,8,9,0}) 

if menu == 1 then a="100" end 

if menu == 2 then a="200" end 

if menu == 3 then a="300" end 

if menu == 4 then a="400" end 

if menu == 5 then a="500" end 

if menu == 6 then a="600" end 

if menu == 7 then a="700" end 

if menu == 8 then a="800" end 

if menu == 9 then a="900" end 

if menu == 0 then a="0" end 

 

::N2:: 

menu2=gg.choice({1,2,3,4,5,6,7,8,9,0}) 

if menu2 == 1 then b="10" end 

if menu2 == 2 then b="20" end 

if menu2 == 3 then b="30" end 

if menu2 == 4 then b="40" end 

if menu2 == 5 then b="50" end 

if menu2 == 6 then b="60" end 

if menu2 == 7 then b="70" end 

if menu2 == 8 then b="80" end 

if menu2 == 9 then b="90" end 

if menu2 == 0 then b="0" end 

 

::N3:: 

menu3=gg.choice({1,2,3,4,5,6,7,8,9,0}) 

if menu3 == 1 then c="1" end 

if menu3 == 2 then c="2" end 

if menu3 == 3 then c="3" end 

if menu3 == 4 then c="4" end 

if menu3 == 5 then c="5" end 

if menu3 == 6 then c="6" end 

if menu3 == 7 then c="7" end 

if menu3 == 8 then c="8" end 

if menu3 == 9 then c="9" end 

if menu3 == 0 then c="0" end 

 

::PB:: 

gg.clearResults() 

n1=a+b+c 

gg.searchNumber(n1,gg.TYPE_DWORD) 

 

::N4:: 

menu=gg.choice({1,2,3,4,5,6,7,8,9,0}) 

if menu == 1 then a="100" end 

if menu == 2 then a="200" end 

if menu == 3 then a="300" end 

if menu == 4 then a="400" end 

if menu == 5 then a="500" end 

if menu == 6 then a="600" end 

if menu == 7 then a="700" end 

if menu == 8 then a="800" end 

if menu == 9 then a="900" end 

if menu == 0 then a="0" end 

 

::N5:: 

menu2=gg.choice({1,2,3,4,5,6,7,8,9,0}) 

if menu2 == 1 then b="10" end 

if menu2 == 2 then b="20" end 

if menu2 == 3 then b="30" end 

if menu2 == 4 then b="40" end 

if menu2 == 5 then b="50" end 

if menu2 == 6 then b="60" end 

if menu2 == 7 then b="70" end 

if menu2 == 8 then b="80" end 

if menu2 == 9 then b="90" end 

if menu2 == 0 then b="0" end 

 

::N6:: 

menu3=gg.choice({1,2,3,4,5,6,7,8,9,0}) 

if menu3 == 1 then c="1" end 

if menu3 == 2 then c="2" end 

if menu3 == 3 then c="3" end 

if menu3 == 4 then c="4" end 

if menu3 == 5 then c="5" end 

if menu3 == 6 then c="6" end 

if menu3 == 7 then c="7" end 

if menu3 == 8 then c="8" end 

if menu3 == 9 then c="9" end 

if menu3 == 0 then c="0" end 

 

::PB1:: 

n1=a+b+c 

gg.searchNumber(n1,gg.TYPE_DWORD) 

gg.editall(999) 

The problem is: I can't make game guardian wait for I change the value, do you know how could I make game guardian hang the script on until I make a change on value and after that I open the gg again and the script still there?

I wanna a pause, not a stop

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

In my merge dragons script I had a gg.sleep as well as a yes or no prompt that would return to the gg.sleep if a user hit no this could work but it would require the user to tell the script that the value changed with the yes or no prompt

It would look something like

function()

menu = gg.choice({})

if menu == nil then
gg.alert('answer the question')
INQUIRE()
else
if menu == 1 then Yes() end
if menu == 2 then no() end
end
end

Then call function when you want your script to ask. Have no() return back to function() have yes() do all post change processes

Link to comment
Share on other sites

I see a lot of redundancy.. So I decide to clean it up.

Original

Spoiler

menu=gg.choice({1,2,3,4,5,6,7,8,9,0}) 

if menu == 1 then a="100" end 

if menu == 2 then a="200" end 

if menu == 3 then a="300" end 

if menu == 4 then a="400" end 

if menu == 5 then a="500" end 

if menu == 6 then a="600" end 

if menu == 7 then a="700" end 

if menu == 8 then a="800" end 

if menu == 9 then a="900" end 

if menu == 0 then a="0" end 

 

::N2:: 

menu2=gg.choice({1,2,3,4,5,6,7,8,9,0}) 

if menu2 == 1 then b="10" end 

if menu2 == 2 then b="20" end 

if menu2 == 3 then b="30" end 

if menu2 == 4 then b="40" end 

if menu2 == 5 then b="50" end 

if menu2 == 6 then b="60" end 

if menu2 == 7 then b="70" end 

if menu2 == 8 then b="80" end 

if menu2 == 9 then b="90" end 

if menu2 == 0 then b="0" end 

 

::N3:: 

menu3=gg.choice({1,2,3,4,5,6,7,8,9,0}) 

if menu3 == 1 then c="1" end 

if menu3 == 2 then c="2" end 

if menu3 == 3 then c="3" end 

if menu3 == 4 then c="4" end 

if menu3 == 5 then c="5" end 

if menu3 == 6 then c="6" end 

if menu3 == 7 then c="7" end 

if menu3 == 8 then c="8" end 

if menu3 == 9 then c="9" end 

if menu3 == 0 then c="0" end 

 

Shorten version:

local CHOICES = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}
function getResult(multiplier)
    local menu = gg.choice(CHOICES) 
    return menu * multiplier
end

Here is the final result.

local CHOICES = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}
function getResult(multiplier)
    local menu = gg.choice(CHOICES) 
    return menu * multiplier
end
-- Prompt three times in a row and wait...
function find()
    local a, b, c = getResult(100), getResult(10), getResult(1)
    local n1= getResult(100) + getResult(10) + getResult(1) 
    gg.searchNumber(n1, gg.TYPE_DWORD) 
    --You can edit anything here
end
function main()
    local menu = gg.choice({"Find", "Refine", "Edit"}, nil, "YOUR TITLE")
    if not menu then 
    else
        if menu == 1 then
            gg.clearResults()
            find()
        elseif menu == 2 then 
            find()
        else
            gg.getResults(gg.getResultsCount())
            gg.editAll(999)
    end
end
  
while true do
    if gg.isVisible() then
      gg.setVisible(false)
      main()
    end
end

 

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.