Jump to content
  • 0

Isit possible? gg.prompt that can execute function?


KarimIdris999997

Question

local input=gg.prompt({[1]="NUMBER"},{nil},{"number"})
if input==nil then return end
gg.toast(''..input[1])

I am looking foward to greatly modernize my script since it has so many menu(function) that make it hard for me to tap each of them everytime to activate cheat.

So,with the command above ,is it possible to do like this,

I put a digit number 10, then it will execute a certain function in my script.

10 for function ABC()

11 for function ABC1()

12 for function ABC2()

I dont want to write an alphabet to execute the function..I dont like it because it not smooth like in-buildt number keyboard in GG.got to trigger gboard and stuff,delaying thing.

I really hope that gameguardian community can help me with this dumb question,i really seek yours guidance and teaching to help a newbie sc maker like me.Thank you.

@MonkeySAN @CmP @ItsSC

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

47 minutes ago, KarimIdris999997 said:

I dont want to write an alphabet to execute the function..I dont like it because it not smooth like in-buildt number keyboard in GG.got to trigger gboard and stuff,delaying thing.

what do you mean by that?

and why you had to write an alphabet to execute a function?

you can use

gg.choice

to execute a function one at the time.

or

gg.multiChoice

to execute several or all functions at the same time.

example : gg.choice

--function main()
local menu = gg.choice({
    "ABC",
    "ABC1",
    "ABC2"},
  nil, "Main Menu")

if menu == nil then os.exit()
elseif
  menu == 1 then ABC()
elseif
  menu == 2 then ABC1()
elseif
  menu == 3 then ABC2()
  end
--end

IMG_20220122_201012.thumb.jpg.c3e293b959ce67589debe8ef4763cec9.jpg

Link to comment
Share on other sites

yes.

using prompt..it may seem look like kinda simple.

you dont have to write all those hacks in the script...etc : ABC, ABC1, ABC2 and so on.

still you have to write all those commands and functions.

but now you have to write an extra info guide for user on that prompt.(gg.alert)

like enter 1 for ABC, 2 for ABC1 , 3 for ABC2 and so on.

while you can just write and list all of those using gg.choice or multiChoice and user can choose whatever hack they want to execute.

instead had to remember what number will execute what hack.

Link to comment
Share on other sites

Thank You MonkeySan for your reply.

It is true that i have to remember the number to access the function also required me to write the extra command to access the menu,sure it a lot of hard work to write them all.

And for some reason this can be a good thing for a simple script where his sc has menu inside menu inside menu etc.It can be easily been executed with this method.

Btw,thx for your comment about this topic.I'm really happy to be able to get respons from another scriptor.Thx so much.

Link to comment
Share on other sites

@MonkeySAN Since this topic is talking about gg.prompt,i would like to ask bout this.

local input=gg.prompt(
  {[1]="DEFAULT","CUSTOM"},
  {nil},
  {"checkbox","number"})
if input==nil then return end
if input[1]==true then ABC() end
if tonumber(input[2]) then --[[do action]] end

When i use default it will run ABC() function as below.

function ABC()
gg.searchNumber("125",4)
end

If i put a number in input[2] then, i want it to run function ABC() too but it search the number that i put in the seekbar.

 

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.