Jump to content
  • -1

Help About GG argumen....


Vaster
 Share

Question

About gg.prompt How to make gg.loadresults to This prompt ?

function mrdiggsc()
gg.setVisible(false)
gg.clearResults()
gg.searchNumber('1,062,836,634D;1,106,247,680D;5D~99D;5D~99D;5D;5D::21', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0x7000000000, 0x7FFFFFFFFF, 0)
gg.refineAddress("0", 0xff, gg.TYPE_DWORD, gg.SIGN_EQUAL, 0, -1, 0)
if gg.getResultsCount() == 0 then gg.toast("Value Not Found") MAIN()end
gg.refineNumber(1062836634, gg.TYPE_DWORD)
if gg.getResultsCount() == 0 then gg.toast("Value Not Found .... Wait.....")end
local modc = gg.prompt({'Enter Value : 0 > 99'}, {[1] = recentvalue}, {[1] = "Number"})
if modc == nil then return gg.alert("Value Eror .....") end
local limit = tonumber(modc[1]) 
if limit  < 0 or limit > 99 then  return gg.alert("Value Eror .....")
elseif limit == 100 or limit == 99999 then return gg.alert("Value Eror .....")
elseif limit == nil then return gg.alert("Value Eror .....") end
local r = gg.getResults(1)
local t = gg.TYPE_BYTE
local t = {}
t[1] = {}
t[1].flags = gg.TYPE_BYTE
for i, v in pairs(r) do
v.address = v.address + 0x08
v.flags = gg.TYPE_BYTE
v.value = modc[1]
v.name = "Mr.DiggsRCount"
v.freeze = true
gg.addListItems(r)
gg.setValues(r)
gg.loadResults(r)
gg.getResults(1)
recentvalue = gg.getValues(r)
gg.toast("✅")
gg.clearResults()
end
end

the "recentvalue" not work if i put to the gg.prompt

where i wrong ? can u tell me abut that Sir?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0
2 hours ago, BadCase said:

try
recentvalue[1].value

Attemp nil Value With Key Index 1, 

i try Change The location recent value but i got full table like this

{--table(efc719a)     [1]={--table(3357acb)         ['address']=0x71722f0c28         ['flags']=1--gg.TYPE_BYTE         ['value']=50     } }

how i can put only a table [value]=50 to gg.prompt ?

Link to comment
Share on other sites

  • 0
7 hours ago, MonkeySAN said:

you meant you want the gg.prompt to remember the last/recent number input?

Yes Sirr , Can Help me bcus i want put the promp for Weapon and acccesories later ,the game Have Ids Weapon and make the Ids To Many Work At least We know What Recent Value For What Weapon We Use , Can help me Sirr ?

Link to comment
Share on other sites

  • 0

well i still not quite sure what you really want.

but you can check this example below to see if it really help.

local gg = gg
n = {0}

function START()
gg.clearResults()
local input = gg.prompt(
   {"Enter value :","EXIT"},
   {n[1]},
   {"number","checkbox"})
 
if not input then gg.toast("You've canceled") return
elseif
input[2] == true then os.exit()
else

n[1] = input[1]
gg.searchNumber(input[1],gg.TYPE_DWORD)
count = gg.getResultsCount()
gg.alert("Results found = "..count)
end
end

while true do
while gg.isVisible(true) do
gg.setVisible(false)
START()
end
end

above prompt will remember what the last/recent value entered so that you dont have to enter it again as long as the script is alive.

Edited by MonkeySAN
Link to comment
Share on other sites

  • 0
30 minutes ago, MonkeySAN said:

well i still not quite sure what you really want.

but you can check this example below to see if it really help.

local gg = gg
n = {0}

function START()
gg.clearResults()
local input = gg.prompt(
   {"Enter value :","EXIT"},
   {n[1]},
   {"number","checkbox"})
 
if not input then gg.toast("You've canceled") return
elseif
input[2] == true then os.exit()
else

n[1] = input[1]
gg.searchNumber(input[1],gg.TYPE_DWORD)
count = gg.getResultsCount()
gg.alert("Results found = "..count)
end
end

while true do
while gg.isVisible(true) do
gg.setVisible(false)
START()
end
end

above prompt will remember what the last/recent value entered so that you dont have to enter it again as long as the script is alive.

Thnksss a lot for ur time Sir , I Will try Now 

Link to comment
Share on other sites

  • 0
On 5/3/2023 at 7:52 PM, MonkeySAN said:

well i still not quite sure what you really want.

but you can check this example below to see if it really help.

local gg = gg
n = {0}

function START()
gg.clearResults()
local input = gg.prompt(
   {"Enter value :","EXIT"},
   {n[1]},
   {"number","checkbox"})
 
if not input then gg.toast("You've canceled") return
elseif
input[2] == true then os.exit()
else

n[1] = input[1]
gg.searchNumber(input[1],gg.TYPE_DWORD)
count = gg.getResultsCount()
gg.alert("Results found = "..count)
end
end

while true do
while gg.isVisible(true) do
gg.setVisible(false)
START()
end
end

above prompt will remember what the last/recent value entered so that you dont have to enter it again as long as the script is alive.

Still not Solve it , i try change my lua like this

 

gg.searchNumber('1,062,836,634D;1,106,247,680D;5D~99D;5D~99D;5D;5D::21', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0x7000000000, 0x7FFFFFFFFF, 0)
gg.refineAddress("0", 0xff, gg.TYPE_DWORD, gg.SIGN_EQUAL, 0, -1, 0)
if gg.getResultsCount() == 0 then gg.toast("Value Not Found") return end
gg.refineNumber(1062836634, gg.TYPE_DWORD)
if gg.getResultsCount() == 0 then gg.toast("Value Not Found .... Wait.....")end
local r = gg.getResults(1)
for i, v in pairs(r) do
v.address = v.address + 0x08
v.flags = gg.TYPE_BYTE
gg.loadResults(r)
end
local results = gg.getResults(1)
local numb = gg.getValues(results)
local value = #numb
local addrs = {1}
for i=1, #numb do
    addrs[i] = {}
    addrs[i]["address"] = nil
    addrs[i]["flags"] = nil
    addrs[i]["value"] = "" ..value    
end
local modc = gg.prompt({'Enter Value : 0 > 99'}, addrs, {nil})
if modc == nil then return gg.alert("Value Eror .....") end
local r = gg.getResults(1)
for i, v in pairs(r) do
v.value = modc[1]
v.name = "Mr.DiggsRCount"
v.freeze = true
gg.addListItems(r)
gg.setValues({})
gg.toast("✅")
gg.clearResults()
end        

Screenshot_2023-05-04-19-31-36-453_com.parallel.multi.accounts.spaces.multiple_lite.clone.thumb.jpg.fc3d0caf53d4676454a3531f7078db22.jpg

and get results like that , how i can get value Only In gg.prompt? im so pain about that.....

Link to comment
Share on other sites

  • 0

Hi @Vaster, there's a mistake in your script:

function mrdiggsc()
...
local modc = gg.prompt({'Enter Value : 0 > 99'}, {[1] = recentvalue}, {[1] = "Number"})
...
recentvalue = gg.getValues(r)

You're referencing recentvalue after modc variable. The recentvalue will not be loaded because of this. LUA or general language, follows UP to DOWN and LEFT to RIGHT readings. That's why doing indentation is important and declaring variable must always comes first before you're going to use them.

Quote

Attemp nil Value With Key Index 1, 

i try Change The location recent value but i got full table like this

{--table(efc719a)     [1]={--table(3357acb)         ['address']=0x71722f0c28         ['flags']=1--gg.TYPE_BYTE         ['value']=50     } }

how i can put only a table [value]=50 to gg.prompt ?

That's the result of your first mistake. After changing the location of recentvalue, you can simply access them with recentvalue[1].value as mentioned by previous user.

addrs = {[1]={["address"]=1, ["flags"]=1, ["value"]=50}}
print(addrs[1].value)

[ Prompting ]:
You should read the documentation properly here: gg.prompt(). I'll break down your newest script iteration:

local results = gg.getResults(1)
local numb = gg.getValues(results)
local value = #numb
local addrs = {1}
for i=1, #numb do
    addrs[i] = {}
    addrs[i]["address"] = nil
    addrs[i]["flags"] = nil
    addrs[i]["value"] = "" ..value    
end
local modc = gg.prompt({'Enter Value : 0 > 99'}, addrs, {nil})

You're loading addrs variable inside gg.prompt() wrongly. First, I wanted to mention that: LUA is reading your instruction from LEFT to RIGHT in a single line. Also, tables/dict in LUA are different than other language. In lua, you can specify the tables value without defining key/element, it will automaticly assigned like an array []. Thus, your addrs variable will look like this:

{"your value"}
--equal to
{[1]="your value}

Reading through the documentation, you will know that: gg.prompt() takes argument in orderly fashioned way: ({1},{2},{3}), including the tables keys {[1],[2],[3]}. On the script, you're supplementing a single value inside the first tables argument, it will taken as [1] inside the tables. Thus, the second argument should follow the first argument key:

gg.prompt({"Input Value"}, {1}, {"number"})
--equals to
gg.prompt({[1]="Input Value"}, {[1]=1}, {[1]="number"})

In conclusion, each argument are inheriting each other. On the documentation: the pattern is: gg.prompt( {prompts}, {default_values_for_prompts}, {types_prompts} ). So your script convention will look like this:

for i=1, #numb do
    addrs[i] = {}
    addrs[i]["address"] = nil
    addrs[i]["flags"] = nil
    addrs[i]["value"] = "" ..value    
end
local modc = gg.prompt({'Enter Value : 0 > 99'}, {addrs[1].value}, {"number"})
Edited by MC189
Link to comment
Share on other sites

  • 0
9 minutes ago, MC189 said:

Hi @Vaster, there's a mistake in your script:

function mrdiggsc()
...
local modc = gg.prompt({'Enter Value : 0 > 99'}, {[1] = recentvalue}, {[1] = "Number"})
...
recentvalue = gg.getValues(r)

You're referencing recentvalue after modc variable. The recentvalue will not be loaded because of this. LUA or general language, follows UP to DOWN and LEFT to RIGHT readings. That's why doing indentation is important and declaring variable must always comes first before you're going to use them.

That's the result of your first mistake. After changing the location of recentvalue, you can simply access them with recentvalue[1].value as mentioned by previous user.

addrs = {[1]={["address"]=1, ["flags"]=1, ["value"]=50}}
print(addrs[1].value)

[ Prompting ]:
You should read the documentation properly here: gg.prompt(). I'll break down your newest script iteration:

local results = gg.getResults(1)
local numb = gg.getValues(results)
local value = #numb
local addrs = {1}
for i=1, #numb do
    addrs[i] = {}
    addrs[i]["address"] = nil
    addrs[i]["flags"] = nil
    addrs[i]["value"] = "" ..value    
end
local modc = gg.prompt({'Enter Value : 0 > 99'}, addrs, {nil})

You're loading addrs variable inside gg.prompt() wrongly. First, I wanted to mention that: LUA is reading your instruction from LEFT to RIGHT in a single line. Also, tables/dict in LUA are different than other language. In lua, you can specify the tables value without defining key/element, it will automaticly assigned like an array []. Thus, your addrs variable will look like this:

{"your value"}
--equal to
{[1]="your value}

Reading through the documentation, you will know that: gg.prompt() takes argument in orderly fashioned way: ({1},{2},{3}), including the tables keys {[1],[2],[3]}. On the script, you're supplementing a single value inside the first tables argument, it will taken as [1] inside the tables. Thus, the second argument should follow the first argument key:

gg.prompt({"Input Value"}, {1}, {"number"})
--equals to
gg.prompt({[1]="Input Value"}, {[1]=1}, {[1]="number"})

In conclusion, each argument are inheriting each other. On the documentation: the pattern is: gg.prompt( {prompts}, {default_values_for_prompts}, {types_prompts} ). So your script convention will look like this:

for i=1, #numb do
    addrs[i] = {}
    addrs[i]["address"] = nil
    addrs[i]["flags"] = nil
    addrs[i]["value"] = "" ..value    
end
local modc = gg.prompt({'Enter Value : 0 > 99'}, {addrs[1].value}, {"number"})

Many Thx Sir, for ur time ,and thx again for explain to me , I understand Now where my problem ,from ur explanation .... 

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.