Packets can be sent from the client to the server easily through ScriptInterface#SendPacket. For example, to send the rest packet, you can use:
bot.SendPacket("%xt%zm%restRequest%1%%");
You can also simulate packets being sent from the server to the client. You can simulate the 3 types of packets used by the game:
json - JSON packets.xml - XML packets.str - String packets, ones that contain %s.These can be sent to the client as follows:
bot.SendClientPacket("packet", "type");