Date: 2013/11/24 19:39:11 UTC-08: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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"RPcmds":
type: world
events:
on linkup command:
- if <context.arg.get[1]> == add {
- if <player.has_permission[linkup.edit]> == false {
- narrate "<&c>You do not have the permission to do this."
- determine fulfilled
- queue clear
}
- if <context.arg.get[2]> == null {
- narrate "<&c>You must specify a channel name!"
- narrate "<&9> /linkup add <<>channel<>>"
- determine fulfilled
- queue clear
}
- if <player.location.cursor_on.material> == wood_button || <player.location.cursor_on.material> == stone_button || <player.location.cursor_on.material> == wood_pressureplate || <player.location.cursor_on.material> == stone_pressureplate || <player.location.cursor_on.material> == lever {
- flag global linkup<context.arg.get[2]>:+:<player.location.cursor_on>
- flag global:linkupchannels:+:<context.arg.get[2]>
- narrate "<&9>Your device has been stored to channel '<context.arg.get[2]>'"
- determine fulfilled
- queue clear
} else {
- narrate "<&c>You must be targeting a switch."
- determine fulfilled
- queue clear
}
}
- if <context.arg.get[1]> == remove {
- if <player.has_permission[linkup.edit]> == false {
- narrate "<&c>You do not have the permission to do this."
- determine fulfilled
- queue clear
}
- if <context.arg.get[2]> == null {
- narrate "<&c>You must specify a channel name or '-all' for all channels"
- narrate "<&9> /linkup add <<>channel/-all<>>"
- determine fulfilled
- queue clear
}
- if <player.location.cursor_on.material> == wood_button || <player.location.cursor_on.material> == stone_button || <player.location.cursor_on.material> == wood_pressureplate || <player.location.cursor_on.material> == stone_pressureplate || <player.location.cursor_on.material> == lever {
- if contect.arg.get[2] == -all {
- foreach <server.flag[linkupchannels]> {
- flag global linkup%value%:-:<player.location.cursor_on>
}
- determine fulfileld
- queue clear
} else {
- flag global linkup<context.arg.get[2]>:-:<player.location.cursor_on>
- narrate "<&9>Your device has been removed from channel '<context.arg.get[2]>'"
- determine fulfilled
- queue clear
}
} else {
- narrate "<&c>You must be targeting a switch."
- determine fulfilled
- queue clear
}
}
- if <context.arg.get[1]> == check {
- if <player.has_permission[linkup.check]> == false {
- narrate "<&c>You do not have the permission to do this."
- determine fulfilled
- queue clear
}
- foreach <server.flag[linkupchannels]> {
- if <server.flag[linkup%value%]> contains <player.location.cursor_on> narrate "<&9>This button is linked to channel '%value%'"
}
- determine fulfilled
- queue clear
} else {
- narrate ""
- narrate "<&c>usage<&co> /linkup add <>>channel<<>"
- narrate "<&9>description<&co> Adds the switch you're looking at to the specified channel."
- narrate "<&c>usage<&co> /linkup remove <>>channel/-all<<>"
- narrate "<&9>description<&co> removes the switch you're looking at from the specified channel or all channels."
- narrate "<&c>usage<&co> /linkup check"
- narrate "<&9>description<&co> Returns which channels the switch you're looking at is linked to."
- determine fulfilled
- queue clear
}