|
|
@ -1,11 +1,11 @@
|
|
|
|
tools={}
|
|
|
|
tools={}
|
|
|
|
tools.menu=MakeMenu()
|
|
|
|
tools.menu=MakeMenu()
|
|
|
|
function tools.setrace()
|
|
|
|
function tools.setrace()
|
|
|
|
RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
|
|
|
|
RaceTable=BuildNameTable()
|
|
|
|
print("Your current race is:"..GetRaceToken(df.ui.race_id))
|
|
|
|
print("Your current race is:"..GetRaceToken(df.ui.race_id))
|
|
|
|
print("Type new race's token name in full caps (q to quit):")
|
|
|
|
print("Type new race's token name in full caps (q to quit):")
|
|
|
|
repeat
|
|
|
|
repeat
|
|
|
|
entry=io.stdin:read()
|
|
|
|
entry=getline()
|
|
|
|
if entry=="q" then
|
|
|
|
if entry=="q" then
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -20,7 +20,7 @@ function tools.GiveSentience(names) --TODO make pattern...
|
|
|
|
ids={}
|
|
|
|
ids={}
|
|
|
|
print("Type race's token name in full caps to give sentience to:")
|
|
|
|
print("Type race's token name in full caps to give sentience to:")
|
|
|
|
repeat
|
|
|
|
repeat
|
|
|
|
entry=io.stdin:read()
|
|
|
|
entry=getline()
|
|
|
|
id=RaceTable[entry]
|
|
|
|
id=RaceTable[entry]
|
|
|
|
until id~=nil
|
|
|
|
until id~=nil
|
|
|
|
table.insert(ids,id)
|
|
|
|
table.insert(ids,id)
|
|
|
@ -107,7 +107,7 @@ function tools.getCreatureId(vector)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
print("=====================================")
|
|
|
|
print("=====================================")
|
|
|
|
print("type in name or number:")
|
|
|
|
print("type in name or number:")
|
|
|
|
r=io.stdin:read()
|
|
|
|
r=getline()
|
|
|
|
if tonumber(r) ==nil then
|
|
|
|
if tonumber(r) ==nil then
|
|
|
|
indx=rnames[r]
|
|
|
|
indx=rnames[r]
|
|
|
|
if indx==nil then return end
|
|
|
|
if indx==nil then return end
|
|
|
@ -125,7 +125,7 @@ function tools.change_adv()
|
|
|
|
tval=vector:getval(0)
|
|
|
|
tval=vector:getval(0)
|
|
|
|
vector:setval(0,vector:getval(indx))
|
|
|
|
vector:setval(0,vector:getval(indx))
|
|
|
|
vector:setval(indx,tval)
|
|
|
|
vector:setval(indx,tval)
|
|
|
|
r=io.stdin:read()
|
|
|
|
r=getline()
|
|
|
|
if r=='q' then
|
|
|
|
if r=='q' then
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -153,7 +153,7 @@ function tools.MakeFollow()
|
|
|
|
lfollow=engine.peek(vector:getval(indx)+ptr_Creature.followID.off,DWORD)
|
|
|
|
lfollow=engine.peek(vector:getval(indx)+ptr_Creature.followID.off,DWORD)
|
|
|
|
if lfollow ~=0xFFFFFFFF then
|
|
|
|
if lfollow ~=0xFFFFFFFF then
|
|
|
|
print("Already following, unfollow? y/N")
|
|
|
|
print("Already following, unfollow? y/N")
|
|
|
|
r=io.stdin:read()
|
|
|
|
r=getline()
|
|
|
|
if r== "y" then
|
|
|
|
if r== "y" then
|
|
|
|
engine.poke(vector:getval(indx)+ptr_Creature.followID.off,DWORD,0)
|
|
|
|
engine.poke(vector:getval(indx)+ptr_Creature.followID.off,DWORD,0)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -165,7 +165,7 @@ tools.menu:add("Make creature follow",tools.MakeFollow)
|
|
|
|
function tools.runscript(files)
|
|
|
|
function tools.runscript(files)
|
|
|
|
if files==nil then
|
|
|
|
if files==nil then
|
|
|
|
files={}
|
|
|
|
files={}
|
|
|
|
table.insert(files,io.stdin:read())
|
|
|
|
table.insert(files,getline())
|
|
|
|
end
|
|
|
|
end
|
|
|
|
for _,v in pairs(files) do
|
|
|
|
for _,v in pairs(files) do
|
|
|
|
print("Running script:"..v)
|
|
|
|
print("Running script:"..v)
|
|
|
@ -181,7 +181,7 @@ function tools.getsite(names)
|
|
|
|
print("Type words that are in the site name, FULLCAPS, no modifiers (lovely->LOVE), q to quit:")
|
|
|
|
print("Type words that are in the site name, FULLCAPS, no modifiers (lovely->LOVE), q to quit:")
|
|
|
|
names={}
|
|
|
|
names={}
|
|
|
|
repeat
|
|
|
|
repeat
|
|
|
|
w=io.stdin:read();
|
|
|
|
w=getline();
|
|
|
|
|
|
|
|
|
|
|
|
if rwords[w]~=nil then
|
|
|
|
if rwords[w]~=nil then
|
|
|
|
table.insert(names,w)
|
|
|
|
table.insert(names,w)
|
|
|
@ -246,14 +246,14 @@ function tools.getsite(names)
|
|
|
|
print(string.format("%d)%s off=%x type=%s\t flags=%x",i,r,off,snames[typ+1],flg))
|
|
|
|
print(string.format("%d)%s off=%x type=%s\t flags=%x",i,r,off,snames[typ+1],flg))
|
|
|
|
|
|
|
|
|
|
|
|
if i%100==99 then
|
|
|
|
if i%100==99 then
|
|
|
|
r=io.stdin:read()
|
|
|
|
r=getline()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
print("Type which to change (q cancels):")
|
|
|
|
print("Type which to change (q cancels):")
|
|
|
|
repeat
|
|
|
|
repeat
|
|
|
|
r=io.stdin:read()
|
|
|
|
r=getline()
|
|
|
|
n=tonumber(r)
|
|
|
|
n=tonumber(r)
|
|
|
|
if(r=='q') then return end
|
|
|
|
if(r=='q') then return end
|
|
|
|
until n~=nil
|
|
|
|
until n~=nil
|
|
|
@ -268,7 +268,7 @@ function tools.changesite(names)
|
|
|
|
print((k-1).."->"..v)
|
|
|
|
print((k-1).."->"..v)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
repeat
|
|
|
|
repeat
|
|
|
|
r=io.stdin:read()
|
|
|
|
r=getline()
|
|
|
|
n2=tonumber(r)
|
|
|
|
n2=tonumber(r)
|
|
|
|
if(r=='q') then return end
|
|
|
|
if(r=='q') then return end
|
|
|
|
until n2~=nil
|
|
|
|
until n2~=nil
|
|
|
@ -300,7 +300,7 @@ function tools.changeflags(names)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
print("Type number to flip, or 'q' to quit.")
|
|
|
|
print("Type number to flip, or 'q' to quit.")
|
|
|
|
q=io.stdin:read()
|
|
|
|
q=getline()
|
|
|
|
n2=tonumber(q)
|
|
|
|
n2=tonumber(q)
|
|
|
|
if n2~=nil then
|
|
|
|
if n2~=nil then
|
|
|
|
|
|
|
|
|
|
|
@ -354,7 +354,7 @@ function tools.protectsite()
|
|
|
|
print("2. range (x0 x1 y0 y1 z0 z1)")
|
|
|
|
print("2. range (x0 x1 y0 y1 z0 z1)")
|
|
|
|
print("3. One block around pointer")
|
|
|
|
print("3. One block around pointer")
|
|
|
|
print("anything else- quit")
|
|
|
|
print("anything else- quit")
|
|
|
|
q=io.stdin:read()
|
|
|
|
q=getline()
|
|
|
|
n2=tonumber(q)
|
|
|
|
n2=tonumber(q)
|
|
|
|
if n2==nil then return end
|
|
|
|
if n2==nil then return end
|
|
|
|
if n2>3 or n2<1 then return end
|
|
|
|
if n2>3 or n2<1 then return end
|
|
|
@ -368,17 +368,17 @@ function tools.protectsite()
|
|
|
|
ze=z-1
|
|
|
|
ze=z-1
|
|
|
|
elseif n2==2 then
|
|
|
|
elseif n2==2 then
|
|
|
|
print("enter x0:")
|
|
|
|
print("enter x0:")
|
|
|
|
xs=tonumber(io.stdin:read())
|
|
|
|
xs=tonumber(getline())
|
|
|
|
print("enter x1:")
|
|
|
|
print("enter x1:")
|
|
|
|
xe=tonumber(io.stdin:read())
|
|
|
|
xe=tonumber(getline())
|
|
|
|
print("enter y0:")
|
|
|
|
print("enter y0:")
|
|
|
|
ys=tonumber(io.stdin:read())
|
|
|
|
ys=tonumber(getline())
|
|
|
|
print("enter y1:")
|
|
|
|
print("enter y1:")
|
|
|
|
ye=tonumber(io.stdin:read())
|
|
|
|
ye=tonumber(getline())
|
|
|
|
print("enter z0:")
|
|
|
|
print("enter z0:")
|
|
|
|
zs=tonumber(io.stdin:read())
|
|
|
|
zs=tonumber(getline())
|
|
|
|
print("enter z1:")
|
|
|
|
print("enter z1:")
|
|
|
|
ze=tonumber(io.stdin:read())
|
|
|
|
ze=tonumber(getline())
|
|
|
|
function clamp(t,vmin,vmax)
|
|
|
|
function clamp(t,vmin,vmax)
|
|
|
|
if t> vmax then return vmax end
|
|
|
|
if t> vmax then return vmax end
|
|
|
|
if t< vmin then return vmin end
|
|
|
|
if t< vmin then return vmin end
|
|
|
@ -434,7 +434,7 @@ function tools.fixwarp()
|
|
|
|
print("2. range (x0 x1 y0 y1 z0 z1)")
|
|
|
|
print("2. range (x0 x1 y0 y1 z0 z1)")
|
|
|
|
print("3. One block around pointer")
|
|
|
|
print("3. One block around pointer")
|
|
|
|
print("anything else- quit")
|
|
|
|
print("anything else- quit")
|
|
|
|
q=io.stdin:read()
|
|
|
|
q=getline()
|
|
|
|
n2=tonumber(q)
|
|
|
|
n2=tonumber(q)
|
|
|
|
if n2==nil then return end
|
|
|
|
if n2==nil then return end
|
|
|
|
if n2>3 or n2<1 then return end
|
|
|
|
if n2>3 or n2<1 then return end
|
|
|
@ -448,17 +448,17 @@ function tools.fixwarp()
|
|
|
|
ze=z-1
|
|
|
|
ze=z-1
|
|
|
|
elseif n2==2 then
|
|
|
|
elseif n2==2 then
|
|
|
|
print("enter x0:")
|
|
|
|
print("enter x0:")
|
|
|
|
xs=tonumber(io.stdin:read())
|
|
|
|
xs=tonumber(getline())
|
|
|
|
print("enter x1:")
|
|
|
|
print("enter x1:")
|
|
|
|
xe=tonumber(io.stdin:read())
|
|
|
|
xe=tonumber(getline())
|
|
|
|
print("enter y0:")
|
|
|
|
print("enter y0:")
|
|
|
|
ys=tonumber(io.stdin:read())
|
|
|
|
ys=tonumber(getline())
|
|
|
|
print("enter y1:")
|
|
|
|
print("enter y1:")
|
|
|
|
ye=tonumber(io.stdin:read())
|
|
|
|
ye=tonumber(getline())
|
|
|
|
print("enter z0:")
|
|
|
|
print("enter z0:")
|
|
|
|
zs=tonumber(io.stdin:read())
|
|
|
|
zs=tonumber(getline())
|
|
|
|
print("enter z1:")
|
|
|
|
print("enter z1:")
|
|
|
|
ze=tonumber(io.stdin:read())
|
|
|
|
ze=tonumber(getline())
|
|
|
|
function clamp(t,vmin,vmax)
|
|
|
|
function clamp(t,vmin,vmax)
|
|
|
|
if t> vmax then return vmax end
|
|
|
|
if t> vmax then return vmax end
|
|
|
|
if t< vmin then return vmin end
|
|
|
|
if t< vmin then return vmin end
|
|
|
|