Hello, I have been tinkering with lua for a little bit, and am still trying to get a grip on things. However, I can't seem to figure out why I keep making Mushclient crash whenever I run this function :

The way this is written, I don't think it'll do what you want... It looks like you're trying to write a stepper. The loop runs regardless, as fast as possible.

so you'll walk into a room, send look, and walk into the next room before the mu even sends output back.

To make a stepper, you'll need a little bit more complex code using a coroutine. Coroutines let you pause a loop or funtion, and then pick up where you left off.

Nick's wait.lua module shows how they can be used.

Basic logic of it would be:

f = coroutine.wrap(function ()
if misc.name == "y" and stats.bal == "eb" and not mob.attack then
for i=1,166 do
CheckRoom()
coroutine.yield()
if mob.room then
mob.room = false
Send(area[i])
else
EnableTimer("basher", true)
end
end
end
end )

Either your basher timer or prompt trigger would then call f() to resume, after the mud's gotten a chance to send you enough text to trigger on a mob being in the room.