Jump to content
  • 0

NEED Help With Multi Prompt Search


XenClanad

Question

Been trying to fix this function with multi prompt search funtiom but i just can't figure out what's wrong so here the script funtion:

 

function hack2()

  gg.alert("𝗣𝗹𝗲𝗮𝘀𝗲 𝗶𝗻𝗽𝘂𝘁 𝟯 +𝗦𝘁𝗮𝘁 𝘃𝗮𝗹𝘂𝗲")

  gg.sleep(2000)

  local s = gg.prompt({[1] = "HP", [2] = "ATK", [3] = "DEF"},nill,{[1] = "number"},{[2] = "number"},{[3] = "number"})

  if s == nil then gg.alert(" 🚫 𝗖𝗔𝗡𝗖𝗘𝗟𝗟𝗘𝗗 🚫") START() end

  gg.searchNumber(""..s[1]..'..s[2]..'..s[3]..":9", gg.TYPE_DWORD)

  local t = gg.getResults(6)

  if t >== 6 then gg.alert("🚫 𝗩𝗮𝗹𝘂𝗲 𝗜𝗻𝗽𝘂𝘁 𝗡𝗼𝘁 𝗙𝗼𝘂𝗻𝗱 🚫\n 𝗣𝗹𝗲𝗮𝘀𝗲 𝗧𝗿𝘆 𝗔𝗴𝗮𝗶𝗻") START() end

  local stat = t

  for i,v in pairs(t) do

  stat[i].value = " 999999"

  stat[i].freeze = true

  end

  gg.addListItems(stat)

  gg.toast("✅ Active ✅")

  gg.clearResults()

end

 

So here i want to make a multiple input number prompt with a name hp,def,and atk and then use that number and input it in search number like 120;30;20:9 at first it work but when it search number it change to 1;2;3:9 so im using (""..s[1]..') function at first it kinda work since the search was change to 120;2;3:9 but when im using 3 number from prompt it doesn't work. Been reading class reference but couldn't figure it out.

And i don't know why

if t <= 6 then gg.alert("🚫 𝗩𝗮𝗹𝘂𝗲 𝗜𝗻𝗽𝘂𝘁 𝗡𝗼𝘁 𝗙𝗼𝘂𝗻𝗱 🚫\n 𝗣𝗹𝗲𝗮𝘀𝗲 𝗧𝗿𝘆 𝗔𝗴𝗮𝗶𝗻") START() end

Doesn't work? What i want to do here is to see if the result was more than 6 then it would initiate error and stop the script but it got an error attempt to compare number to table.

And i don't know why function keep running

  if s == nil then gg.alert(" 🚫 𝗖𝗔𝗡𝗖𝗘𝗟𝗟𝗘𝗗 🚫") START() end

even tough the warning alert was appear (CANCELLED) but there's an active message making script crashing.

I don't know if im explain it right but i hope you could understand and help me with this and could point my mistake.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

16 hours ago, XenClanad said:

And i don't know why function keep running

  if s == nil then gg.alert(" 🚫 𝗖𝗔𝗡𝗖𝗘𝗟𝗟𝗘𝗗 🚫") START() end

even tough the warning alert was appear (CANCELLED) but there's an active message making script crashing.

I don't know if im explain it right but i hope you could understand and help me with this and could point my mistake.

Well maybe the problem in function START() Not in function hack2() 😐

If the code's that MonkeySAN didn't work then the problem in function START

 

Link to comment
Share on other sites

On 2/5/2023 at 2:20 PM, XenClanad said:

Been trying to fix this function with multi prompt search funtiom but i just can't figure out what's wrong so here the script funtion:

the if t >== 6 condition is incorrect. The correct condition should be if #t >= 6, which checks if the number of elements in t is greater than or equal to 6.

The start() function is not already defined so it must be defined

and I think the for loop is not necessary anyway gg.addListItems(t) will add them all.

 

Like this

function hack2()
  gg.alert("Please input 3 values")
  gg.sleep(2000)
  local s = gg.prompt({[1] = "HP", [2] = "ATK", [3] = "DEF"}, nil, {"number", "number", "number"})
  if s == nil then 
    gg.alert("Cancelled")
    return
  end
  gg.searchNumber(s[1] .. s[2] .. s[3], gg.TYPE_DWORD)
  local t = gg.getResults(6)
  if #t < 6 then
    gg.alert("Values not found\nPlease try again")
    return
  end
  local stat = {}
  for i,v in pairs(t) do
    stat[i] = {address = v.address, value = 999999, freeze = true}
  end
  gg.addListItems(stat)
  gg.toast("Active")
  gg.clearResults()
end

 

 

 

 

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.