ok realize I been testing this script for some time now and uhh here's two scripts that reveal the world map of hidden sites and adds an embark note marker to them to show where they are when you zoom in,
for k,v in pairs(df.global.world.world_data.sites) do
if v.type~=0 then
v.flags[0]=false
end
if v.type==2 or v.type==6 or v.type==7 or v.type==9 or v.type==10 then
Mum=df.global.world.world_data.embark_notes
Mum:insert("#",{new=true,tile=32, fg_color=12, bg_color=2, name=dfhack.TranslateName(v.name),left=v.rgn_min_x,right=v.rgn_max_x,top=v.rgn_min_y,bottom=v.rgn_max_y})
local clu2=Mum[#Mum-1]
clu2.pos.x=v.pos.x
clu2.pos.y=v.pos.y
end
end
and another for mapping out the realization buildings on big pre-gen sites which requires one to embark on top of the site first to scan the large site for realizations... it's mostly a voidfort assistant script. also this will hide the site as the embark notes seem to be under the normal site rectangle I guess in premium the visual is like transparent so this is probably not necessary but shrugs.
for k,v in pairs(df.global.world.world_data.sites) do
if v.type==1 or v.type==3 or v.type==4 or v.type==5 or v.type==10 then
if v.realization==nil then else
v.flags[0]=true
for ok,oe in pairs(v.realization.buildings) do
local regionx=math.floor(oe.min_x/47)
local regionx2=math.floor(oe.max_x/47)
local regiony=math.floor(oe.min_y/47)
local regiony2=math.floor(oe.max_y/47)
local regionmath1=math.floor((v.global_min_x+regionx)/16)
local regionmath2=math.floor((v.global_max_x+regionx2)/16)
local regionmath3=math.floor((v.global_min_y+regiony)/16)
local regionmath4=math.floor((v.global_max_y+regiony2)/16)
local globalmath1=math.floor((v.global_min_x+regionx)-(regionmath1*16))
local globalmath2=math.floor((v.global_max_x+regionx2)-(regionmath2*16))
local globalmath3=math.floor((v.global_min_y+regiony)-(regionmath3*16))
local globalmath4=math.floor((v.global_max_y+regiony2)-(regionmath4*16))
function embarknote(oe,v,regionmath1,regionmath3,globalmath1,globalmath2,globalmath3,globalmath4)
local buildcolor=oe.type
Mum=df.global.world.world_data.embark_notes
Mum:insert("#",{new=true,tile=buildcolor, fg_color=10, bg_color=5, name=dfhack.TranslateName(v.name),
left=globalmath1,
right=globalmath2,
top=globalmath3,
bottom=globalmath4})
local clu2=Mum[#Mum-1]
clu2.pos.x=regionmath1
clu2.pos.y=regionmath3
end
print (oe.type)
if oe.type~=16 then
embarknote(oe,v,regionmath1,regionmath3,globalmath1,globalmath2,globalmath3,globalmath4)
end
end
end
end
end

I have been working on an revise of the armview script where it just points at the army on march so one could embark on top of your squad... but I feel like if the player didn't set the calendar timer to 0 ticks this will just end up not working for them on top of that the squad will just march out of the new embark so you got a small window of time to mess with them.
--this script uses old dfhack code to store items on to the wagon via keyboard cursors.
--probably more stable than the other scripts that store items onto the wagon but requires it to be on the floor.
local contain={}
function getxyz() -- this will return pointers x,y and z coordinates.
local x=df.global.cursor.x
local y=df.global.cursor.y
local z=df.global.cursor.z
return x,y,z -- return the coords
end
function stuffwagon(curx,cury,curz)
for de,oe in pairs(df.global.world.buildings.all) do
if oe.name == 'Target' then
local vector=df.global.world.items.all -- load all items
for i = 0, #vector-1 do -- look into all items offsets
local curpos=vector[i].pos --get its coordinates
local cx=curpos.x
local cy=curpos.y
local cz=curpos.z
if cx==curx and cy==cury and cz==curz then --compare them
dfhack.items.moveToBuilding(vector[i],oe) --return index
end
end
end
end
end
stuffwagon(getxyz())
edit 12/28/2023 : here's a version of the wagon store script that now just stuff items into buildings if you select them with the cursor... probably if you don't have the keyboard cursor script the mining one.
this here mess could say let you stuff things that normally can't be traded into the trade depot if you name the trade depot Target.