May 22, 20196 yr Trying to assign the value of the Method clueTask() to the String clueTask and have it log to the console using log(clueTask); private String clueTask = clueTask(); private String clueTask() { RS2Widget clueTaskAnagram = (RS2Widget) getWidgets().get(203,2); return clueTaskAnagram.getMessage(); }
May 22, 20196 yr Widget IDs change. You should always check for != null and .isVisible() for widgets before grabbing details fromthem. Perhaps a better naming scheme?
May 22, 20196 yr You are declaring the same 'clueTask' name twice, one as a method and one as a variable, change the private String clueTask name, and make sure to initialize it in onLoop or something, instead of outside a method.
May 22, 20196 yr Clues have IDs. I suggest using them rather than trying to figure out which clue is what from the interface. I'd also suggest either starting with a simpler script, or stopping and learning basic java before trying to progress onto something this 'advanced'. It'll save you a lot of hassle 😛 Edited May 22, 20196 yr by HeyImJamie
May 22, 20196 yr Author 2 2 hours ago, HeyImJamie said: Clues have IDs. I suggest using them rather than trying to figure out which clue is what from the interface. I'd also suggest either starting with a simpler script, or stopping and learning basic java before trying to progress onto something this 'advanced'. It'll save you a lot of hassle 😛 All beginner clues got ID 23182 and model ID 37162. Yes, I might have been too ambitious making a clue solver as one of my first Scripts however, I have learned a lot from what I've got so far. Unfortunately, the way I wanted to structure the script is not working out for me. I was planning on opening the clue and grabbing the Message from the widget and applying it to a variable that I want to use in a switch() to complete the task. I came up with the following code for my onLoop() but it's not working. @Override public int onLoop() throws InterruptedException { String clue = clueTask(); if(clue == null) { getClueTask(); } else if(clue != null) { switch (clue) { case xyz: //complete task break; case xyz: //complete task } } return 3000; }
May 22, 20196 yr 16 minutes ago, Vogelbekdier said: All beginner clues got ID 23182 and model ID 37162. Yes, I might have been too ambitious making a clue solver as one of my first Scripts however, I have learned a lot from what I've got so far. Unfortunately, the way I wanted to structure the script is not working out for me. I was planning on opening the clue and grabbing the Message from the widget and applying it to a variable that I want to use in a switch() to complete the task. I came up with the following code for my onLoop() but it's not working. @Override public int onLoop() throws InterruptedException { String clue = clueTask(); if(clue == null) { getClueTask(); } else if(clue != null) { switch (clue) { case xyz: //complete task break; case xyz: //complete task } } return 3000; } I'm pretty sure that's not the case. I don't have a beginner clue to test, but I know for every other clue type they all have their own individual IDs. With IDs, you can store each clue in an enum.
May 23, 20196 yr Should not the string be inside of the method? String clueOne = ""; private String clueTask() { RS2Widget clueTaskAnagram = (RS2Widget) getWidgets().get(203,2); return clueOne = clueTaskAnagram.getMessage(); } then { WriteLine(clueOne) } or whatever you wanted to do with the String. Edited May 23, 20196 yr by NukeDropper
May 23, 20196 yr 21 minutes ago, NukeDropper said: Should not the string be inside of the method? private String clueTask(String clueTaskOne) { RS2Widget clueTaskAnagram = (RS2Widget) getWidgets().get(203,2); return clueTaskAnagram.getMessage(); } ? What lmao.
Create an account or sign in to comment