ID:145127
 
mob
var
Walking=1

mob
Aitest
icon = 'aitest.dmi'
New()
..()
Walkers()
Bumped()

mob
proc
Walkers()
while(!Walking)
walk(src,EAST)
while(Walking)
walk(src,WEST)
Bumped()
if(!Walking)
Walking=0
if(Walking)
Walking=1

How do i fix this infinite loop at runtime
Just glancing over it, I noticed something that doesn't makes sense.
        Bumped()
if(!Walking)
Walking=1
if(Walking)
Walking=0 //It looks like these should be this way


I don't know if that's your problem, but it struck me as wrong.
mob
proc
Walkers()
while(!Walking)
sleep(1)
step(src,EAST)
while(Walking)
sleep(1)
step(src,WEST)


Doesn't make no sense anyway. I don't get what the heck you're trying to do. o.O.. You're calling one proc trying to active one other that you're not calling. Or Wha?!?! Bumped() is after Bump(). Make it so.
In response to Mysame
mob
var
Walking=1

mob
aitest
icon = 'aitest.dmi'
New()
..()
Walkers()
Bumped()

mob
proc
Walkers()
while(Walking)
sleep(8)
step(src,EAST)
while(!Walking)
sleep(8)
step(src,WEST)


turf
ground
icon='turfs.dmi'
icon_state="1"
density=1
Bumped(mob/M)
if(M.Walking==1)
M.Walking=0
if(M.Walking==0)
M.Walking=1

atom/proc/Bumped()

mob
Bump(atom/A)
A.Bumped(src)
..()


Its getting late were i live now and i am getting very tired i was hopeing i could finish this before i went to bed. If you could help me i would a precreate it. All i need is that when my npc walks into the a object infont of him he will turn around and walk the other way until he turn around again and so on.
In response to Yorae
Unless you want to do some additional things, you don't need Bump() or Bumped(). step() tells you whether or not it succeeded.

mob
aitest
New()
..()
spawn() src.Walkers()

proc
Walkers()
while(step(src, EAST)) sleep(8)
while(step(src, WEST)) sleep(8)
spawn(1) src.Walkers()
In response to Cinnom
In addition - If you do want to do additional things inside Bump or Bumped, then use the ! operator instead. Walking =! Walking
In response to Audeuro
Thanks for the help