working version, already tested and works on FreeRealms game