Guest User

Untitled

a guest
Oct 23rd, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public int loop() {
  2. if (isPaused){
  3. return 100;
  4. }
  5. if (!walking.isRunEnabled()){
  6. walking.setRun(true);
  7. }
  8. commandBuffer.mark();
  9. if (!commandBuffer.hasRemaining()){
  10. return 20;
  11. }
  12. RSTile dest;
  13. switch(commandBuffer.get()){
  14. case CommandBuffer.COMMAND_FIGHT:
  15. if (requiredValue<=hitCount){
  16. if (canSafelyExit()){
  17. stopScript();
  18. }else {
  19. killingTime();
  20. return random(200,250);
  21. }
  22. return 100;
  23. }else{
  24. killingTime();
  25. return random(200,250);
  26. }
  27. case CommandBuffer.COMMAND_WALK:
  28. dest = new RSTile(commandBuffer.get(),commandBuffer.get());
  29. walkTo(dest);
  30. return 100;
  31. case CommandBuffer.COMMAND_PLANT:
  32. if (plantSeed()){
  33. return random(50,100);
  34. }
  35. else {
  36. return 10;
  37. }
  38. }
  39. return 10;
  40. }
Add Comment
Please, Sign In to add comment