Tylerart Posted January 21, 2020 Posted January 21, 2020 Entity portal = closestObjectForName(PORTAL_NAME); I am currently getting hung up on closestObjectForName i just started yesterday on scripting im currently working on a cwars bot but im getting hung up on this can anyone hep me out
Medusa Posted January 21, 2020 Posted January 21, 2020 RS2Object portal = getObjects().closest(PORTAL_NAME);
Tylerart Posted January 21, 2020 Author Posted January 21, 2020 3 minutes ago, Medusa said: RS2Object portal = getObjects().closest(PORTAL_NAME); i ended up using this and it seems to be working great // code in loop public int onLoop() throws InterruptedException { Player player = myPlayer(); //if player is in bank area find portal if (BANK_AREA.contains(player)) { objects.closest("Guthix Portal").interact("Enter"); } return 50; } } ive seen RS2Object is that acceptable for osrs?
Medusa Posted January 21, 2020 Posted January 21, 2020 What I sent is usually what you'd do. You're lacking quite a few checks that are nice to have.
Tylerart Posted January 21, 2020 Author Posted January 21, 2020 Thanks man for your input ill look into that method do you mind if i add you on disc : ]