Just make a bunch of if - else statements within the loop. Not much more to it. Basic muling can be done a number of ways, but for examples sake, read and write to text files to know when to hop, what world to hop, and letting the mule know to login etc(.txt files need to be located within the osbot directory for permissions sake). Have the mule write his rsn to a text file so the bot knows who to trade. In short, I don't know, but do that. I assume you already know how to manipulate objects, groundobjects and npcs with the API, so this should come naturally to you if you really sit down and think about it.
There's really no shortcut here, if you don't understand what I'm talking about and haven't created your first woodcutter yet, go do that first.