
function run_fnc( npc )

	action( npc, 
	   move( move.run_fwd, patrol( "way", patrol.start, patrol.stop ) ),
	   cond( cond.move_end )
	)
   
end

function main()
	local monster = get_level_object("monster")

	monster:script( true, script_name() )
	
	 while ( true ) do

		 if( monster:action() == nil ) then
			this.run_fnc( monster )
		 end
		 wait()

	 end
	
	monster:script( false, script_name() )
end

 
