Jump to content
Sign in to follow this  
NexusLoveYT

On Off Multi Toggle Menu Base Template

Recommended Posts

On Off Multi Toggle Menu Base Template


I don't really talk much in forums but noticed  that some ppl where still having trouble with toggle buttons and auto hide menus so i made this simple menu base template that has multi toggles.

Im in no way shape or form the best. Nor is this method the most efficient. But it is easy to understand.. i hope XD...

 

Anyway hope someone can learn from this and create something amazing one day


 

Share this post


Link to post
Share on other sites

 

Hi bro, I used your template to create an automatic script, but I am failing to hide the menu after the first time, I leave you a quick video and the script so you can help me

[added 0 minutes later]

--Local's Setup


--Add GG Calls Here
local Choice = gg.choice
local Toast = gg.toast
local IsVisible = gg.isVisible
local SetVisible = gg.setVisible
local Sleep = gg.sleep

--The Toggle
local Toggle = 1
local On = "On"
local Off = "Off"

--Hide/Show
if IsVisible(true) then
SetVisible(false)
end


--MENU
function ToggleMenu()
Menu = Choice({
"Run",
"ITEM 1",
"ITEM 2",
"Hide Menu"
}, nil, "Zedmerlol")
if menu == 1 then one() end
if menu == 2 then item1() end
if menu == 3 then item2() end
if menu == 4 then hide() end
end
Toggle =-1

function one()
gg.clearList()
gg.clearResults()
--gg.setVisible(false)
gg.setRanges(gg.REGION_ANONYMOUS)
gg.searchNumber("471,221;6,619,235;6,684,767;6,422,633;7,471,205",gg.TYPE_DWORD)
gg.searchNumber("471", gg.TYPE_DWORD)
t1 = gg.getResults(1000)
gg.addListItems(t1)
if not t1[1] then
print("Error 1")
gg.toast("Error 1")
os.exit()
end
gg.clearResults()
   

for a,b in pairs(t1)do
gg.searchNumber(t1[a].address - 8,gg.TYPE_DWORD)
t2 = gg.getResults(1000)
if not t2[30] then
gg.clearResults()
else
gg.clearResults()
--gg.addListItems(t2)
break
end
end
gg.toast("Carga Finalizada")
end
 


--Loads Menu
ToggleMenu()

function hide()
if IsVisible(true) then
SetVisible(false)
Toggle = 1
end
Sleep(100)
end

--Enables Show/Hide
while true do
if IsVisible(true) then
SetVisible(false)
Toggle = 1
end
Sleep(100)
if Toggle == 1 then
ToggleMenu()
end
end

Edited by Zedgmer

Share this post


Link to post
Share on other sites

i believe you cant just put something without understanding how the script work.

if you run the template script itself...you will know it doesnt have/need hide function in the menu.

because...you just tap cancel or any where outside the box...it will dissappear.

or at least what i thought.

Edited by zam535582

Share this post


Link to post
Share on other sites
On 11/18/2019 at 7:40 PM, Zedgmer said:

 

Hi bro, I used your template to create an automatic script, but I am failing to hide the menu after the first time, I leave you a quick video and the script so you can help me

 

[added 0 minutes later]

--Local's Setup


--Add GG Calls Here
local Choice = gg.choice
local Toast = gg.toast
local IsVisible = gg.isVisible
local SetVisible = gg.setVisible
local Sleep = gg.sleep

--The Toggle
local Toggle = 1
local On = "On"
local Off = "Off"

--Hide/Show
if IsVisible(true) then
SetVisible(false)
end


--MENU
function ToggleMenu()
Menu = Choice({
"Run",
"ITEM 1",
"ITEM 2",
"Hide Menu"
}, nil, "Zedmerlol")
if menu == 1 then one() end
if menu == 2 then item1() end
if menu == 3 then item2() end
if menu == 4 then hide() end
end
Toggle =-1

function one()
gg.clearList()
gg.clearResults()
--gg.setVisible(false)
gg.setRanges(gg.REGION_ANONYMOUS)
gg.searchNumber("471,221;6,619,235;6,684,767;6,422,633;7,471,205",gg.TYPE_DWORD)
gg.searchNumber("471", gg.TYPE_DWORD)
t1 = gg.getResults(1000)
gg.addListItems(t1)
if not t1[1] then
print("Error 1")
gg.toast("Error 1")
os.exit()
end
gg.clearResults()
   

for a,b in pairs(t1)do
gg.searchNumber(t1[a].address - 8,gg.TYPE_DWORD)
t2 = gg.getResults(1000)
if not t2[30] then
gg.clearResults()
else
gg.clearResults()
--gg.addListItems(t2)
break
end
end
gg.toast("Carga Finalizada")
end
 


--Loads Menu
ToggleMenu()

function hide()
if IsVisible(true) then
SetVisible(false)
Toggle = 1
end
Sleep(100)
end

--Enables Show/Hide
while true do
if IsVisible(true) then
SetVisible(false)
Toggle = 1
end
Sleep(100)
if Toggle == 1 then
ToggleMenu()
end
end

Sorry for late reply no wifi. But you dont need to add the function hide thing it should auto do it

[added 0 minutes later]
18 hours ago, zam535582 said:

i believe you cant just put something without understanding how the script work.

if you run the template script itself...you will know it doesnt have/need hide function in the menu.

because...you just tap cancel or any where outside the box...it will dissappear.

or at least what i thought.

Yes you are correct ty for helping out 

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

×
×
  • Create New...