beefsteak 30 Posted July 15, 2020 Howdy folks, I've got a script thats working perfectly except for one section of dialogue, with the customs officer in Karamja. For some reason, the script keeps looping the interaction ("Pay-Fare") with officer, and doesnt continue or choose any of the dialogue options. I have to pause the script, walk the character through the dialogue and crossing gangplank, and then it starts the next case and works fine. Amateur coder here, so any tips and comments appreciated! I'm sure this is horribly written and a pain to read haha if (getInventory().isFull() && (!port2Area.contains(getLocalPlayer()))) { getWalking().walk(port2Area.getRandomTile()); sleepUntil(() -> !getLocalPlayer().isMoving(), randomNum(1000, 2000)); } if (getInventory().isFull() && officer != null) { officer.interact("Pay-fare"); sleepUntil(() -> getDialogues().inDialogue(), 8000); // GETS STUCK HERE, spams "Pay fare"<--- if (getDialogues().canContinue() == true || getLocalPlayer().getInteractingCharacter() != null) { getDialogues().spaceToContinue(); getDialogues().chooseOption("Can I journey on this ship?"); getDialogues().chooseOption("Search away, I have nothing to hide."); getDialogues().chooseOption("Ok."); getGameObjects().closest(plank -> plank != null && plank.hasAction("Cross")); GameObject plank = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Gangplank") && (gameObject.getID() == 2082)); plank.interact("Cross"); sleep(randomNum(1000,2000)); getWalking().walk(bankArea.getRandomTile()); sleep(500,1000); } } break;
wettofu 118 Posted July 15, 2020 Well, you're saying that if the inventory is full and if the officer is there then interact with him, and since that will always return true, it will just repeat that one line. Instead you should put something like: if (getInventory.isFull() && officer !=null){ if (getDialogues.inDialogue){ do all dialogue here } else { officer.interact } }
beefsteak 30 Author Posted July 15, 2020 thanks @wettofu that fixed it! only issue now is that it gets stuck on crossing the gangplank.. tried moving some things around but cant seem to fix it, any tips? btw i love wetquests that shit is a life saver if (getInventory().isFull() && officer != null) { if (getDialogues().inDialogue()){ getDialogues().spaceToContinue(); getDialogues().chooseOption("Can I journey on this ship?"); getDialogues().chooseOption("Search away, I have nothing to hide."); getDialogues().chooseOption("Ok."); getDialogues().clickContinue(); sleep(randomNum(7000,10000)); // Wait for sailing animation getDialogues().clickContinue(); // "The ship arrives at Port Sarim" sleep(randomNum(1000,2000)); getGameObjects().closest(plank -> plank != null && plank.hasAction("Cross")); GameObject plank = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Gangplank") && (gameObject.getID() == 2082)); plank.interact("Cross"); sleep(randomNum(1000,2000)); getWalking().walk(bankArea.getRandomTile()); sleep(500,1000); } else { officer.interact("Pay-fare"); sleepUntil(() -> getDialogues().inDialogue(), 8000); } } break;
lousy 1 Posted July 16, 2020 getGameObjects().closest(plank -> plank != null && plank.hasAction("Cross")); GameObject plank = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Gangplank") && (gameObject.getID() == 2082)); plank.interact("Cross"); Seems like you're defining plank after trying to use it? What does the debug console in your script say? A better way might be GameObject plank = getGameObjects.closest("Gangplank"); if (plank != null) plank.interact("Cross");
wettofu 118 Posted July 16, 2020 Alright, what that if statement does is check whether you are in a dialogue or not, if that statement is false, it will then talk to the officer, because you're saying that if you are in dialogue then click the plank to move on but in actuality, you're no longer in a dialogue so that is no longer repeated. so just say that if officer is null then interact with the gangplank else, do everything else also do what lousy said, its just way easier than what you're trying to do
Recommended Posts
Archived
This topic is now archived and is closed to further replies.