Date: 2016/09/17 07:26:20 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
dTodoList:
type: command
name: dtodo
permission: dtodo
permission message: <&c>Sorry <player.name>, you don't have the permission to use this command.
usage: /dtodo <<>add/check<>>
description: A to-do list powered by Denizen.
allowed help:
- determine <player.has_permission[dtodo]>||<player.is_op>||<context.server>
aliases:
- todo
- task
script:
- choose <c.args.get[1]||null>:
- case add:
- if <c.args.get[2].to[99999].trim.length||0> == 0 {
- narrate "<&c>[dTO-DO] Please specify a name for the task you want to add."
- queue clear
}
- flag player "dtodo:->:<c.args.as_list.get[2].to[9999].space_separated>"
- narrate "<&d>[dTO-DO] The task has been added to your to-do list. You now have <player.flag[dtodo].as_list.size.round> to-do task listed."
- case check:
- if <c.args.get[2].trim.length||0> == 0 {
- narrate "<&c>[dTO-DO] Please specify the number of the task you want to check."
- queue clear
}
- if <player.has_flag[dtodo].not> {
- narrat "<&c>You don't have any task in your dtodo list right now. You can add one with <context.alias> add."
- queue clear
}
- if !<player.flag[dtodo].as_list.size> >= <c.args.get[2]> {
- narrate "<&c>You don't have any task at the line number <c.args.get[2]>. You have <pl.flag[dtodo].as_list.size.round> task in your to-do list. You can add more with <context.alias> add."
- queue clear
}
- flag player dtodo[<c.args.get[2]>]:<-:
- if <pl.has_flag[dtodo].not> {
- narrate "<&d>[dTO-DO] Great! Your to-do list is now empty. Create new task with '<context.alias> add'!"
- queue clear
}
- narrate "<&d>[dTO-DO] The task has been checked. You still have <pl.flag[dtodo].as_list.size.round> tasks to-do. Get back to work!"
- case null:
- if <player.has_flag[dtodo].not> {
- narrate "<&d>[dTO-DO] Your to-do list is empty right now. You can add tasks to it with <context.alias> add."
- narrate "<&d>[dTO-DO] When you wish to remove a task, do <context.alias> check [task_number]."
- queue clear
}
- narrate "<&a>###### YOUR dTO-DO LIST ######"
- foreach <player.flag[dtodo].as_list> {
- narrate "<yellow>- [%loop_index%] %value%"
}
dTodoList_Tracker:
type: world
events:
on system time hourly:
- webget "http://stats.denizenscript.com/tracker?script=112&version=1.0"