FangYX Posted October 9, 2020 Posted October 9, 2020 V = gg.prompt({"Input Value"},nil,{"number"}) gg.clearResults() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber('V[1]', gg.TYPE_DWORD) resultsCount = gg.getResultCount() results = gg.getResults(resultsCount) for x = 1, resultsCount do gg.addListItems({ [1] = { address = results[x].address + 20, flags = 4, freeze = true, value = 10 } }) gg.addListItems({ [1] = { address = results[x].address + 20, flags = 4, freeze = false, value = 10 } }) end [added 1 minute later] Just now, Fathoni267 said: V = gg.prompt({"Input Value"},nil,{"number"}) gg.clearResults() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber('V[1]', gg.TYPE_DWORD) resultsCount = gg.getResultCount() results = gg.getResults(resultsCount) for x = 1, resultsCount do gg.addListItems({ [1] = { address = results[x].address + 20, flags = 4, freeze = true, value = 10 } }) gg.addListItems({ [1] = { address = results[x].address + 20, flags = 4, freeze = false, value = 10 } }) end sorry for my bad english
Lover1500 Posted October 9, 2020 Posted October 9, 2020 31 minutes ago, Fathoni267 said: V = gg.prompt({"Input Value"},nil,{"number"}) I dont know lua well but use below for more safe. V = gg.prompt({"Input Value","123"}) -- you dont need to prove number. It will auto translate to string for gg. 35 minutes ago, Fathoni267 said: gg.searchNumber('V[1]', gg.TYPE_DWORD) Dont use as string cuz V is a variable. Use gg.searchNumber(V[1], gg.TYPE_DWORD) Done!
FangYX Posted October 9, 2020 Author Posted October 9, 2020 18 minutes ago, Lover1500 said: I dont know lua well but use below for more safe. V = gg.prompt({"Input Value","123"}) -- you dont need to prove number. It will auto translate to string for gg. Dont use as string cuz V is a variable. Use gg.searchNumber(V[1], gg.TYPE_DWORD) Done! but if the value is gg.searchNumber("10;V[1]", gg.TYPE_DWORD) how to write it?
Lover1500 Posted October 9, 2020 Posted October 9, 2020 If you want to fuse with values and variable for gg script. You can use dot dot(".."). For example, "10;". .V[1] V[1]. .";10" V[1] "10;". .V[1]. .";10" So 1 hour ago, Fathoni267 said: gg.searchNumber("10;V[1]", gg.TYPE_DWORD) It will be..... second_V = "10;"..V[1] gg.searchNumber(second_V, 4) --4 is gg.TYPE_DWORD Or you can use directly without second variable gg.searchNumber("10;". .V[1], gg.TYPE_DWORD) They are the same.
FangYX Posted October 9, 2020 Author Posted October 9, 2020 41 minutes ago, Lover1500 said: If you want to fuse with values and variable for gg script. You can use dot dot(".."). For example, "10;". .V[1] V[1]. .";10" V[1] "10;". .V[1]. .";10" So It will be..... second_V = "10;"..V[1] gg.searchNumber(second_V, 4) --4 is gg.TYPE_DWORD Or you can use directly without second variable gg.searchNumber("10;". .V[1], gg.TYPE_DWORD) They are the same. thanks bro:-)
Question
FangYX
V = gg.prompt({"Input Value"},nil,{"number"})
gg.clearResults()
gg.setRanges(gg.REGION_ANONYMOUS)
gg.searchNumber('V[1]', gg.TYPE_DWORD)
resultsCount = gg.getResultCount()
results = gg.getResults(resultsCount)
for x = 1, resultsCount do
gg.addListItems({
[1] = {
address = results[x].address + 20,
flags = 4,
freeze = true,
value = 10
}
})
gg.addListItems({
[1] = {
address = results[x].address + 20,
flags = 4,
freeze = false,
value = 10
}
})
end
sorry for my bad english
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.