Jump to content
We are investigating issues where accounts became locked on login attempt #1. Lock feature disabled for now. ×

Set the value faster!


 Share

Recommended Posts

8 minutes ago, CmP said:

Hãy thử tùy chọn này trước. Nếu nó hoạt động, bạn không nhất thiết phải thay đổi mã thêm.

it works fine man! I'm just curious about the new methods! can be said to be eager to learn🤣🤣🤣

Link to comment
Share on other sites

Alright, here is an example of function with parameter: 

-- Function to do a new search for dword value passed to the function through parameter "value"
function search(value)
  gg.clearResults()
  gg.searchNumber(value, gg.TYPE_DWORD)
end

-- Example of function usages
search("123")
search("500600")

Same way your "ModAPet" function can accept that id as parameter.

Link to comment
Share on other sites

18 minutes ago, CmP said:

Được rồi, đây là một ví dụ về hàm có tham số: 





Tương tự như cách hàm "ModAPet" của bạn có thể chấp nhận id đó làm tham số

I got it! thank you very much!

Link to comment
Share on other sites

10 hours ago, hoangninyb said:

@CmP

gg.refineNumber("2219816;6::25", gg.TYPE_DWORD)

local count = gg.getResultsCount()               

local results = gg.getResults(count)

for i, v in ipairs(results) do

  v.address = v.address + -16

end

local values = gg.getValues(results)

 

function ModAPet()

local P = gg.prompt({"🄸🄽🅂🄴🅁🅃 🄸🄳 🅅🄰🄻🅄🄴🅂\n •━━━ ✽ • ✽ ━━━•\n\nSKILL - 1","SKILL - 2","SKILL - 3"},{"9014","6014","13618"},{"number","number","number"})

 gg.clearResults()

gg.loadResults(gg.getListItems())

gg.refineNumber(IDAP, gg.TYPE_DWORD)

local count = gg.getResultsCount()

local results = gg.getResults(count)

local values = {}

for i, v in ipairs(results) do

  local index = (i - 1) * 4

  local addr = v.address

  values[index + 1] = {address = addr + 48, flags = gg.TYPE_DWORD, value = P[1], freeze = true}

  values[index + 2] = {address = addr + 64, flags = gg.TYPE_DWORD, value = P[2], freeze = true}

  values[index + 3] = {address = addr + 80, flags = gg.TYPE_DWORD, value = P[3], freeze = true}

  values[index + 4] = {address = addr + 96, flags = gg.TYPE_DWORD, value = "0", freeze = true}

end

gg.setValues(values)

gg.addListItems(values)

end

 

 

local mapping = {

[10111]={name ="🔘Jock", IDAP = "10111", func = ModAPet},

[10112]={name ="🔘Mick", IDAP = "10112", func = ModAPet},

[10113]={name ="🔘Key", IDAP = "10113", func = ModAPet},

[10114]={name ="🔘Jonseen", IDAP = "10114", func = ModAPet},

[10115]={name ="🔘Brickey", IDAP = "10115", func = ModAPet}

}

 

local menuNames = {}

local menuFunctions = {}

local menuID = {}

for i, v in ipairs(values) do

  local item = mapping[v.value]

  if item ~= nil then

    table.insert(menuNames, item.name)

    table.insert(menuFunctions, item.func)

    table.insert(menuID, item.IDAP)

  end

end

 

local choice = gg.choice(menuNames)

if choice ~= nil then

  menuFunctions[choice]()

end

 

@CmP is it possible to add a search value to the name?

i searched with 2219816;6::25

if 2219816 and v.address = v.address + -16 the value is 10111 then name ="Jock 2219816"

Or if 6 and v.address = v.address + -16 the value is 10111 then name = "Jock 6"

Can you do that?

Edited by hoangninyb
Link to comment
Share on other sites

16 hours ago, hoangninyb said:

is it possible to add a search value to the name?

Yes, use string concatenation. For example: 

local str1 = "Value " .. "123" -- "Value 123"
local str2 = 456 .. " value" -- "456 value"
print(str1 .. str2) -- "Value 123456 value"
Link to comment
Share on other sites

1 hour ago, CmP said:

Có, sử dụng nối chuỗi. Ví dụ: 

    
     

i did like this and it works!

 

gg.refineNumber("2219816", gg.TYPE_DWORD)

 

local count = gg.getResultsCount()               

 

local results = gg.getResults(count)

 

for i, v in ipairs(results) do

 

  v.address = v.address + -16

 

end

 

local values_1 = gg.getValues(results)

 

gg.refineNumber("6", gg.TYPE_DWORD)

 

local count = gg.getResultsCount()               

 

local results = gg.getResults(count)

 

for i, v in ipairs(results) do

 

  v.address = v.address + -16

 

end

 

local values_2 = gg.getValues(results)

 

 

 

function ModAPet()

 

local P = gg.prompt({"🄸🄽🅂🄴🅁🅃 🄸🄳 🅅🄰🄻🅄🄴🅂\n •━━━ ✽ • ✽ ━━━•\n\nSKILL - 1","SKILL - 2","SKILL - 3"},{"9014","6014","13618"},{"number","number","number"})

 

 gg.clearResults()

 

gg.loadResults(gg.getListItems())

 

gg.refineNumber(IDAP, gg.TYPE_DWORD)

 

local count = gg.getResultsCount()

 

local results = gg.getResults(count)

 

local values = {}

 

for i, v in ipairs(results) do

 

  local index = (i - 1) * 4

 

  local addr = v.address

 

  values[index + 1] = {address = addr + 48, flags = gg.TYPE_DWORD, value = P[1], freeze = true}

 

  values[index + 2] = {address = addr + 64, flags = gg.TYPE_DWORD, value = P[2], freeze = true}

 

  values[index + 3] = {address = addr + 80, flags = gg.TYPE_DWORD, value = P[3], freeze = true}

 

  values[index + 4] = {address = addr + 96, flags = gg.TYPE_DWORD, value = "0", freeze = true}

 

end

 

gg.setValues(values)

 

gg.addListItems(values)

 

end

 

 

 

 

 

local mapping = {

 

[10111]={name_1 ="Jock 2219816", name_2 ="Jock 6", IDAP = "10111", func = ModAPet},

 

[10112]={name_1 ="Mick 2219816", name_2 ="Mick 6", IDAP = "10112", func = ModAPet},

 

[10113]={name_1 ="Key 2219816", name_2 ="Key 6", IDAP = "10113", func = ModAPet},

 

[10114]={name_1 ="Jonseen 2219816", name_2 ="Jonseen 6", IDAP = "10114", func = ModAPet},

 

[10115]={name_1 ="Brickey 2219816", name_2 ="Brickey 6", IDAP = "10115", func = ModAPet}

 

}

 

 

 

local menuNames = {}

 

local menuFunctions = {}

 

local menuID = {}

for i, v in ipairs(values_1) do

 

  local item = mapping[v.value]

 

  if item ~= nil then

 

    table.insert(menuNames, item.name_2)

 

    table.insert(menuFunctions, item.func)

 

    table.insert(menuID, item.IDAP)

 

  end

 

end

for i, v in ipairs(values_1) do

  local item = mapping[v.value]

  if item ~= nil then

    table.insert(menuNames, item.name_1)

    table.insert(menuFunctions, item.func)

    table.insert(menuID, item.IDAP)

  end

end

for i, v in ipairs(values_2) do

 

  local item = mapping[v.value]

 

  if item ~= nil then

 

    table.insert(menuNames, item.name_2)

 

    table.insert(menuFunctions, item.func)

 

    table.insert(menuID, item.IDAP)

 

  end

 

end

 

 

 

local choice = gg.choice(menuNames)

 

if choice ~= nil then

 

  menuFunctions[choice]()

 

end

12 minutes ago, hoangninyb said:

i did like this and it works!

 

gg.refineNumber("2219816", gg.TYPE_DWORD)

 

local count = gg.getResultsCount()               

 

local results = gg.getResults(count)

 

for i, v in ipairs(results) do

 

  v.address = v.address + -16

 

end

 

local values_1 = gg.getValues(results)

 

gg.refineNumber("6", gg.TYPE_DWORD)

 

local count = gg.getResultsCount()               

 

local results = gg.getResults(count)

 

for i, v in ipairs(results) do

 

  v.address = v.address + -16

 

end

 

local values_2 = gg.getValues(results)

 

 

 

function ModAPet()

 

local P = gg.prompt({"🄸🄽🅂🄴🅁🅃 🄸🄳 🅅🄰🄻🅄🄴🅂\n •━━━ ✽ • ✽ ━━━•\n\nSKILL - 1","SKILL - 2","SKILL - 3"},{"9014","6014","13618"},{"number","number","number"})

 

 gg.clearResults()

 

gg.loadResults(gg.getListItems())

 

gg.refineNumber(IDAP, gg.TYPE_DWORD)

 

local count = gg.getResultsCount()

 

local results = gg.getResults(count)

 

local values = {}

 

for i, v in ipairs(results) do

 

  local index = (i - 1) * 4

 

  local addr = v.address

 

  values[index + 1] = {address = addr + 48, flags = gg.TYPE_DWORD, value = P[1], freeze = true}

 

  values[index + 2] = {address = addr + 64, flags = gg.TYPE_DWORD, value = P[2], freeze = true}

 

  values[index + 3] = {address = addr + 80, flags = gg.TYPE_DWORD, value = P[3], freeze = true}

 

  values[index + 4] = {address = addr + 96, flags = gg.TYPE_DWORD, value = "0", freeze = true}

 

end

 

gg.setValues(values)

 

gg.addListItems(values)

 

end

 

 

 

 

 

local mapping = {

 

[10111]={name_1 ="Jock 2219816", name_2 ="Jock 6", IDAP = "10111", func = ModAPet},

 

[10112]={name_1 ="Mick 2219816", name_2 ="Mick 6", IDAP = "10112", func = ModAPet},

 

[10113]={name_1 ="Key 2219816", name_2 ="Key 6", IDAP = "10113", func = ModAPet},

 

[10114]={name_1 ="Jonseen 2219816", name_2 ="Jonseen 6", IDAP = "10114", func = ModAPet},

 

[10115]={name_1 ="Brickey 2219816", name_2 ="Brickey 6", IDAP = "10115", func = ModAPet}

 

}

 

 

 

local menuNames = {}

 

local menuFunctions = {}

 

local menuID = {}

for i, v in ipairs(values_1) do

 

  local item = mapping[v.value]

 

  if item ~= nil then

 

    table.insert(menuNames, item.name_2)

 

    table.insert(menuFunctions, item.func)

 

    table.insert(menuID, item.IDAP)

 

  end

 

end

 

for i, v in ipairs(values_2) do

 

  local item = mapping[v.value]

 

  if item ~= nil then

 

    table.insert(menuNames, item.name_2)

 

    table.insert(menuFunctions, item.func)

 

    table.insert(menuID, item.IDAP)

 

  end

 

end

 

 

 

local choice = gg.choice(menuNames)

 

if choice ~= nil then

 

  menuFunctions[choice]()

 

end

@CmP For example, the menu above is menu A and I have another menu B, can I transfer the data of menu A to menu B?  only the data selected in menu A will appear in menu B!

Edited by hoangninyb
Link to comment
Share on other sites

@CmP

For example, the menu above is menu A and I have another menu B, can I transfer the data of menu A to menu B? only the data selected in menu A will appear in menu B!

and how to not get error when i click cancel in prompt

Edited by hoangninyb
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.