Its possible, but its a pain in the ass, its glitchy and overall, refining something like this would take an almost unlimited amount of time to get perfect. A basic dungeon running bot includes, changing key drops to something more easily detectable (blank coloured squares), a mark on the rendering of rooms for 1 door and the others, a check for walls (blank masks), and waypoints and an auto battling AI. In short, don't bother, farm gold and buy the scrolls, or just automate battling and guide the bot yourself.