@@ -13,7 +13,7 @@ The task in the example of below runs with an interval of `2`, i.e. it will be e
13
13
``` ts
14
14
this .taskScheduler .addTask (new class extends Task {
15
15
public constructor () {
16
- super (2 );
16
+ super ({ interval: 2 } );
17
17
}
18
18
19
19
public execute(): void {
@@ -24,46 +24,68 @@ this.taskScheduler.addTask(new class extends Task {
24
24
25
25
Every two times that ` taskScheduler.tick() ` is called, it will run the ` execute ` function of your task.
26
26
27
- jkm progress notes below:
27
+ # Implementing this into RuneJS
28
28
29
- ## Features
29
+ ## Task System
30
30
31
31
- Tick-based task scheduler :heavy_check_mark :
32
32
- Delay task :heavy_check_mark :
33
33
- Repeating task :heavy_check_mark :
34
34
- Schedule tasks on world :heavy_check_mark :
35
35
- Schedule tasks on players/npcs :heavy_check_mark :
36
36
- Task stacking :heavy_check_mark :
37
- - Task breaking on walking :x :
38
- - Task delay until arriving :x :
37
+ - Task breaking on walking :heavy_check_mark :
38
+ - Task delay until arriving :heavy_check_mark :
39
39
40
40
### Subtasks
41
41
42
- - Actor task :yellow_square :
43
- - Handle break on move :x :
42
+ #### Actor
43
+
44
+ - Actor task :heavy_check_mark :
45
+ - Handle break on move :heavy_check_mark :
44
46
- Actor to actor interaction task :think: :x :
45
- - Handle walkto
46
- - Keep track of interaction distance and stop if exceeded
47
- - Actor to world item interaction task :think: :x :
48
- - as above
47
+ - Handle walkto :x :
48
+ - Keep track of interaction distance and stop if exceeded :x :
49
+ - Actor to world item interaction task :heavy_check_mark :
50
+ - Handle walkto :heavy_check_mark :
51
+ - Keep track of interaction distance and stop if exceeded :heavy_check_mark :
49
52
- Actor to object interaction task :think: :x :
50
- - as above (maybe need some generic Actor to entity interaction task)
53
+ - (maybe need some generic Actor to entity interaction task)
54
+ - Handle walkto :x :
55
+ - Keep track of interaction distance and stop if exceeded :x :
56
+
57
+ #### World
51
58
52
- - world abstraction for spawnObject, removeObject, spawnItem
59
+ - World task :yellow_square :
60
+ - Spawn game object task :x :
61
+ - Remove game object task :x :
62
+ - Spawn world item task :x :
63
+ - Remove world item task :x :
53
64
54
65
### Content
55
66
56
- Migrate the below content to use task system
67
+ Highest priority is to convert pieces of content which make use of the old ` task ` system. These are:
68
+
69
+ - Magic attack :x :
70
+ - Magic teleports :x :
71
+ - Prayer :yellow_square :
72
+ - ensure that one-tick pray flicking works. Speak to @jameskmonger if you want to implement this and need guidance
73
+ - Combat :x :
74
+ - this one is quite broken and may not be so easy to port across
75
+ - Forging (smithing) :x :
76
+ - Woodcutting :yellow_square :
77
+ - Time to cut :heavy_check_mark :
78
+ - Replace tree with treestump :yellow_square :
79
+ - Replace treestump with tree :yellow_square :
80
+
81
+ The following areas will make interesting use of the task system and would serve as a good demonstration:
82
+
57
83
- Health regen :x :
58
84
- NPC movement :x :
59
85
- Firemaking :yellow_square :
60
86
- logs in inventory :heavy_check_mark :
61
87
- logs on ground :heavy_check_mark :
62
88
- all log types :yellow_square :
63
- - Woodcutting :x :
64
- - Melee combat :x :
65
- - Home teleport :x :
66
-
67
- also don't forget
89
+ - spawn ashes :x :
68
90
69
- - Anything @gruckion is working on : yellow_square : : wink :
91
+ Also any content @gruckion is working on will be using the new Task system to aid with development of the API
0 commit comments