How instagram bots are made?

Good evening!

How Instagram bots like instagress and others are made?
They seem to have a similar engine or something like that.
Is it possible to create it with imacros ?
Any info will be appreciated.

Thanks in advance