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.
Editing User:Fleeting Frames/cposchange
Jump to navigation
Jump to search
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | Save as cposchange.lua into /hack/scripts folder: | + | Save as cposchange.lua into /hack/scripts folder (sorry about the code tag eating spacing and linebreaks): |
− | < | + | <pre> |
--[==[Waits for a cart to move (or return with flip) and pauses --]==] | --[==[Waits for a cart to move (or return with flip) and pauses --]==] | ||
local args = {...} | local args = {...} | ||
Line 15: | Line 15: | ||
function() | function() | ||
if((minecart.pos.x == cx) and (minecart.pos.y == cy) and (minecart.pos.z == cz)) then | if((minecart.pos.x == cx) and (minecart.pos.y == cy) and (minecart.pos.z == cz)) then | ||
− | + | dfhack.run_command('fpause') print("Minecart " .. minecart.vehicle_id .. " moved back into " .. cx .. " " .. cy .. " " .. cz .. " in " .. (df.global.cur_year_tick-nr) .. " steps.") | |
else rwait(nr, minecart, cx, cy, cz) end | else rwait(nr, minecart, cx, cy, cz) end | ||
end ) | end ) | ||
Line 33: | Line 33: | ||
function() | function() | ||
if((minecart.pos.x ~= cx) or (minecart.pos.y ~= cy) or (minecart.pos.z ~= cz)) then | if((minecart.pos.x ~= cx) or (minecart.pos.y ~= cy) or (minecart.pos.z ~= cz)) then | ||
− | + | dfhack.run_command('fpause') print("Minecart " .. minecart.vehicle_id .. " moved in " .. (df.global.cur_year_tick-nr) .. " steps.") | |
else mwait(nr, minecart, cx, cy, cz) end | else mwait(nr, minecart, cx, cy, cz) end | ||
end ) | end ) | ||
Line 43: | Line 43: | ||
mwait(df.global.cur_year_tick,cart, (cart.pos.x +1 -1), (cart.pos.y +1 -1), (cart.pos.z +1 -1)) | mwait(df.global.cur_year_tick,cart, (cart.pos.x +1 -1), (cart.pos.y +1 -1), (cart.pos.z +1 -1)) | ||
end | end | ||
− | </ | + | </pre> |