Jump to content
  • 0

Script Menu help (gg.prompt)


YeetMeister
 Share

Question

So i am making a "Private" script menu for a friend so he gets into hacking too.

 

But i dont know how to solve this problem

 

I hope you get my Idea xD

 

UI = 1

if gg.isVisible(true) then
  gg.setVisible(false)
end

CustomFoV = result[4]


--
function main()
gg.alert("{Press 'OK' to activate Hacks}\nthis hack Contains:\n~NoRecoil\n~Bigger Hitbox\n~FoV")
Result = gg.prompt({"No Recoil","Bigger Hitbox", "FoV","Custom FoV(Needed if checked)\nSelect a number between 150 and 360"},nil,{"checkbox", "checkbox","checkbox","number"})
if result[1] then NoRecoil() end
if result[2] then BigHitbox() end
if result[3] then FoV() end
if result[4] == FoV() then CustomFoV end
UI =-1
end

--
function NoRecoil()

end

function BigHitbox()

end

function FoV()

end
--
function exit()
gg.toast("This script is made by \nஜ۩۩ஜ[K/D Destroyer]ஜ۩۩ஜ \nPrivate script made for wifi-iwnl")
print("This script is made by \nஜ۩۩ஜ[K/D Destroyer]ஜ۩۩ஜ \nPrivate script made for wifi-iwnl")
os.exit()
end
--

main()

while true do
    if gg.isVisible(true) then
        gg.setVisible(false)
        UI = 1
    end
    gg.sleep(100)
	if UI == 1 then
		main()
	end
end

 

Link to comment
Share on other sites

Recommended Posts

  • 0
1 minute ago, YeetMeister said:

I hope you get my Idea xD

You need to explain that "idea" using words and not just drop some block of code. Noone here can read your thoughts. Moreover, quality of question/problem explanation affects receiving (or not receiving) answers more than anything else.

Link to comment
Share on other sites

  • 0
2 hours ago, CmP said:

You need to explain that "idea" using words and not just drop some block of code. Noone here can read your thoughts. Moreover, quality of question/problem explanation affects receiving (or not receiving) answers more than anything else.

Im sorry xD i was in hurry

Uhm what i wanted to do is a hack with gg.prompt() with checkboxes if they checked they will be executed if not then not BASIC IK

 

But theres another function with custom FOV (so if i check FoV i need to put in the value i want to set it to)

Is this explained better for you?

Link to comment
Share on other sites

  • 0
2 hours ago, CmP said:

You need to explain that "idea" using words and not just drop some block of code. Noone here can read your thoughts. Moreover, quality of question/problem explanation affects receiving (or not receiving) answers more than anything else.

 

Like this

So if FoV is checked then it will need the custom number for that

Screenshot_20190106-015923_Quoda.jpg

Link to comment
Share on other sites

  • 0

@Enyby why is this not working? Can you please help me in confused ._.

Ive tried it like this now but i get an error

Quote

Script ended:
Script error: org.luaj.vm2.LuaError: @/storage/emulated/0/Download/PrivateHack/Private Hack.lua:32
`gg.searchNumber(Result["i"], gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)`
bad argument #1 (nil): string expected, got nil
level = 1, pc = 17
stack traceback:
    /storage/emulated/0/Download/PrivateHack/Private Hack.lua:32 in function 'FoV'
    /storage/emulated/0/Download/PrivateHack/Private Hack.lua:16 in function 'main'
    /storage/emulated/0/Download/PrivateHack/Private Hack.lua:46 in main chunk
    [Java]: in ?
    at org.luaj.vm2.Varargs.argerr(Varargs.java:282)
    at org.luaj.vm2.Varargs.checkjstring(Varargs.java:347)
    at android.ext.Script$searchNumber.invokeUi(Script.java:2801)
    at android.ext.Script$ApiFunction.run(Script.java:1181)
    at android.os.Handler.handleCallback(Unknown Source:2)
    at android.os.Handler.dispatchMessage(Unknown Source:4)
    at android.os.Looper.loop(Unknown Source:139)
    at android.app.ActivityThread.main(Unknown Source:146)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Unknown Source:11)
    at com.android.internal.os.ZygoteInit.main(Unknown Source:198)

And this is the "code"

Quote

UI = 1

if gg.isVisible(true) then
  gg.setVisible(false)
end


--
function main()
gg.alert("{Press 'OK' to activate Hacks}\nthis hack Contains:\n~NoRecoil\n~Bigger Hitbox\n~FoV")
Result = gg.prompt({"No Recoil","Bigger Hitbox", "FoV","Custom FoV(Needed if checked)\nSelect a number between 150 and 360"},nil,{"checkbox", "checkbox","checkbox",i = "0"})
if Result[1] then NoRecoil() end
if Result[2] then BigHitbox() end
if Result[3] then FoV() end
if Result[4] then FoV() end
UI =-1
end

--
function NoRecoil()

end

function BigHitbox()

end

function FoV()
gg.setRanges(gg.REGION_CODE_APP)
gg.searchNumber(Result["i"], gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
local r = gg.getResults(45)
gg.removeResults(r)
gg.getResults(1)
gg.editAll("222", gg.TYPE_FLOAT)
end
--
function exit()
gg.toast("This script is made by \nஜ۩۩ஜ[K/D Destroyer]ஜ۩۩ஜ \nPrivate script made for wifi-iwnl")
print("This script is made by \nஜ۩۩ஜ[K/D Destroyer]ஜ۩۩ஜ \nPrivate script made for wifi-iwnl")
os.exit()
end
--

main()

while true do
    if gg.isVisible(true) then
        gg.setVisible(false)
        UI = 1
    end
    gg.sleep(100)
    if UI == 1 then
        main()
    end
end

 

Link to comment
Share on other sites

  • 0
  • Administrators

Too complicated to explain. And I do not know what you want.

In general you need learn how to code.

This is something as try explain to a blind how an elephant look like.

I think You need Result[4] as first param. Maybe it wrong. You must know better.

Link to comment
Share on other sites

  • 0

OMG after i watched the code i have to recode that again

COMPLETELY messed up.

 

UI = 1

if gg.isVisible(true) then
  gg.setVisible(false)
end


--
function main()
gg.alert("{Press 'OK' to activate Hacks}\nthis hack Contains:\n~NoRecoil\n~Bigger Hitbox\n~FoV")
Result = gg.prompt({"No Recoil","Bigger Hitbox", "FoV","Custom FoV(Needed if checked)\nSelect a number between 150 and 360"},{false,false,false,0},{"checkbox", "checkbox","checkbox","number"})
if Result[1] then NoRecoil() end
if Result[2] then BigHitbox() end
if Result[3] and Result[4] then FoV() end
UI =-1
end

--
function NoRecoil()

end

function BigHitbox()

end

function FoV()
gg.setRanges(gg.REGION_CODE_APP)
gg.searchNumber(Result[4], gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
local r = gg.getResults(45)
gg.removeResults(r)
gg.getResults(1)
gg.editAll("222", gg.TYPE_FLOAT)
end
--
function exit()
gg.toast("This script is made by \nஜ۩۩ஜ[K/D Destroyer]ஜ۩۩ஜ \nPrivate script made for wifi-iwnl")
print("This script is made by \nஜ۩۩ஜ[K/D Destroyer]ஜ۩۩ஜ \nPrivate script made for wifi-iwnl")
os.exit()
end
--

main()

while true do
    if gg.isVisible(true) then
        gg.setVisible(false)
        UI = 1
    end
    gg.sleep(100)
    if UI == 1 then
        main()
    end
end

 

_______________________________________________
added 0 minutes later

That should work i havn't test it yet

Link to comment
Share on other sites

  • 0

Also that "UI" variable is redundant in your case. Don't use something just because others do it.

Your main loop can be rewritten this way:

while true do
  if gg.isVisible() then
    gg.setVisible(false)
    main()
  end
  gg.sleep(100)
end

 

Link to comment
Share on other sites

  • 0
1 hour ago, CmP said:

Also that "UI" variable is redundant in your case. Don't use something just because others do it.

Your main loop can be rewritten this way:


while true do
  if gg.isVisible() then
    gg.setVisible(false)
    main()
  end
  gg.sleep(100)
end

 

As @CmP said,so i rewrite the code again to you.

 

gg.setVisible(false)

--
function main()
gg.alert("{Press 'OK' to activate Hacks}\nthis hack Contains:\n~NoRecoil\n~Bigger Hitbox\n~FoV")
Result = gg.prompt({"No Recoil","Bigger Hitbox", "FoV","Custom FoV(Needed if checked)\nSelect a number between 150 and 360"},{false,false,false,0},{"checkbox", "checkbox","checkbox","number"})
if Result[1] then NoRecoil() end
if Result[2] then BigHitbox() end
if Result[3] and Result[4] then FoV() end
UI =-1
end

--
function NoRecoil()

end

function BigHitbox()

end

function FoV()
gg.setRanges(gg.REGION_CODE_APP)
gg.searchNumber(Result[4], gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
local r = gg.getResults(45)
gg.removeResults(r)
gg.getResults(1)
gg.editAll("222", gg.TYPE_FLOAT)
end
--

function exit()
gg.toast("This script is made by \nஜ۩۩ஜ[K/D Destroyer]ஜ۩۩ஜ \nPrivate script made for wifi-iwnl")
print("This script is made by \nஜ۩۩ஜ[K/D Destroyer]ஜ۩۩ஜ \nPrivate script made for wifi-iwnl")
os.exit()
end
while true do
if gg.isVisible(true) then gg.setVisible(false) main() else gg.sleep(100) end
end

Also watch out for invisible symbol cause of BB code

Link to comment
Share on other sites

  • 0

@noblack, you forgot to delete the line

3 minutes ago, noblack said:

UI =-1

in function "main".

Also isVisible function does not accept arguments, so that "true" in this line

6 minutes ago, noblack said:

if gg.isVisible(true) then gg.setVisible(false) main() else gg.sleep(100) end

is redundant. Moreover, this only works because of how Lua deals with extra arguments.

From the Lua 5.3 reference manual (https://www.lua.org/manual/5.3/manual.html#3.4.11) :

Spoiler

Parameters act as local variables that are initialized with the argument values:


	parlist ::= namelist [‘,’ ‘...’] | ‘...

When a function is called, the list of arguments is adjusted to the length of the list of parameters, unless the function is a vararg function, which is indicated by three dots ('...') at the end of its parameter list. A vararg function does not adjust its argument list; instead, it collects all extra arguments and supplies them to the function through a vararg expression, which is also written as three dots. The value of this expression is a list of all actual extra arguments, similar to a function with multiple results. If a vararg expression is used inside another expression or in the middle of a list of expressions, then its return list is adjusted to one element. If the expression is used as the last element of a list of expressions, then no adjustment is made (unless that last expression is enclosed in parentheses).

As an example, consider the following definitions:


     function f(a, b) end
     function g(a, b, ...) end
     function r() return 1,2,3 end

Then, we have the following mapping from arguments to parameters and to the vararg expression:


     CALL            PARAMETERS
     
     f(3)             a=3, b=nil
     f(3, 4)          a=3, b=4
     f(3, 4, 5)       a=3, b=4
     f(r(), 10)       a=1, b=10
     f(r())           a=1, b=2
     
     g(3)             a=3, b=nil, ... -->  (nothing)
     g(3, 4)          a=3, b=4,   ... -->  (nothing)
     g(3, 4, 5, 8)    a=3, b=4,   ... -->  5  8
     g(5, r())        a=5, b=1,   ... -->  2  3

Another thing is that value returned by "prompt" function needs to be checked (because the dialog may be cancelled, in some cases accidentally) as well as value that is stored in "Result[4]", but I suggest you to leave these improvements to be done by the author of the topic (if he needs them at all).

Link to comment
Share on other sites

  • 0

For more easy menu implementation, use Menu Template.. Change MyMenu to this ..

MyMenu = {
	"Main Menu", -- Menu Title
	"No Recoil", function()
    -- When "No Recoil" clicked, this function will be executed.
		gg.alert("No Recoil Activated !") 
  	end,
    "Bigger Hitbox", function()
    -- When "Bigger Hitbox" clicked, this function will be executed.
		gg.alert("Bigger Hitbox Activated !") 
  	end,
	"Custom FOV", function()
    -- When "Custom FOV" clicked, this function will be executed.
    	Input = gg.prompt({"Please input custom FOV Value: "}, {cFOV}, {"number"})
		if Input ~= nil then
			InputtedFOV = Input[1]
      		gg.alert("Changed FOV to "..InputtedFOV)
		end
  	end
}


Example: Template_v2.0.lua

Edited by saiaapiz
Added example.
Link to comment
Share on other sites

  • 0
5 hours ago, saiaapiz said:

For more easy menu implementation, use Menu Template.. Change MyMenu to this ..


MyMenu = {
	"Main Menu", -- Menu Title
	"No Recoil", function()
    -- When "No Recoil" clicked, this function will be executed.
		gg.alert("No Recoil Activated !") 
  	end,
    "Bigger Hitbox", function()
    -- When "Bigger Hitbox" clicked, this function will be executed.
		gg.alert("Bigger Hitbox Activated !") 
  	end,
	"Custom FOV", function()
    -- When "Custom FOV" clicked, this function will be executed.
    	Input = gg.prompt({"Please input custom FOV Value: "}, {cFOV}, {"number"})
		if Input ~= nil then
			InputtedFOV = Input[1]
      		gg.alert("Changed FOV to "..InputtedFOV)
		end
  	end
}


Example: Template_v2.0.lua

 

Emm...

You know,if you don't know how to use lua. Even starter can't understanad this.

And i just used a few minutes to know how this works.

Why don't i just use the official one?

There's are pros,loss tho.

Link to comment
Share on other sites

  • 0
On 1/7/2019 at 6:22 PM, Anggi619 said:

Hello Creators,

Your use Chatting app ? Whatsapp or telegram ?

Can i follow your chat app

I need study make script 

Thanksyou

I learn code 

alone

and "thanks" @Enyby for some "advice" and force me to learn by myself.

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.