Hi, so the script is missing some algorithm. And i dunno how to apply it.
When searching for UTF16 string, the script must know how many times the string has been found. Currently i use refine on the 3 first chars of the string, then i refine the first and count how much results i have left. But refine only works in the perfect scenario. But if i had a string like "BoomBoom" the refine would be useless.
How to apply the proper algorithm so that i dont have to use refine to know how many times the string was found?
Here is the script:
function setNewName()local t = gg.getResults(gg.getResultsCount())local replaceString ={}local stringSize ={}local str ={}
gg.clearResults()for i=1,#editname[1]do
str[i]= string.sub(editname[1], i, j)endfor i, v in ipairs(t)do
stringSize[#stringSize +1]={address = t[i].address -0x4, flags = gg.TYPE_WORD, value =#editname[1]}for charCount =1,#editname[1]do
replaceString[#replaceString +1]={address = t[i].address, flags = gg.TYPE_WORD, value = string.byte(string.sub(str[charCount],1,1))}
t[i].address = t[i].address +2endend
gg.setValues(replaceString)
gg.setValues(stringSize)endfunction findName()
gg.setRanges(gg.REGION_ANONYMOUS)
gg.searchNumber(';'..playername[1])local a = gg.getResults(gg.getResultsCount())if#a ==0then
gg.toast("name not found, search again")
prompt_search()else
gg.refineNumber(a[1].value..';'..a[2].value..';'..a[3].value..'::5')
gg.refineNumber(a[1].value)endend-- if menu is nilfunction noselect()
gg.toast('You not select anything')endfunction prompt_edit()
editname = gg.prompt({[1]='Input name to modify to'},{[1]='0'},{[1]='text'})if editname ==nilthen noselect()else
setNewName()endendfunction prompt_search()
playername = gg.prompt({[1]='Input desired player name.'},{[1]='0'},{[1]='text'})if playername ==nilthen
noselect()else
findName()
prompt_edit()endend
prompt_search()while(true)doif gg.isVisible()then
gg.setVisible(false)
prompt_search()end
gg.sleep(100)end
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.
Question
Platonic
Hi, so the script is missing some algorithm. And i dunno how to apply it.
When searching for UTF16 string, the script must know how many times the string has been found. Currently i use refine on the 3 first chars of the string, then i refine the first and count how much results i have left. But refine only works in the perfect scenario. But if i had a string like "BoomBoom" the refine would be useless.
How to apply the proper algorithm so that i dont have to use refine to know how many times the string was found?
Here is the script:
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.