Tylerart Posted January 21, 2020 Share 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 Quote Link to comment Share on other sites More sharing options...
Medusa Posted January 21, 2020 Share Posted January 21, 2020 RS2Object portal = getObjects().closest(PORTAL_NAME); Quote Link to comment Share on other sites More sharing options...
Tylerart Posted January 21, 2020 Author Share 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? Quote Link to comment Share on other sites More sharing options...
Medusa Posted January 21, 2020 Share 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. Quote Link to comment Share on other sites More sharing options...
Tylerart Posted January 21, 2020 Author Share Posted January 21, 2020 Thanks man for your input ill look into that method do you mind if i add you on disc : ] Quote Link to comment Share on other sites More sharing options...
ProjectPact Posted January 21, 2020 Share Posted January 21, 2020 Check out Script Factory! 1 1 Quote Link to comment Share on other sites More sharing options...