473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

i have 2 cannot find symbol errors, one for method getCurrSkillLevel(int).

1
Expand|Select|Wrap|Line Numbers
  1. import org.rsbot.bot.Bot;
  2. import org.rsbot.bot.input.Mouse;
  3. import org.rsbot.event.events.ServerMessageEvent;
  4. import org.rsbot.event.listeners.PaintListener;
  5. import org.rsbot.event.listeners.ServerMessageListener;
  6. import org.rsbot.script.Methods;
  7. import org.rsbot.script.Script;
  8. import org.rsbot.script.ScriptManifest;
  9. import org.rsbot.script.wrappers.RSItem;
  10. import org.rsbot.script.wrappers.RSItemTile;
  11. import org.rsbot.script.wrappers.RSObject;
  12. import org.rsbot.script.wrappers.RSTile;
  13.  
  14. import javax.swing.*;
  15. import java.awt.*;
  16. import java.awt.event.ActionEvent;
  17. import java.awt.event.ActionListener;
  18. import java.util.Map;
  19.  
  20. @ScriptManifest(authors = {"Henry11200"}, category = "Magic", name = "Henry's Wine Grabber", version = 0.1, description = "Start script and set settings in GUI")
  21. public class HenrysWineGrabber extends Script implements PaintListener, ServerMessageListener {
  22.  
  23.    private final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
  24.  
  25.    public final RSTile[] To1 = {new RSTile(2946, 3368), new RSTile(2946, 3374), new RSTile(2952, 3379), new RSTile(2959, 3383),
  26.            new RSTile(2966, 3388), new RSTile(2966, 3396), new RSTile(2966, 3402), new RSTile(2966, 3408),
  27.            new RSTile(2961, 3414), new RSTile(2956, 3419), new RSTile(2952, 3425), new RSTile(2948, 3432),
  28.            new RSTile(2948, 3438), new RSTile(2949, 3444), new RSTile(2949, 3448), new RSTile(2949, 3454),
  29.            new RSTile(2949, 3461), new RSTile(2949, 3467), new RSTile(2949, 3473), new RSTile(2946, 3480),
  30.            new RSTile(2946, 3486), new RSTile(2946, 3492), new RSTile(2939, 3496), new RSTile(2938, 3502),
  31.            new RSTile(2941, 3507), new RSTile(2941, 3513), new RSTile(2942, 3517)};
  32.  
  33.    final RSTile[] To2 = {new RSTile(2945, 3369), new RSTile(2949, 3376), new RSTile(2957, 3383), new RSTile(2966, 3389),
  34.            new RSTile(2966, 3396), new RSTile(2965, 3402), new RSTile(2963, 3407), new RSTile(2960, 3413),
  35.            new RSTile(2957, 3417), new RSTile(2954, 3422), new RSTile(2952, 3428), new RSTile(2948, 3434),
  36.            new RSTile(2947, 3440), new RSTile(2947, 3447), new RSTile(2945, 3454), new RSTile(2945, 3461),
  37.            new RSTile(2944, 3467), new RSTile(2944, 3474), new RSTile(2944, 3481), new RSTile(2944, 3489),
  38.            new RSTile(2942, 3496), new RSTile(2941, 3502), new RSTile(2941, 3509), new RSTile(2942, 3516),
  39.            new RSTile(2934, 3515)};
  40.  
  41.    final RSTile[] Run = {new RSTile(2934, 3516), new RSTile(2941, 3510), new RSTile(2941, 3501), new RSTile(2942, 3494)};
  42.  
  43.    public final RSTile InSide = new RSTile(2932, 3515);
  44.    final RSTile BankTile = new RSTile(2945, 3368);
  45.  
  46.    final TheWalker theWalker = new TheWalker();
  47.  
  48.    final int[] Not = {563, 555};
  49.    public int count = 0;
  50.  
  51.    public boolean Spell = false;
  52.    static final int Wine = 245;
  53.    int Table = 595;
  54.    public int mx = -1;
  55.    public int my = -1;
  56.    static final int Law = 563;
  57.    static final int Water = 555;
  58.    public final long startTime = System.currentTimeMillis();
  59.    public int startEXP;
  60.    public int startLvl;
  61.    String status = "Starting Up";
  62.    String antib = "OFF";
  63.    String ttt = "OFF";
  64.  
  65.    public void onRepaint(Graphics g) {
  66.        long millis = System.currentTimeMillis() - startTime;
  67.        long hours = millis / (1000 * 60 * 60);
  68.        millis -= hours * (1000 * 60 * 60);
  69.        long minutes = millis / (1000 * 60);
  70.        millis -= minutes * (1000 * 60);
  71.        long seconds = millis / 1000;
  72.        Mouse m = Bot.getClient().getMouse();
  73.        //Settings
  74.        g.setColor(new Color(70, 234, 40, 150));
  75.        g.fillRect(459, 322, 60, 16);
  76.        g.setColor(new Color(0, 0, 0));
  77.        g.drawRect(459, 322, 60, 16);
  78.        g.setColor(new Color(70, 234, 40, 200));
  79.        g.drawRect(460, 323, 58, 14);
  80.        g.setColor(new Color(70, 234, 40, 100));
  81.        g.fillRect(459, 322, 60, 8);
  82.        g.setColor(new Color(255, 255, 255));
  83.        g.drawString("Settings", 464, 334);
  84.        //About
  85.        g.setColor(new Color(70, 234, 40, 150));
  86.        g.fillRect(398, 322, 60, 16);
  87.        g.setColor(new Color(0, 0, 0));
  88.        g.drawRect(398, 322, 60, 16);
  89.        g.setColor(new Color(70, 234, 40, 200));
  90.        g.drawRect(399, 323, 58, 14);
  91.        g.setColor(new Color(70, 234, 40, 100));
  92.        g.fillRect(398, 322, 60, 8);
  93.        g.setColor(new Color(255, 255, 255));
  94.        g.drawString("About", 402, 334);
  95.        //Status
  96.        g.setColor(new Color(70, 234, 40, 150));
  97.        g.fillRect(337, 322, 60, 16);
  98.        g.setColor(new Color(0, 0, 0));
  99.        g.drawRect(337, 322, 60, 16);
  100.        g.setColor(new Color(70, 234, 40, 200));
  101.        g.drawRect(338, 323, 58, 14);
  102.        g.setColor(new Color(70, 234, 40, 100));
  103.        g.fillRect(337, 322, 60, 8);
  104.        g.setColor(new Color(255, 255, 255));
  105.        g.drawString("Status", 341, 334);
  106.        //Time Ran
  107.        g.setColor(new Color(70, 234, 40, 150));
  108.        g.fillRect(226, 322, 110, 16);
  109.        g.setColor(new Color(0, 0, 0));
  110.        g.drawRect(226, 322, 110, 16);
  111.        g.setColor(new Color(70, 234, 40, 200));
  112.        g.drawRect(227, 323, 108, 14);
  113.        g.setColor(new Color(70, 234, 40, 100));
  114.        g.fillRect(226, 322, 110, 8);
  115.        g.setColor(new Color(255, 255, 255));
  116.        g.drawString(
  117.                hours
  118.                        + "h "
  119.                        + minutes
  120.                        + "min"
  121.                        + seconds
  122.                        + "sec", 234, 334);
  123.        if (m.x >= 337 && m.x < 397 && m.y >= 321 && m.y < 337) {
  124.            g.setColor(new Color(70, 234, 40, 150));
  125.            g.fillRect(337, 175, 182, 147);
  126.            g.setColor(new Color(0, 0, 0));
  127.            g.drawRect(337, 175, 182, 147);
  128.            g.setColor(new Color(255, 255, 255));
  129.            g.drawString("Lvl's gained " + (startLvl - skills.getCurrSkillLevel(STAT_MAGIC)), 360, 197);
  130.            g.setColor(new Color(255, 255, 255, 255));
  131.            g.drawString("EXP gained " + (skills.getCurrentSkillExp(STAT_MAGIC) - startEXP), 360, 230);
  132.            g.setColor(new Color(255, 255, 255));
  133.            g.drawString("Status: " + status, 360, 263);
  134.            g.setColor(new Color(255, 255, 255));
  135.            g.drawString("Wine Grabbed: " + count, 360, 296);
  136.        }
  137.        if (m.x >= 397 && m.x < 459 && m.y >= 321 && m.y < 337) {
  138.            g.setColor(new Color(70, 234, 40, 150));
  139.            g.fillRect(337, 175, 182, 147);
  140.            g.setColor(new Color(0, 0, 0));
  141.            g.drawRect(337, 175, 182, 147);
  142.            g.setColor(new Color(255, 255, 255));
  143.            g.drawString("Henry's Wine Grabber v" + properties.version(), 365, 197);
  144.            g.setColor(new Color(255, 255, 255));
  145.            g.drawString("Made by Henry11200 ", 375, 263);
  146.        }
  147.        if (m.x >= 459 && m.x < 519 && m.y >= 321 && m.y < 337) {
  148.            if (Tele) {
  149.                ttt = "ON";
  150.            }
  151.            if (!Tele) {
  152.                ttt = "OFF";
  153.            }
  154.            g.setColor(new Color(70, 234, 40, 150));
  155.            g.fillRect(337, 175, 182, 147);
  156.            g.setColor(new Color(0, 0, 0));
  157.            g.drawRect(337, 175, 182, 147);
  158.            g.setColor(new Color(255, 255, 255));
  159.            g.drawString("Teleporting is " + ttt, 360, 230);
  160.            if (antiban == true) {
  161.                antib = "ON";
  162.            }
  163.            if (antiban == false) {
  164.                antib = "OFF";
  165.            }
  166.            g.drawString("Antiban is " + antib, 360, 263);
  167.        }
  168.    }
  169.  
  170.    public boolean onStart(final Map<String, String> args) {
  171.        startEXP = skills.getCurrentSkillExp(STAT_MAGIC);
  172.        startLvl = skills.getCurrSkillLevel(STAT_MAGIC);
  173.  
  174.        new GUI();
  175.        while (!guidone) {
  176.            status = "GUI settings";
  177.            wait(1000);
  178.        }
  179.        no = Integer.valueOf(noo);
  180.        setCameraAltitude(true);
  181.        return true;
  182.    }
  183.  
  184.    public static boolean guidone = false;
  185.    public static boolean antiban;
  186.    public static boolean Tele = false;
  187.    public static int no;
  188.    public static String noo;
  189.  
  190.    @SuppressWarnings("serial")
  191.    class GUI extends JFrame implements ActionListener {
  192.  
  193.        private final JLabel descLabel = new JLabel("Start in falafor bank or at the Zamorak church.");
  194.        private final JLabel descLabel1 = new JLabel("Have law runes in your inventory, air staff equiped");
  195.        private final JLabel descLabel2 = new JLabel("and if you want to teleport some water runes.");
  196.        private final JLabel descLabel3 = new JLabel("It can withdraw law runes and water runes.");
  197.        private final JLabel descLabel4 = new JLabel("Have them in your bank where scipt can see them.");
  198.        private final JLabel DL = new JLabel("How many runes you want to withdraw when out. 0 means all.");
  199.        private final JButton startScript = new JButton("Start script");
  200.        private final JPanel mainPanel = new JPanel();
  201.        private final JTabbedPane tabs = new JTabbedPane();
  202.        private final JCheckBox antibanBox = new JCheckBox("Use antiban");
  203.        private final JCheckBox teleBox = new JCheckBox("Use Teleport");
  204.        private final JTextField Many = new JTextField(5);
  205.  
  206.        public GUI() {
  207.            super(properties.name() + " v" + properties.version() + " - By Henry11200");
  208.  
  209.            mainPanel.setLayout(new FlowLayout());
  210.  
  211.            startScript.setActionCommand("start");
  212.            startScript.addActionListener(this);
  213.  
  214.            mainPanel.add(descLabel);
  215.            mainPanel.add(descLabel1);
  216.            mainPanel.add(descLabel2);
  217.            mainPanel.add(descLabel3);
  218.            mainPanel.add(descLabel4);
  219.            mainPanel.add(DL);
  220.            mainPanel.add(Many);
  221.            Many.setText("0");
  222.            mainPanel.add(antibanBox);
  223.            mainPanel.add(teleBox);
  224.            mainPanel.add(startScript);
  225.            tabs.addTab("Settings", mainPanel);
  226.  
  227.            add(tabs);
  228.            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  229.            setPreferredSize(new Dimension(350, 220));
  230.            pack();
  231.            setVisible(true);
  232.        }
  233.  
  234.        public void actionPerformed(ActionEvent e) {
  235.            if (e.getActionCommand().equals("start")) {
  236.                HenrysWineGrabber.antiban = antibanBox.isSelected();
  237.                HenrysWineGrabber.Tele = teleBox.isSelected();
  238.                HenrysWineGrabber.guidone = true;
  239.                HenrysWineGrabber.noo = Many.getText();
  240.                dispose();
  241.                return;
  242.            }
  243.        }
  244.    }
  245.  
  246.  
  247.    public RSTile[] To() {
  248.        int randNo = random(0, 2);
  249.        if (randNo == 0) {
  250.            return To1;
  251.        }
  252.        if (randNo == 1) {
  253.            return To2;
  254.        }
  255.        return To1;
  256.    }
  257.  
  258.    public void ClickSpell() {
  259.        castSpell(44);
  260.        Spell = true;
  261.    }
  262.  
  263.    public void GrabWine() {
  264.        if (!Spell) {
  265.            ClickSpell();
  266.        }
  267.        if (Spell) {
  268.            while (!WineCheck()) {
  269.                status = "Waiting for Wine";
  270.                if (antiban) antiBan();
  271.                wait(random(200, 400));
  272.                if (!Bot.getClient().isSpellSelected()) {
  273.                    return;
  274.                }
  275.                if (getMyPlayer().isInCombat()) {
  276.                    runAway();
  277.                    return;
  278.                }
  279.            }
  280.            if (WineCheck()) {
  281.                if (ClickedWine()) {
  282.                    while (getMyPlayer().getAnimation() != -1) {
  283.                        wait(random(200, 500));
  284.                    }
  285.                    count++;
  286.                    Spell = false;
  287.                }
  288.            }
  289.        }
  290.    }
  291.  
  292.    /* Old Function, too slow */
  293.    public boolean GetWine() {
  294.        if (WineCheck()) {
  295.            ClickSpell();
  296.            wait(random(200, 500));
  297.        }
  298.        if (Spell) {
  299.            if (WineCheck()) {
  300.                if (ClickedWine()) {
  301.                    while (getMyPlayer().getAnimation() != -1) {
  302.                        wait(random(200, 500));
  303.                    }
  304.                    Spell = false;
  305.                    return true;
  306.                }
  307.            }
  308.        }
  309.        if (!Spell) {
  310.            ClickSpell();
  311.            GetWine();
  312.            return true;
  313.        }
  314.        wait(random(200, 500));
  315.        return false;
  316.    }
  317.  
  318.    /* end old */
  319.    public boolean ClickedWine() {
  320.        status = "Grabbing Wine";
  321.        if (!Bot.getClient().isSpellSelected()) {
  322.            ClickSpell();
  323.            wait(random(200, 500));
  324.        }
  325.        RSItemTile WWW = getGroundItemByID(Wine);
  326.        if (WWW != null) {
  327.            RSTile tile = getGroundItemByID(Wine);
  328.            RSObject wine = getObjectAt(tile);
  329.            try {
  330.                if (WineCheck()) {
  331.                    mx = wine.getLocation().getScreenLocation().x + random(1, 3);
  332.                    my = wine.getLocation().getScreenLocation().y - random(9, 11);
  333.                    moveMouse(mx, my);
  334.                    wait(random(50, 150));
  335.                    clickMouse(true);
  336.                } else {
  337.                    return false;
  338.                }
  339.            } catch (Exception e) {
  340.            }
  341.            return true;
  342.        }
  343.        return false;
  344.    }
  345.  
  346.    public boolean WineCheck() {
  347.        RSItemTile WWW = getGroundItemByID(Wine);
  348.        if (WWW != null) {
  349.            return true;
  350.        }
  351.        return false;
  352.    }
  353.  
  354.    public boolean atLocation() {
  355.        if (distanceTo(InSide) < 4) {
  356.            return true;
  357.        }
  358.        return false;
  359.    }
  360.  
  361.    public boolean Walk(RSTile[] path) {
  362.        if (!getMyPlayer().isMoving() || distanceTo(getDestination()) <= 5)
  363.            return theWalker.walkTo(path, true);
  364.        return false;
  365.    }
  366.  
  367.    public void BankIt() {
  368.        status = "Getting to bank";
  369.        if (Tele && getInventoryCountID(Water) > 0 && distanceTo(new RSTile(2965, 3380)) > 26) {
  370.            castSpell(46);
  371.            while (getMyPlayer().getAnimation() != -1) {
  372.                wait(random(200, 500));
  373.            }
  374.            wait(random(800, 1500));
  375.        }
  376.        if (Walk(reversePath(To()))) {
  377.            wait(random(100, 300));
  378.            while (distanceTo(BankTile) < 5) {
  379.                if (bank.open()) {
  380.                    status = "Banking";
  381.                    wait(random(100, 300));
  382.                    bank.depositAllExcept(Not);
  383.                    wait(random(100, 300));
  384.                    if (getInventoryCountID(Law) < 28) {
  385.                        bank.withdraw(Law, no);
  386.                        wait(random(100, 300));
  387.                    }
  388.                    if (getInventoryCountID(Water) < 1 && Tele) {
  389.                        bank.withdraw(Water, no);
  390.                        wait(random(100, 300));
  391.                    }
  392.                    bank.close();
  393.                    return;
  394.                }
  395.            }
  396.        }
  397.    }
  398.  
  399.    public void runAway() {
  400.        status = "Running from Mages";
  401.        setRun(true);
  402.        wait(random(300, 500));
  403.        Walk(Run);
  404.        wait(random(300, 900));
  405.        Walk(reversePath(Run));
  406.        wait(random(300, 900));
  407.    }
  408.  
  409.    public int loop() {
  410.        if (canContinue()) {
  411.            clickContinue();
  412.        }
  413.        if (getInventoryCountID(Water) < 1 && Tele && atLocation()) {
  414.            stopScript();
  415.        }
  416.        if (getInventoryCountID(Law) < 1 && atLocation()) {
  417.            stopScript();
  418.        }
  419.        if (getMyPlayer().isInCombat()) {
  420.            runAway();
  421.            return random(100, 400);
  422.        }
  423.        if (isInventoryFull()) {
  424.            BankIt();
  425.            return random(100, 400);
  426.        }
  427.        if (!atLocation() && !isInventoryFull()) {
  428.            if (Walk(To())) {
  429.                walkTileMM(InSide);
  430.                return random(100, 400);
  431.            }
  432.        }
  433.        GrabWine();
  434.        /* Old Method stuff
  435.       if(!WineCheck() && atLocation() && !isInventoryFull() && !Reloaded){
  436.       antiBan();
  437.       return random(300,600);
  438.       }
  439.        if(WineCheck() && atLocation() && !isInventoryFull() && !Reloaded)
  440.        {
  441.           if(!GetWine()){
  442.          return 1;
  443.          }
  444.          return random(200,300);
  445.        }*/
  446.        return random(200, 300);
  447.    }
  448.  
  449.    public void serverMessageRecieved(final ServerMessageEvent e) {
  450.        final String messageEvent = e.getMessage();
  451.        if (messageEvent.contains("oo late")) {
  452.            count--;
  453.        }
  454.    }
  455.  
  456.    public int antiBan() {
  457.        final int ranNo = random(0, 55);
  458.        int angle;
  459.        switch (ranNo) {
  460.            case 3:
  461.                moveMouse(random(0, 700), random(0, 500));
  462.                return random(200, 400);
  463.            case 4:
  464.                moveMouse(random(0, 450), random(0, 400));
  465.                return random(200, 400);
  466.        }
  467.        return random(200, 450);
  468.    }
  469.  
  470.    public int getInventoryCountID(final int... itemIDs) {
  471.        int total = 0;
  472.  
  473.        for (final RSItem item : getInventoryItems()) {
  474.            if (item == null) {
  475.                continue;
  476.            }
  477.  
  478.            for (final int ID : itemIDs) {
  479.                if (item.getID() == ID) {
  480.                    total += item.getStackSize();
  481.                }
  482.            }
  483.        }
  484.  
  485.        return total;
  486.    }
  487.  
  488.    @Override
  489.    public void onFinish() {
  490.    }
  491.  
  492.    public int speed = 10;
  493.  
  494.    public void getMouseSpeed(final int speed) {
  495.        this.speed = speed;
  496.        getMouseSpeed();
  497.    }
  498.  
  499.    protected int getMouseSpeed() {
  500.        return speed;
  501.    }
  502.  
  503.    public class TheWalker {
  504.  
  505.        final Methods methods = new Methods();
  506.        Thread walker = null;
  507.        RSTile[] path = null;
  508.  
  509.        public void drawMap(final Graphics g) {
  510.            if (walker != null && walker.isAlive()) {
  511.                Point myTile = tileToMinimap(getMyPlayer().getLocation());
  512.                Point center = new Point(myTile.x + 2, myTile.y + 2);
  513.                g.drawOval(center.x - 70, center.y - 70, 140, 140);
  514.                if (path == null) return;
  515.                for (int i = 0; i < path.length; i++) {
  516.                    final RSTile tile = path[i];
  517.                    final Point p = tileToMinimap(tile);
  518.                    if (p.x != -1 && p.y != -1) {
  519.                        g.setColor(Color.BLACK);
  520.                        g.fillRect(p.x + 1, p.y + 1, 3, 3);
  521.                        if (i > 0) {
  522.                            final Point p1 = tileToMinimap(path[i - 1]);
  523.                            g.setColor(Color.ORANGE);
  524.                            if (p1.x != -1 && p1.y != -1)
  525.                                g.drawLine(p.x + 2, p.y + 2, p1.x + 2, p1.y + 2);
  526.                        }
  527.                    }
  528.                }
  529.                Point tile = tileToMinimap(nextTile(path));
  530.                g.setColor(Color.RED);
  531.                if (tile.x != -1 && tile.y != -1) {
  532.                    g.fillRect(tile.x + 1, tile.y + 1, 3, 3);
  533.                }
  534.                g.setColor(Color.BLACK);
  535.            }
  536.        }
  537.  
  538.        public boolean walkTo(final RSTile[] path, final boolean waitUntilDest) {
  539.            Walker walkto = new Walker(path, 3, 10000);
  540.            walker = new Thread(walkto);
  541.            walker.start();
  542.            waitToMove(random(800, 1200));
  543.            if (waitUntilDest) {
  544.                while (walker.isAlive()) {
  545.                    methods.wait(random(300, 600));
  546.                }
  547.                return walkto.done;
  548.            } else return true;
  549.        }
  550.  
  551.        public Point tileToMM(RSTile tile) {
  552.            return new Point(tileToMinimap(tile).x + 2, tileToMinimap(tile).y + 2);
  553.        }
  554.  
  555.        public boolean tileOnMM(RSTile tile) {
  556.            return pointOnMM(tileToMM(tile));
  557.        }
  558.  
  559.        public boolean pointOnMM(Point point) {
  560.            Point myTile = tileToMM(getMyPlayer().getLocation());
  561.            Point center = new Point(myTile.x, myTile.y);
  562.            return (center.distance(point) < 70) ? true : false;
  563.        }
  564.  
  565.        public RSTile getClosestTileOnMap(final RSTile tile) {
  566.            if (isLoggedIn() && !tileOnMM(tile)) {
  567.                try {
  568.                    final RSTile loc = getMyPlayer().getLocation();
  569.                    final RSTile walk = new RSTile((loc.getX() + tile.getX()) / 2, (loc.getY() + tile.getY()) / 2);
  570.                    return tileOnMM(walk) ? walk : getClosestTileOnMap(walk);
  571.                } catch (final Exception e) {
  572.                }
  573.            }
  574.            return tile;
  575.        }
  576.  
  577.        public RSTile nextTile(RSTile[] path) {
  578.            for (int i = path.length - 1; i >= 0; i--) {
  579.                if (tileOnMM(path[i])) {
  580.                    return path[i];
  581.                }
  582.            }
  583.            return getClosestTileOnMap(path[0]);
  584.        }
  585.  
  586.        public class Walker implements Runnable {
  587.  
  588.            RSTile tile = null;
  589.            boolean done = false;
  590.            boolean stop = false;
  591.            int movementTimer = 10000;
  592.            int distanceTo = 3;
  593.  
  594.            Walker(final RSTile[] userpath) {
  595.                this.tile = userpath[userpath.length - 1];
  596.                path = userpath;
  597.            }
  598.  
  599.            Walker(final RSTile[] userpath, final int distanceTo, final int movementTimer) {
  600.                this.tile = userpath[userpath.length - 1];
  601.                this.movementTimer = movementTimer;
  602.                this.distanceTo = distanceTo;
  603.                path = userpath;
  604.            }
  605.  
  606.            public void run() {
  607.                long timer = System.currentTimeMillis();
  608.                RSTile lastTile = getMyPlayer().getLocation();
  609.                int randomReturn = random(5, 8);
  610.                while (distanceTo(tile) > distanceTo && !stop) {
  611.                    if (!getMyPlayer().isMoving() || getDestination() == null || distanceTo(getDestination()) < randomReturn) {
  612.                        RSTile nextTile = nextTile(path);
  613.                        if (getDestination() != null && distanceBetween(getDestination(), nextTile) <= distanceTo) {
  614.                            continue;
  615.                        }
  616.                        getMouseSpeed(random(6, 8));
  617.                        walkTileMM(nextTile);
  618.                        getMouseSpeed(random(8, 10));
  619.                        waitToMove(random(800, 1200));
  620.                        randomReturn = random(5, 8);
  621.                    }
  622.                    final RSTile myLoc = getMyPlayer().getLocation();
  623.                    if (myLoc != lastTile) {
  624.                        if (distanceBetween(myLoc, lastTile) > 30) {
  625.                            stop = true;
  626.                        }
  627.                        timer = System.currentTimeMillis();
  628.                        lastTile = myLoc;
  629.                    }
  630.                    if (System.currentTimeMillis() - timer > movementTimer) {
  631.                        stop = true;
  632.                    }
  633.                    methods.wait(random(20, 40));
  634.                }
  635.                if (distanceTo(tile) <= distanceTo) {
  636.                    done = true;
  637.                }
  638.            }
  639.  
  640.        }
  641.  
  642.    }
  643. }
Jul 26 '10 #1
1 2493
chaarmann
785 Expert 512MB
And the second?
Please reduce your code by commenting out all lines that have nothing to do with the problem. If one dog is ill, I don't show up with my whole animal farm at the doctor.
You already know which line the error is, you also know the error message, so please list it here. Then I don't need to guess and then I am able to give you a precise answer that solves your problem.
Jul 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Bjorn Jensen | last post by:
Hi! An beginner question: Pleas help me with this (-: Error (the arrow points on the s in sqrt) ===== tal.java:6: cannot find symbol symbol : method sqrt(int) location: class tal...
3
by: parasnshah | last post by:
Hii guys, I am just a begineer and need help on this error ERROR: symbol : method showMessageDialog(<nulltype>,java.lang.String,double,java.lang.String,int) location: class...
4
by: jingchua | last post by:
Hi, can anyone help out here???? I have the below error after compling the file. Any idea what is wrong in the declaration that was done in the above code??? Appreciate any help on shedding some...
1
by: Elaine121 | last post by:
Hi i'm writing a program where you have to determine the smallest, number of distinctions and the average from an array of values. in my test class i get an error that says cannot find symbol -...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
15
by: Seral1969 | last post by:
Hi, I'm new to Java... I've been trying to get one of my professor's examples to work... He says that the code is fine, but I keep getting 4 "cannot resolve symbol" errors when I try to compile...
2
suzee_q00
by: suzee_q00 | last post by:
Compiler seems to be hanging up on "new" but I know it isn't but I can't seem to figure out what it is that it doesn't like. Been chasing my tail for the last couple of days. Any help would be...
2
by: JavaNewBe | last post by:
i encountered this problem, yet as much as i tried, could not find the source to this error. import java.util.*; import java.io.*; public class billing { public static void main(String...
4
by: LadiPrather | last post by:
These error say there is not symbols, I have changed them some many times till I am lost. Please someone help. JOptionPane.showMessageDialog(null,"Oringinal Balance = $" + recieveAmount + ...
1
by: monkey0525 | last post by:
I'm writing a program that reads information from three seperate classes. Here is my code: public class Animal { protected int id; protected String type; protected double mass; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.