Jump to content

ZoPP0Qp5r9xM

Members
  • Posts

    5
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ZoPP0Qp5r9xM's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. API doesn't answer the latter two questions, but i took a look with a decompiler private boolean traversePath() { Object someObject = null; for (int i = linkedList.size() - 1; i >= 0; --i) { Position currentListPos; label35: { currentListPos = (Position) linkedList.get(i); if (myPosition().distance(currentListPos) >= miniMapDistanceThreshold) { if (!map.isMinimapLocked() && currentListPos.isOnMiniMap(bot)) { if (isOperateCamera && camera.getPitchAngle() < gRandom(40, 1.0D)) { camera.movePitch(random(40, 67)); } someObject = new ClickMouseEvent(new MiniMapTileDestination(bot, currentListPos)); break label35; } } else { if (!currentListPos.isVisible(bot)) { camera.toPosition(currentListPos); } (new WalkingEvent$1(this, 10000)).sleep(); someObject = (new InteractionEvent(bot, currentListPos, "walk here")).setWalkTo(false); } } if (someObject != null) { execute((Event) someObject); if (((Event) someObject).hasFinished()) { (new WalkingEvent$2(bot, 6000, 500, currentListPos)).sleep(); return true; } } } return false; } public class WalkingEvent$1 extends ConditionalSleep { public final WalkingEvent walkingEvent; public WalkingEvent$1(WalkingEvent walkingEvent, int timeout) { super(timeout); this.walkingEvent = walkingEvent; } public boolean condition() throws InterruptedException { return !myPlayer.isMoving(); } } public class WalkingEvent$2 extends ConditionalSleep { public final WalkingEvent walkingEvent; public final Position position; public WalkingEvent$2(WalkingEvent walkingEvent, int timeout, int sleepTime, Position position) { super(timeout, sleepTime); this.walkingEvent = walkingEvent; this.position = position; } public boolean condition() { return myPlayer.getPosition().distance(currentListPos) < 4; } } The second conditional sleep is being called between minimap clicks, timeout of 6 seconds with 500ms updates checking if player pos distance to next position is <= 3 tiles. those need to be public vars :D?
  2. 1. If I use a single instance WalkingEvent doesn't run after one execution. It seems that I have to instantiate a new event every time I want to run one. Why is this? 2. What is the exact maximum distance WalkingEvent will try to click? I noticed on my path I have many in-between points that are never clicked, so I'm guessing they are pointless to have. 3. Is there a way to set the distance from a point that the next point will be clicked? With WalkingEvent it seems to click the next point when it is within 2-3 squares, but WebWalkingEvent has a bigger lead which makes it look more natural (i.e. player doesn't slow down when it is close to the next Position).
  3. Thanks for the replies. I think I will start simple and then only if I find things are getting unwieldy I will see if I can abstract.
  4. I am new to both programming and scripting. I was reading this tutorial on a Node System design and it sounded good (having events prioritized), but a couple users in the replies said it was overly complicated or not recommended/advised. I also looked at this old thread talking about concurrency. Other "designs" I am aware of is basic selection and switches, but I can foresee this limiting complexity. So I am wondering what exactly is the ideal way to structure a script, with OOP/polymorphism in mind? I want to figure this out before even attempting to write scripts so that they don't end up being spaghetti.
×
×
  • Create New...