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:
    84
    Likes Received:
    15
    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:
    78
    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:
    84
    Likes Received:
    15
    WalkToMine is in the same package as my main script bot,yes.
     
  4. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    78
    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:
    84
    Likes Received:
    15
    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:
    442
    Likes Received:
    122
    Eclipse = cancer. Switch to IntelliJ
     
  7. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    78
    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:
    84
    Likes Received:
    15
    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:
    78
    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:
    84
    Likes Received:
    15
    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...