scheduler.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. list = list.new();
  2. setScriptVar("scheduler_list", list);
  3. msg("dev", "§bScheduler §rloaded.");
  4. @loop
  5. iter = list.iterator(list);
  6. while(hasNext(iter)) {
  7. a = next(iter);
  8. ticks = --a[1];
  9. if(ticks <= 0) {
  10. action = a[0];
  11. //Fly verändern
  12. if(action == 0) {
  13. player = a[2];
  14. bool = a[3];
  15. player.setFly(player, bool);
  16. }
  17. //Msg Prefix
  18. if(action == 1) {
  19. player = a[2];
  20. prefix = a[3];
  21. message = a[4];
  22. msg.prefix(player, prefix, message);
  23. }
  24. //Msg
  25. if(action == 2) {
  26. player = a[2];
  27. message = a[3];
  28. msg(player, message);
  29. }
  30. //SetBlock
  31. if(action == 3) {
  32. location = a[2];
  33. item_string = a[3];
  34. block_update = a[4];
  35. block.set(location, item_string, block_update);
  36. }
  37. //QuestFinish
  38. if(action == 4) {
  39. script = a[2];
  40. player = a[3];
  41. quest.finish(script, player);
  42. }
  43. //setBurning
  44. if(action == 5) {
  45. entity = a[2];
  46. seconds = a[3];
  47. entity.setBurning(entity, seconds);
  48. }
  49. //spawnEntity
  50. if(action == 6) {
  51. type = a[2];
  52. location = a[3];
  53. entity.spawn(type, location);
  54. }
  55. //removeEntity
  56. if(action == 7) {
  57. entity = a[2];
  58. entity.remove(entity);
  59. }
  60. remove(iter);
  61. }
  62. }
  63. sgoto(1, "loop");
  64. wait();