scheduler.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. //giveItem
  61. if(action == 8) {
  62. player = a[2];
  63. item = a[3];
  64. player.safeGiveItem(player, item);
  65. }
  66. //giveSingleItem
  67. if(action == 9) {
  68. player = a[2];
  69. item = a[3];
  70. boolean = a[4];
  71. player.giveSingleItem(player, item, boolean);
  72. }
  73. remove(iter);
  74. }
  75. }
  76. sgoto(2, "loop");
  77. wait();