1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with Task

Discussion in 'Developer Support' started by Grumble, Dec 30, 2014.

  1. Grumble

    Grumble Don't hate the player, hate the game

    Joined:
    May 8, 2014
    Messages:
    99
    Likes Received:
    19
    Hi,
    I am currently making a script bot that's using Tasks.I got 3 tasks now and if I try to implent 1 task it gives an error.I have the right import.
    [​IMG]

    Here goes the error;
    [​IMG]

    I don't know why,but they're all tasks.

    [​IMG]
    I know the code isnt good at the Task right now,don't blame for this.

     
  2. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    79
    Is WalkToMine in the same package as your main script bot? If not, is it imported? If not, import it manually.
    Also, all classes should start with an uppercase. mineClay and bankClay should be MineClay and BankClay.
     
  3. Grumble

    Grumble Don't hate the player, hate the game

    Joined:
    May 8, 2014
    Messages:
    99
    Likes Received:
    19
    WalkToMine is in the same package as my main script bot,yes.
     
  4. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    79
    This probably isn't your fault because my Eclipse had the same problem an hour ago. It might go away by itself later. Or you could exit Eclipse and reopen it and see if the problem persists.
     
  5. Grumble

    Grumble Don't hate the player, hate the game

    Joined:
    May 8, 2014
    Messages:
    99
    Likes Received:
    19
    I restarted 2 times already Eclipse.It's weird.I wait my time out like you said,maybe Cloud can look into this.
     
  6. Infinite Inferno

    Infinite Inferno The Pip Collector

    Joined:
    Sep 14, 2014
    Messages:
    445
    Likes Received:
    122
    Eclipse = cancer. Switch to IntelliJ
     
  7. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    79
    It's definitely not an API bug. Try putting it in a different package (tasks should be in a subpackage anyway) and importing.
     
  8. Grumble

    Grumble Don't hate the player, hate the game

    Joined:
    May 8, 2014
    Messages:
    99
    Likes Received:
    19
    Problem has been fixed.Found it out.


    CLOSE
     
  9. Kenneh

    Joined:
    Apr 17, 2014
    Messages:
    19
    Likes Received:
    2
    Funfact, you can replace your whole for loop with this one line.

    tasks.stream().filter(Task::validate).forEach(Task::execute);
     
    Grumble likes this.
  10. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    79
    What was the issue?

    Also, a TaskScript's onLoop is final, so you can't override it. You should use a TaskScript if you're using Tasks and not doing anything special with the onLoop.
     
  11. Grumble

    Grumble Don't hate the player, hate the game

    Joined:
    May 8, 2014
    Messages:
    99
    Likes Received:
    19
    I did place my task wrong,I tried to put it elsewhere and now it works.It's still weird but it works.
     

Share This Page

Loading...