Jump to content
Sign in to follow this  
YeetMeister

Script Menu help (gg.prompt)

Recommended Posts

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

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

@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

 

Share this post


Link to post
Share on other sites
17 minutes ago, YeetMeister said:

bad argument #1 (nil): string expected, got nil

First argument is

 

18 minutes ago, YeetMeister said:

Result["i"]

So it is nil.

Share this post


Link to post
Share on other sites
1 hour ago, Enyby said:

First argument is

 

So it is nil.

So what i have to do? Just simply add if nil then do something else or what

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

@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).

Share this post


Link to post
Share on other sites
Posted (edited)

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Hello Creators,

Your use Chatting app ? Whatsapp or telegram ?

Can i follow your chat app

I need study make script 

Thanksyou

Share this post


Link to post
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
Sign in to follow this  

  • Similar Content

    • By Kimiice7
      help gg.prompt.lua
      Qjctx = 1
      if gg.isVisible(true) then
        gg.setVisible(false)
      end
      function main()
      n = gg.prompt({M='value1',N='value2'},nil,{'number','number'})
       if n == nil then os.exit() end
      if n.M and n.N then A()
      end
      end
      function A()
      gg.clearResults()
      gg.searchNumber(n.M..';'..n.N, gg.TYPE_DWORD)
      gg.clearResults()
      gg.alert(n.M.. '+'..n.N..'='..(n.M+n.M))
      end
      main()
      while true do
          if gg.isVisible(true) then
              gg.setVisible(false)
              Qjctx = 1
          end
          gg.sleep(100)
          if Qjctx == 1 then
              main()
          end
      end
       
      Please help me fix this
      For example i do search value1 = 4 and value2 = 4
      First search work fine..
      But when i try to do second search i got this error..
      After restarting script its work again.. And always second action got error..
       
      Thanks for your help.. 

       

    • By andrebadini
      Can anyone do a script for "Modern Air Combat: Team Match"? Reducing enemy damage to 1hp should be enough.
    • By 32132
      Need a hack for medals and stuff. Can hack; health of unit, damage and price of stuff when playing the game but unable to change the value of main currencies. It's not server based.
    • By CrewMaster
      This is basically a copy of pokemon that is removed from playstore but the server is still up.
      There is like 25+ servers right now therefore it is somehow alive.
      I am requesting a simple Energy and Fatigue hack. 
      I tried simple XOR search on the ads and bottles but no luck.
      I don't know if this kind of game is cheatable or not please let me know.

       
      APK LINK: https://apkpure.com/monster-carnival/com.qqch.hfaa.en
    • By g1doz
      Q1: How use fast freeze options in script
      Q2: if i want use gg.required but i want this to check latest version automatically, Not to write him the current version number, is this possible?
      Q3: I'm read about function make Request in gameguardian.net/help but  there is something I did not understand is how do I exchange data between script and Server For example I asked a user to enter a user name and password and this data I want to send to server and he compares them with the Database And tell him if they are true or wrong, how it is done on This function.
      Q4: For example, I want to create a script that changes the name of the player, I'm going to use the search in gg option "Text UTF-8" and after search they show me the results of the type Byte, Then I change it normally, For example, I want to show a pop-up message telling him to enter your name in the first cell and your new name in the second cell, How do I do this on Script?.
      Thanks guys for help, i really love this forum.
×
×
  • Create New...