ID:1857374
 
Problem description:
How to check the types of turfs placed near the other turf? I want to, say give some stones when the mine turf is placed near the hill turf and village turf.

// checking multiple turfs using a for() loop.
for(var/turf/t in orange(1, src))
// ...

// checking a single turf to the north.
var/turf/t = get_step(src, NORTH)
if(!t) return


From there, you would go on to check that the turf(s) involved are of the correct type before creating your stone objects. You would do this using the istype() proc.
How I check using the multiple for loop?
how exactly I should check the type?
In response to Adrian09_01
The link I provided to the reference explains how you should check the type.
In response to Adrian09_01
Adrian09_01 wrote:
how exactly I should check the type?
and apply the action? I want to use for loop.

orange is an area?
In response to Adrian09_01
Yes, it's a list of turfs within x tiles of an object, excluding the center. You would include the center using the range() proc instead.

By "apply the action," I take it you mean creating the stones. Here's an example:

// where 't' is a mine turf.
new/obj/stones(t)


You said you want to use a for() loop, so you are going to get something similar to this:

// inside of the mine turf's creation proc...
for(var/turf/t in orange(1, src))
if(t is a hill turf or a village turf)
new/obj/stones(t)
I want to give the stones every 5 seconds, not one time
can someone help me?
In response to Adrian09_01
I gave you enough information without giving you code you could copy/paste. Now it's up to you to do your part and fill in the blanks to achieve the system you want.

Show any code you may or may not be using and we'll go from there. If you don't know where to start, you need to check out the DM Guide.
I have a working proc() inside of the Mine object, but I want it to work every 5 seconds. I get an error:
Dark Ages.dm:375:error: 1: value not allowed here
Dark Ages.dm:376:error: 50: value not allowed here
Dark Ages.dm:376:error: : empty type name (indentation error?)
Dark Ages.dm:375:error: : empty type name (indentation error?)
Dark Ages.dmb - 4 errors, 0 warnings


and here are the trouble lines:
    mine
var/woodcost
var/stonecost
var/ironcost
var/foodcost
var/owner
icon = 'mine.dmi'
woodcost = 50
stonecost = 0
ironcost = 0
durability = 50
spawn while(1) //infinite ticker loop
sleep(50)
work()


It's my declaration of mine, I want the ticker to loop every 5 seconds, but I can't get it to work. work() is the proc that powers the mine.
You can't place code like that inside the object's definition. You'll need to place code inside a proc, such as New().
It lags horribly when I use sleep() and spawn().
How to select the hill as src to destroy?