system64 Posted January 4, 2015 Posted January 4, 2015 (edited) It's my first script; I'm trying to make a range guild script. What should i use to talk to the Range judge? I currently have: import org.osbot.rs07.api.map.Position; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.Area; import java.awt.*; @ScriptManifest(author = "system64", info = "range guild", name = "SmartGuild", version = 0, logo = "") public class Guild extends Script { private static final int[] Judge_ID = { 6070 }; // competition judge private Position[] path = { new Position(2659, 3437, 0), new Position(2660, 3436, 0), new Position(2662, 3434, 0), new Position(2664, 3431, 0), new Position(2666, 3426, 0), new Position(2670, 3418, 0), }; Edited January 4, 2015 by system64
Alek Posted January 4, 2015 Posted January 4, 2015 NPC judge = getNpcs().closest("Judge"); if(judge != null){ judge.interact("Talk-to"); } I would suggest not using ids for NPCs or RS2Objects because they are subject to change on every RS update. Also you have an array of integers, which is unnecessary. private static final int JUDGE_ID = 0;
system64 Posted January 5, 2015 Author Posted January 5, 2015 (edited) NPC judge = getNpcs().closest("Judge"); if(judge != null){ judge.interact("Talk-to"); } I would suggest not using ids for NPCs or RS2Objects because they are subject to change on every RS update. Also you have an array of integers, which is unnecessary. private static final int JUDGE_ID = 0; NPC judge = getNpcs().closest("Judge"); if(judge != null){ judge.interact("Talk-to"); } use that instead of NPCS/RS2objects? Edited January 5, 2015 by system64
Alek Posted January 5, 2015 Posted January 5, 2015 NPC judge = getNpcs().closest("Judge"); if(judge != null){ judge.interact("Talk-to"); } use that instead of NPCS/RS2objects? Use what instead?
CarsonT Posted January 15, 2015 Posted January 15, 2015 He's asking to use the getNPC method you suggested instead of the one he was using. Yes you should use Alek's method instead. That will prevent the tedious task of having to change your npc's ids every update (if they were changed of course).