Jump to content

Prefix Buttons (On Off)


YeetMeister

Recommended Posts

This tutorial was from @RCPOLSKI

It is similar from this one. So im just gonna post the script here

For me this method was easier to learn

Original Post by RCPOLSK

mbym = 1

on = "[✓ On] "
off = "[× Off] "
test = off

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

function main()
menu = gg.choice({
test .. "Button"
}, nil, "Menu Template")
if menu == 1
  then
    if test == off
      then
        test = on
        testFunc(true)
      else
        test = off
        testFunc(false)
    end
  end
  mbym =-1
end

function testFunc(t)
if t == true
  then
    gg.alert("Activated")
  else
    gg.alert("De-Activated")
  end
end

main()

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

I think it's a compact way of getting Prefix Buttons in your script

Prefix Tutorial.lua

Link to comment
Share on other sites

  • 9 months later...
On 8/3/2019 at 4:23 PM, YeetMeister said:

This tutorial was from @RCPOLSKI

It is similar from this one. So im just gonna post the script here

For me this method was easier to learn

Original Post by RCPOLSK


mbym = 1

on = "[✓ On] "
off = "[× Off] "
test = off

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

function main()
menu = gg.choice({
test .. "Button"
}, nil, "Menu Template")
if menu == 1
  then
    if test == off
      then
        test = on
        testFunc(true)
      else
        test = off
        testFunc(false)
    end
  end
  mbym =-1
end

function testFunc(t)
if t == true
  then
    gg.alert("Activated")
  else
    gg.alert("De-Activated")
  end
end

main()

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

I think it's a compact way of getting Prefix Buttons in your script

Prefix Tutorial.lua 687 B · 10 downloads

can you fix this for me please for on&off.

 

-- main code
gg.searchNumber("198D;1D;1D;0D;0F;0D::21", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.processResume()
gg.processResume()
gg.refineNumber("5", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

revert = gg.getResults(100, nil, nil, nil, nil, nil, nil, nil, nil)
local t = gg.getResults(100, nil, nil, nil, nil, nil, nil, nil, nil)
for i, v in ipairs(t) do
    if v.flags == gg.TYPE_DWORD then
        v.value = "99999999"
        v.freeze = true
    end
end
gg.addListItems(t)
t = nil

gg.processResume()

revert = gg.getResults(100, nil, nil, nil, nil, nil, nil, nil, nil)
local t = gg.getResults(100, nil, nil, nil, nil, nil, nil, nil, nil)
for i, v in ipairs(t) do
    if v.flags == gg.TYPE_DWORD then
        v.value = "5"
        v.freeze = true
    end
end
gg.addListItems(t)
t = nil

gg.processResume()
 

ty in advance!!

Link to comment
Share on other sites

  • 8 months later...
On 5/13/2020 at 7:52 AM, mlbb123190 said:

can you fix this for me please for on&off.

 

-- main code
gg.searchNumber("198D;1D;1D;0D;0F;0D::21", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.processResume()
gg.processResume()
gg.refineNumber("5", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

revert = gg.getResults(100, nil, nil, nil, nil, nil, nil, nil, nil)
local t = gg.getResults(100, nil, nil, nil, nil, nil, nil, nil, nil)
for i, v in ipairs(t) do
    if v.flags == gg.TYPE_DWORD then
        v.value = "99999999"
        v.freeze = true
    end
end
gg.addListItems(t)
t = nil

gg.processResume()

revert = gg.getResults(100, nil, nil, nil, nil, nil, nil, nil, nil)
local t = gg.getResults(100, nil, nil, nil, nil, nil, nil, nil, nil)
for i, v in ipairs(t) do
    if v.flags == gg.TYPE_DWORD then
        v.value = "5"
        v.freeze = true
    end
end
gg.addListItems(t)
t = nil

gg.processResume()
 

ty in advance!!

well i dont know why you use processResume so often since it doesnt even stop, also from lookingover it i dont see a problem. could you share a error or stuff like that

 

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.