ID:139207
 
Code:
mob
proc/get_work(W as turf in mined_walls)
if(mined_walls.len>=1)
if(W in mined_walls)
usr<<"wall found"
if(get_dist(src,W)>=2)
step_towards(src,W)
usr<<"tried to step"
return
else
usr<<"finished pathing,started mining"
sleep(30)
usr<<"finished mining"
var/turf/floor/F= new(W)
dump+= F
dump-= F
return


Problem description:
When this proc is executed, mob moves south once. I try to make mob to move to the wall and then mine. If you want, feel free to make a code from scratch, I already don't remember how many times I edited it while trying to make it work, too bad I couldn't fix it.

EDIT: Damn it, forgot to name topic, now fixed.
step_towards only takes one step - you want to have some kind of loop calling step_towards.

Incidental: you're only outputting to usr instead of using it in actual code, but using usr in a proc is a bad, bad idea. It doesn't mean what you think it means.
In response to Jp
I know it makes only one step. I deleted loop to see if it does at least one step right and I will re-add loop when steps will work. Right now, clicking on mob starts this proc, so I can just click on it few times to see if it paths right.
Right now it just goes south, no matter where marked wall is.

Oh, so I should do something like *src << "blahblahblah"* ? Well, I should remember it for the later.
In response to Martys1103
Looks like it needs bump, problem is still not solved.