Default Macro android possible?

is there any app that possible to macro the device ?
i mean record our touch for some duration and replay it many times again at the phone. Just like at pc keyboard macro
i want to use it to farm my game when i sleep