Jump to content
  • 0

Requesting updates for gg.prompt and gg.multiChoice function


Zulfilham
 Share

Question

Hey @Enyby, could you please update these 2 functions: gg.prompt and gg.multiChoice?

They are great for getting input from user, but it lacks a very important feature that still missing.  For example, when I am still entering the prompt partially, sometimes I close GG to have a better visual on what the full input's gonna be.  But here's the problem, as soon as I close GG, those partial inputs typed are gone (pressing non-OK).  When I next open GG, I don't have programmatically ways to store previous input so that it can be used later on.  Things also go the same for gg.multiChoice, but instead of prompts it is for menu list checkmarks.

Do you think you can handle this in the near future? This is the best feature that I've been wanting to have in my scripts.

 

Screenshot_2022-03-24-22-20-18-117_com.termux.jpg

Screenshot_2022-03-24-22-20-25-564_com.termux.jpg

Screenshot_2022-03-24-22-24-09-056_com.termux.jpg

Screenshot_2022-03-24-22-24-13-286_com.termux.jpg

Edited by Zulfilham
Fix typo
Link to comment
Share on other sites

Recommended Posts

  • 0
4 hours ago, BadCase said:

Text can not be saved without submitting the dialog, and you would need to add a menu after submitting that asks if it is the complete text because GG will have no way of determining if it is the partial or complete text.....

I know. 🙂

That is what I was talking about above.  That is why I request/suggest an update (if possible).

Link to comment
Share on other sites

  • 0
  • Administrators
Quote

Returns

nil if the dialog has been canceled, or the table with keys from prompts and values from input fields.

If this always return something, then you never know what user press - OK or Cancel. Or simple close dialog.

Also if you press cancel, all data must be lost and erased. It is common and default behavior everywhere.

Even in matter of simple logic and security. If you accidentally past in form sensitive data and press cancel for avoid propagate it, data must be lost, not processed.

Look like you want solve wrong problem or by wrong approach.

If you want store input for close UI - write that in prompt. So user press OK in any case and later script ask him for apply data or no. if no, you can use this data on next call dialog.

Link to comment
Share on other sites

  • 0
35 minutes ago, Enyby said:

If this always return something, then you never know what user press - OK or Cancel. Or simple close dialog.

Also if you press cancel, all data must be lost and erased. It is common and default behavior everywhere.

Even in matter of simple logic and security. If you accidentally past in form sensitive data and press cancel for avoid propagate it, data must be lost, not processed.

Look like you want solve wrong problem or by wrong approach.

If you want store input for close UI - write that in prompt. So user press OK in any case and later script ask him for apply data or no. if no, you can use this data on next call dialog.

Oh ok.  No updates.  For security reason.  Thanks for the warnings.

That last approach may be cumbersome too, I don't know.  I thought if cancel presses then there might be 2 values (boolean & table) return or something.  But, whatever at least there's a workaround. 😞

Edited by Zulfilham
Fix typo
Link to comment
Share on other sites

  • 0
35 minutes ago, Enyby said:

f you want store input for close UI - write that in prompt. So user press OK in any case and later script ask him for apply data or no. if no, you can use this data on next call dialog.

i dont quite get it.

would it be like this..

- user open prompt

- user enter data but forget the remaining data need to enter

- user press CANCEL/ OK  ??

- previous data got saved

- user open prompt again

- a dialog box appear ask user if need to use previous data

- if YES, prompt open with previous data fill for user to countinue.

- if NO, prompt start again empty for new data

 

Edited by MonkeySAN
everyday is learning day..
Link to comment
Share on other sites

  • 0
8 hours ago, MonkeySAN said:

user press CANCEL/ OK  ??

This approach is quite good but remember that when user press cancel data will not be saved, prompt will return nil

Edited by MAARS
Link to comment
Share on other sites

  • 0
On 3/25/2022 at 9:43 AM, Zulfilham said:

Mine is like this.  Too many pop-ups, I don't like it.  Lol.

Better not to implement it, to me it's really annoying... 😕

script.lua 641 B · 13 downloads

entering_value = false
partial_value = ""

function enterValue()
    local menu = gg.prompt({"Enter value (append ~ for partial value): "}, {partial_value}, {"number"})
    if menu ~= nil then
        if menu[1]:find("~") then
            partial_value = menu[1]:sub(1, -2)
            entering_value = true
        else
            entering_value = false
            partial_value = ""
            gg.toast("Value of " .. menu[1] .. " is being processed...")
        end
    end
end

function home()
    if entering_value == true then
        enterValue()
    else
        local menu = gg.choice ({"Enter value"})
        if menu ~= nil then
            if menu == 1 then
                enterValue()
            end
        end
    end
end

gg.showUiButton()

while true do
    if gg.isClickedUiButton() then
        home()
    end
    gg.sleep(100)
end

For this solution you append a tilde ~ to your entry if it is a partial entry

So 123~ submit the prompt as normal, press the [Sx] button and the prompt appears again with 123, enter the rest of your value and submit or append ~ to it again and add more to the value.

If you intended to have a tilde in your entered data you can replace it with "r" or "h" or one of the hex letter values available in GG's numeric keyboard

Or if you prefer I can just make a few small changes and add a checkbox to the prompt for the user to check when it is a partial entry

Edited by BadCase
Link to comment
Share on other sites

  • 0
entering_value = false
partial_value = ""

function enterValue()
    local menu = gg.prompt({"Enter value (append ~ for partial value): ","Is Partial Entry"}, {partial_value,false}, {"number","checkbox"})
    if menu ~= nil then
        if menu[2] == true then
            partial_value = menu[1]
            entering_value = true
        else
            entering_value = false
            partial_value = ""
            gg.toast("Value of " .. menu[1] .. " is being processed...")
        end
    end
end

function home()
    if entering_value == true then
        enterValue()
    else
        local menu = gg.choice ({"Enter value"})
        if menu ~= nil then
            if menu == 1 then
                enterValue()
            end
        end
    end
end

gg.showUiButton()

while true do
    if gg.isClickedUiButton() then
        home()
    end
    gg.sleep(100)
end

With checkbox in prompt instead, not sure why I didn't do it this way in the first place lol

Edited by BadCase
Link to comment
Share on other sites

  • 0

Well, that can work, pretty much same idea as @Enyby.  But, again, I don't have full controls haha.  User could simply press non-OK and every input past in will be lost.

I wonder, there actually lots of websites that performing login system have such a feature though.  You know, for example when you want to reload the page or go back to the previous page, there is always an alert to keep the information past in, isn't it a security issue? 🙂 Isn't the data should be erased in anyway? 🙂

For example here, when I'm commenting, ups I think I accidentally typed my password, but the server apparently stores it when I reloaded the page, haha. 🙂  And I hadn't pressed submit yet, only reloading the page.

 

Screenshot_2022-03-30-21-01-42-966_com.android.chrome.jpg

Edited by Zulfilham
Fix typo
Link to comment
Share on other sites

  • 0
On 3/25/2022 at 4:24 PM, Enyby said:

I think about prompt after press OK: "Apply data? Yes/No".

And user press "OK" always. When want apply, and want close dialog, for interact with game for look some values.

Hello, can you tell me how to decompile the GG modifier to achieve b40000 elimination so that it can scan the base address? Thank you for your trouble. I hope you can answer me. Thank you

Link to comment
Share on other sites

  • 0

[ @jesty ]
---

Quote

Hello, can you tell me how to decompile the GG modifier to achieve b40000 elimination

What do you mean by 'b4000 elimination'? Are you refering to bytes? Also what GG modifier? doesn't make sense.
---

Quote

it can scan the base address?

You can see base addresses by going into Memory viewer -> goto -> select dropdown menu (v) -> and there you go.
---

Edited by kiynox
Link to comment
Share on other sites

  • 0
On 12/30/2023 at 4:20 AM, kiynox said:

can

no like  long press have   goto pointer  right?

 

if normal data it like 00000007516421870 like this

 

but this game or app it goto pointer is B40000751621870, yes it is

 

and have b4adress it cant can search pointer  may be very big gg notsupport

 

i give you a example

 

local POINTER_TAG = 0xB4

local TAG_SHIFT = 56

 

local function addTag(pointer)

  return pointer | (POINTER_TAG << TAG_SHIFT)

end

 

local d = {'', '512'}

 

while true do

 d = gg.prompt({'Address of value in hex. E.g. BAADBEEF', 'Maximal possible offset. E.g. "100" or "100h" for hex'}, d, {'number', 'number'})

 if d == nil then

  break

 end

 

 local address = tonumber(d[1], 16)

 if address == nil then

  gg.alert('Address must be hex number')

  goto continue_1

 end

 address = addTag(address)

 local offset, hex = string.gsub(d[2], 'h', '')

 if hex == 0 then

  offset = tonumber(offset)

 else

  offset = tonumber(offset, 16)

 end

 if offset == nil then

  gg.alert('Offset must be decimal or hex number')

  goto continue_1

 end

 

 local search = (address - offset)..'~'..address

 gg.searchNumber(search, gg.TYPE_QWO RD)

 break;

 

 ::continue_1::

end。

 

 

 

it can seach b4 address but it can one by one very solwly no searchpointer faster do you now? think for you answer

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.