v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "DF2014 Talk:Bin"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Add script for emptying bins.)
 
m (Fix formatting)
 
Line 1: Line 1:
Quick script to empty bins when they are causing issues.  From [https://gist.github.com/stonetoad/11129025]
+
Quick script to empty bins when they are causing issues.  From [https://gist.github.com/stonetoad/11129025 StoneToad]
<nowiki>-- Empty a bin onto the floor
+
<nowiki>
 +
-- Empty a bin onto the floor
  
 
print('Finding selected item...')
 
print('Finding selected item...')

Latest revision as of 14:51, 5 May 2017

Quick script to empty bins when they are causing issues. From StoneToad

-- Empty a bin onto the floor

print('Finding selected item...')
a = dfhack.gui.getSelectedItem()
print('Found ', dfhack.items.getDescription(a,0))

if not a then dfhack.printerr("No item selected!")
end

loc = a.pos
-- dfhack.items.moveToGround(a,loc)

for _,k in pairs(dfhack.items.getContainedItems(a)) do
	print ('  ', dfhack.items.getDescription(k,0))
	r = dfhack.items.moveToGround(k,loc)
end

print('Done.')

--Altaree (talk) 14:46, 5 May 2017 (UTC)