Beispiel #1
0
        public void goToNextWaypoint()
        {
            if (waypointList.Count == 0)
            {
                return;
            }

            isWalking = true;
            int nextWaypointType = waypointList[nextWaypoint].getType();

            if (nextWaypointType == AppConstants.WAYPOINT_ACTION)
            {
                //int yInicial = Player.getPosY();
                //int yFinal = yInicial++; // Cuando haya bajado 1 sqm es pq termino de hablar

                while (MemoryHandler.getPosY() < 5) /* que balurdez */
                {
                    BotUtils.doAction();
                    Thread.Sleep(AppConstants.LAG_HIGH);
                    BotUtils.moveDown();
                    Thread.Sleep(AppConstants.LAG_HIGH);
                }
            }
            else
            {
                BotUtils.walk(waypointList[nextWaypoint]);

                /*BotUtils.moveRight();
                 * Thread.Sleep(AppConstants.KEY_DELAY);
                 * BotUtils.moveLeft();*/
                Thread.Sleep(AppConstants.KEY_DELAY);
            }

            int prevType = nextWaypointType;

            if ((Player.getPosX() == waypointList[nextWaypoint].getX() &&
                 Player.getPosY() == waypointList[nextWaypoint].getY()) ||
                nextWaypointType == AppConstants.WAYPOINT_ACTION ||
                nextWaypointType == AppConstants.WAYPOINT_DOOR)
            {
                nextWaypoint = getNextWaypointId();
            }

            /* Chequeo si era LOOP o ENDLOOP para modificar ...*/
            if (prevType == AppConstants.WAYPOINT_LOOP)
            {
                /* Chequeo PPs.. Si tengo, sigo normal.. Sino, mando al sig de endloop */
                if (!BotUtils.tengoPP(AppConstants.FIGHT_PP1, AppConstants.FIGHT_PP2,
                                      AppConstants.FIGHT_PP3, AppConstants.FIGHT_PP4))
                {
                    /* Busco el que sigue despues de endloop */
                    for (int i = prevType; i < waypointList.Count; i++)
                    {
                        if (waypointList[i].getType() == AppConstants.WAYPOINT_ENDLOOP)
                        {
                            nextWaypoint = i + 1;
                            break;
                        }
                    }
                }
            }
            if (prevType == AppConstants.WAYPOINT_ENDLOOP)
            {
                /* Mando a LOOP */
                for (int i = 0; i < waypointList.Count; i++)
                {
                    if (waypointList[i].getType() == AppConstants.WAYPOINT_LOOP)
                    {
                        nextWaypoint = i;
                        break;
                    }
                }
            }

            isWalking = false;
        }
Beispiel #2
0
 public static int getPosY()
 {
     return(MemoryHandler.getPosY());
 }