Everything posted by saintpaul1
-
Advice on structuring large scripts?
So im quite new to writing scripts, maybe 3 months i've been practicing. First starting off like most, run everything in onLoop 😶, then i started with some bigger scripts and learned how to use task. The problem i have is that still using task i find myself using dozens and dozens of booleans to trigger certain tasks to make sure nothing overlaps so that i don't have more than one task running at a time. Basically im just asking if anyone has any pointers for me on structure Thank you.
-
Here are the quest configs for Animal Magnetism.
Animal magnetism configs start quest - 939, 0 get ecto tokens - 939, 10. talk to alice then malc. 939,20 talk to alice. 939, 30 talk to malc 939, 40 talk to alice 939,50 talk to malc 939,60 talk to alice 939, 70 talk to crone 939, 73 remove ghostspeak , talk to crone again. 939,76 take amulet to malcolm 939,80 talk to malc 939,90 || 100 cut scene - Buy undead chickens, go to ava 939,120 talk to witch 939, 130 talk to witch again 939,140 Take magnet to mine. 939,150 chop dead tree 939,160 talk to ava talk to turael 939, 70 get axe from turael 939, 180 chop undead tree again 939,190 get researhc notes 939,200 complete puzzle 134678 939 210 talk to ava 939, 220 use polished buttons on hard leather 939 230 finish quest 939,240 quest complete
-
Undead tree outside Draynor manor returning null.
omg thank you lmao been on this for 3 hours
-
Undead tree outside Draynor manor returning null.
Is this perhaps not an object? Maybe i have to use some sort of colour selection instead? Just wondering if anyone has a workaround for this, thank you.
-
Check which way the player is facing? Not the compass, the player.
😳 thank you
-
Check which way the player is facing? Not the compass, the player.
Is there a way to check this? Just need to be facing north when doing animal magnetism quest on the magnet bit. edit: i just thought of a work around if anyone is interested. I just set my player to a positonsouth behind a rock and then click mine on it,t that way my player will face north. would love to know if anyone has a way of checking if facing north still, tahnks
-
Breaking walkPath when there is a player nearby?
Thanks for replying, i managed to sort it by creating a new path and setting distances to 0.
-
WalkingEvent does not walk very well?
Creating a new path seems to have solved the problem, But thank you ill keep that in mind for future. Thank you for the help
-
WalkingEvent does not walk very well?
Sorry i just typed that in but basically i return when my player is at an Area. atPath should be : destinationArea.contains(myPlayer()) edit: im going to try create a new path see if it helps, ill report back return destinationArea.contains(myPlayer()) Area destinationArea = new Area(3142, 10245, 3278, 10050);
-
WalkingEvent does not walk very well?
Hey im still having problems if u have any ideas. Tried changing distance thresholds etc to no avail. Before using walkEvent i was using walkpath and i would walk to the following tile before reaching the first one and that fixed my problems, but i need to use walkEvent so i can use a break condition if i get attacked.
-
Breaking walkPath when there is a player nearby?
Hey khal just coming back to this. The walkEvent breaks easily if a threat is nearby which is great. The issue i have with walkEvent is when walking sometimes it gets to the next tile in the path and then clicks the same tile again or takes a step backwards or to the side and then carrys on walking. I also had this issue with walkPath but i used a custom walk method, to keep walking before it reached the next tile. Not sure how to do this with walkEvent if its even possible? If you have any ideas i would be graetful.
-
Selecting deposit all button in bank?
Thank you that will probably be the easiest solution! Not sure it it turns off after switching worlds though so may have to use widgets or something. Thanks ill try both
-
Selecting deposit all button in bank?
Just like with bank mode u can select withdraw as note etc. I cant find a way to select "All" in the bank settings. Just so i can deposit items quicker instead of right clicking -> deposit all.
-
WalkingEvent does not walk very well?
Okay thanks ill have a play with it. This is my event : WalkingEvent event = new WalkingEvent(); event.setPath(areasAndPaths.pathList); event.setHighBreakPriority(true); event.setEnergyThreshold(10); event.setBreakCondition(new Condition() { @Override public boolean evaluate() { return atPath; } }); main.execute(event); Position[] path = { new Position(3051, 3650, 0), new Position(3064, 3652, 0), new Position(3072, 3652, 0) }; LinkedList<Position> pathList = new LinkedList<>(Arrays.asList(path));
-
WalkingEvent does not walk very well?
Im walking a path i have created using walkingEvent and i find that it will walk to the next tile in the path and get to that tile, then instead of going to the following tile it will click a tile next to me and then go to the next one. Almost like it didnt go to the correct tile in the first place so it clicks a tile at the side of me then will move onto te next one. Maybe i need to set some sort of 2-3 tile tolerance? Also sometimes it gets to the tile, then clicks again ion the tile even though im already there, then moves on.
-
Handling misclicks.
Just to come back to this thread, since listening to what u said and only perfroming 1 interaction per cycle, my code is much better. Thank you.
-
Handling misclicks.
ah okay thank you! okay that gives me some ideas, thank you very much.
-
Handling misclicks.
For example im running my banking method. i open bank and sleepunitl bank open. How would u handle if it misclicks the bank and then it will skip the rest of my code that should run if bank is open? I know probably a stupid question just wondering how other people handle stuff like this. i guess everything runs on a loop and is if else statements? so if it misses something it comes back to it?
-
Changing world after logging out possible?
Thank you ill try this soon , i started uses explvs login handler and used mouse position to change world after logging out but would prefer to use normal login handler. thank you
-
Breaking walkPath when there is a player nearby?
Ah brill thank you ! Walking event is what i needed much appreciated
-
Every once in a while my player will attack another npc while already under attack.. why?
Thanks khal thats exactly my problem! Thanks for explaining! :>)
-
Breaking walkPath when there is a player nearby?
This is what i use to detect if a player is nearby that can attack me and is wearing certain gear. Works great if anyone needs it . public boolean nearbyThreat() { int wildernessLevel = map.getWildernessLevel(); int myCombatLevel = myPlayer().getCombatLevel(); List<Player> nearbyPlayers = getPlayers().filter(p -> p != null && !p.equals(myPlayer()) && p.getPosition().distance(myPlayer().getPosition()) <= 25); for (Player player : nearbyPlayers) { int playerCombatLevel = player.getCombatLevel(); int combatLevelDiff = myCombatLevel - playerCombatLevel; if (Math.abs(combatLevelDiff) <= wildernessLevel) { String equipment = getOthersEquipment(player); if (equipment.contains("Staff") || equipment.contains("cape") || equipment.contains("Dark") || equipment.contains("Mystic") || equipment.contains("Xerix") || equipment.contains("Occult") || player.isInteracting(myPlayer())) { log("Player " + player.getName() + " has equipment: " + equipment); imInDanger = true; return true; // found a nearby player who is a threat } } } imInDanger = false; return false; // no nearby player is a threat } Current issue im having, cant seem to break my pathwalk if a threat is nearby. It will always finish the walk before teleporting. I have nearbyThreat running constantly in onLoop. if (!atDestination()) { try { walking.walkPath(areasAndPaths.pathToDestination); } catch (InterruptedException e) { throw new RuntimeException(e); } } Util.Sleep.sleepUntil(() -> atDestination() || nearbyThreat(), 5000); } Also tried using a while loop.
-
Every once in a while my player will attack another npc while already under attack.. why?
NPC cow = main.getNpcs().closest(npc -> npc.getName().startsWith("cow") && npc.isAttackable()); if (cow != null) { main.log("cow not null"); if (!main.myPlayer().isInteracting(cow) && !cow.isInteracting(main.myPlayer()) && !main.myPlayer().isUnderAttack()) { InteractionEvent e = new InteractionEvent(cow, "Attack"); e.setHover(false); e.setMaximumAttempts(1); e.setOperateCamera(true); e.setWalkTo(false); main.execute(e); Util.Sleep.sleepUntil(() -> e.hasFailed() || main.myPlayer().isInteracting(cow) || cow.isInteracting(main.myPlayer()), 3000); } 95 percent of the time it can run for ages no problem, but every once in a while it will try to attack another npc and then get stuck trying to attack it while being attacked. Also this process only runs if !getCombat.isfighting, so theres another check. Just dont know what else i can do. Insight welcome pls
-
A Simple Login Handler
When logging in it the username correctly, but i think its also tying the username in password box.
-
Changing world after logging out possible?
Just wondering if its possible, and if it is can anyone point me in the right direction? Thank you.