Here I put part of inside do-loop code
for i = 1 to 3
dxpickaxe(i) = abs (object position x (3099+i)-object position x(2))
dypickaxe(i) = abs (object position y (3099+i)-object position y(2))
dzpickaxe(i) = abs (object position z (3099+i)-object position z(2))
distcampickaxe(i) = sqrt(dxpickaxe(i)^2+dypickaxe(i)^2+dzpickaxe(i)^2)
if distcampickaxe(i)<150 then gosub takepickaxe
next i
for i = 1 to 2
dxbow(i) = abs (object position x (3201+i)-object position x(2))
dybow(i) = abs (object position y (3201+i)-object position y(2))
dzbow(i) = abs (object position z (3201+i)-object position z(2))
distcambow(i) = sqrt(dxbow(i)^2+dybow(i)^2+dzbow(i)^2)
if distcambow(i)<150 then gosub takebow
next i
for i = 1 to 2
dxhandsaw(i) = abs (object position x (3400+i)-object position x(2))
dyhandsaw(i) = abs (object position y (3400+i)-object position y(2))
dzhandsaw(i) = abs (object position z (3400+i)-object position z(2))
distcamhandsaw(i) = sqrt(dxhandsaw(i)^2+dyhandsaw(i)^2+dzhandsaw(i)^2)
if distcamhandsaw(i)<150 then gosub takehandsaw
next i
rem dist clayfield + conditii=====================================================
dxclay = abs (object position x (8000)-object position x(2))
dyclay = abs (object position y (8000)-object position y(2))
dzclay = abs (object position z (8000)-object position z(2))
distcamclay = sqrt(dxclay^2+dyclay^2+dzclay^2)
if distcamclay < 500
if hideclayfield =1
box 321, 630, 660, 730, rgb(11,15,12), rgb(35,46,37), rgb(11,15,12), rgb (35,46,37)
ink rgb (250,228,62), rgb (255,255,255)
set text size 10
set cursor 350, 630
print " Claypit "
set cursor 350, 650
print " Costs: 4 beams, 4 timber"
set cursor 350, 670
print ""
set cursor 350, 690
print "press C to make a Claypit "
if keystate (46)=1 and beam >4 and timber > 4 then gosub claydown
endif
if hideclayfield = 0
box 321, 630, 660, 730, rgb(11,15,12), rgb(35,46,37), rgb(11,15,12), rgb (35,46,37)
ink rgb (250,228,62), rgb (255,255,255)
set text size 10
set cursor 330, 630
print "The claypit will produce for me "
set cursor 330, 650
print "a lot of claybricks !! "
set cursor 330, 670
endif
endif
rem end clayfield ================================================================
rem bricks burn =======================================================
dxcuptor = abs (object position x (8001)-object position x(2))
dycuptor = abs (object position y (8001)-object position y(2))
dzcuptor = abs (object position z (8001)-object position z(2))
distcamcuptor = sqrt(dxcuptor^2+dycuptor^2+dzcuptor^2)
if distcamcuptor<500
if hidebrickcuptor = 1
box 321, 630, 660, 730, rgb(11,15,12), rgb(35,46,37), rgb(11,15,12), rgb (35,46,37)
ink rgb (250,228,62), rgb (255,255,255)
set text size 10
set cursor 350, 630
print " brick kiln "
set cursor 350, 650
print " Costs: 5 beams, 4 timber"
set cursor 350, 670
print ""
set cursor 350, 690
print "press C to make a brick kiln "
if keystate (46)=1 and beam >4 and timber > 3 then gosub showkiln
endif
if hidebrickcuptor = 0
box 321, 630, 660, 730, rgb(11,15,12), rgb(35,46,37), rgb(11,15,12), rgb (35,46,37)
ink rgb (250,228,62), rgb (255,255,255)
set text size 10
set cursor 350, 630
print " Now it's the moment "
set cursor 350, 650
print " To make some bricks"
set cursor 350, 670
print "if you have some clay bricks"
set cursor 350, 690
print "5 clays = 1 brick "
set cursor 350, 710
print "press B for bricks"
endif
if keystate (48)=1 and claybrick > 5
brick=brick+1
claybrick = claybrick -5
play sound 9761
endif
endif
Mihai