sapientCrow wrote: ↑Wed Jul 12, 2023 7:42 am
...the Jean Bart items are numerical so they cant be found sadly. it sucks.
...Yes you can find it buried as long as it has the name ID not the number ID. No items that come from script can be found either.
The only items that cannot be found (afaik) are the ones that have been destroyed, and those that not been spawned yet from a dynamic script. Anything already in the dungeon can be found; numerical id strings can't really be used to filter the search, but one can filter a search with other object attributes besides the id.
For instance, most keys have the trait "key", and customized items usually have a custom UI name in addition to an object id.
So here, this will detect the exposed Jean Bart items:
Code: Select all
do
search_term = "Bart"
keys = {}
keyList = party:spawn("scroll").id
scroll_text = ""
for lvl = 1, Dungeon.getMaxLevels() do
for item in Dungeon.getMap(lvl):allEntities() do
if item and item.item and (item.item:getUiName():match(search_term,1) or item.name:match(search_term,1)) then
keys[#keys+1] = tostring(item.item:getUiName().." | id:"..tostring(item.id).." | found on level "..item.level.." @ tile x"..item.x..', y'..item.y)
elseif item and item.containeritem then
for k = 1, item.containeritem:getCapacity() do
local itm = item.containeritem:getItem(k)
if itm and itm.go and (itm.go.item:getUiName():match(search_term,1) or itm.go.name:match(search_term,1)) then
keys[#keys+1] = tostring(itm.go.item:getUiName().." | id:"..tostring(itm.go.id).." | found inside "..item.name.." on level "..item.level.." @ tile x"..item.x..', y'..item.y)
end
end
end
end
end
for eachKey = 1, #keys do
scroll_text = scroll_text..keys[eachKey].."\n"
end
scroll = findEntity(keyList)
if scroll then
scroll.item:setUiName("Item Cheat List")
scroll.scrollitem:setTextAlignment('left')
scroll.scrollitem:setScrollText(scroll_text)
if #scroll.scrollitem:getScrollText() == 0 then scroll:destroyDelayed() hudPrint("No Results") playSound("spell_fizzle") return
else party:spawn('blob')
end
end
if scroll and getMouseItem() == nil then
setMouseItem(scroll.item)
end
hudPrint("Found "..tostring(#keys).." items")
keys = nil
end
You can change the search_term to whatever string you want. This script searches the floor and inside of container items for anything matching the search_term in either the object.name or the uiName.
* Quick tip: After pasting the script into the console, press the <Home> key to jump to the beginning of the line. This makes it very easy to edit the search_term; press <Enter> when done, to see the results.
_________________________
This version will detect all of the keys (that have the 'key' trait):
Code: Select all
do
keys = {}
keyList = party:spawn("scroll").id
scroll_text = ""
for lvl = 1, Dungeon.getMaxLevels() do
for item in Dungeon.getMap(lvl):allEntities() do
if item and item.item and item.item:hasTrait("key") then
keys[#keys+1] = tostring(item.item:getUiName().." | id:"..tostring(item.id).." | found on level "..item.level.." @ tile x"..item.x..', y'..item.y)
elseif item and item.containeritem then
for k = 1, item.containeritem:getCapacity() do
local itm = item.containeritem:getItem(k)
if itm and itm.go and itm.go.item:hasTrait("key") then
keys[#keys+1] = tostring(itm.go.item:getUiName().." | id:"..tostring(itm.go.id).." | found inside "..item.name.." on level "..item.level.." @ tile x"..item.x..', y'..item.y)
end
end
end
end
end
for eachKey = 1, #keys do
scroll_text = scroll_text..keys[eachKey].."\n"
end
scroll = findEntity(keyList)
if scroll then
scroll.item:setUiName("Cheat List of Keys")
scroll.scrollitem:setTextAlignment('left')
scroll.scrollitem:setScrollText(scroll_text)
if #scroll.scrollitem:getScrollText() == 0 then scroll:destroyDelayed() hudPrint("No Results") playSound("spell_fizzle") return
else party:spawn('blob')
end
end
if scroll and getMouseItem() == nil then
setMouseItem(scroll.item)
end
hudPrint("Found "..tostring(#keys).." keys")
keys = nil
end
*Of course these are quite abusive cheats.