-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyaro-summon.muf
101 lines (96 loc) · 4.69 KB
/
yaro-summon.muf
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
@q
@program yaro-summon.muf
1 99999 del
i
$include $lib/yaro
: doSummon ( s -- )
var player_name
dup if
dup pmatch dup case
ok? not when "I don't recognize a player named \"" rot strcat "!\"" strcat me @ swap error_color tell end
player? not when "I don't recognize a player named \"" rot strcat "!\"" strcat me @ swap error_color tell end
awake? not when swap pop name " is not awake." strcat me @ swap error_color tell end
me @ = when me @ "Summoning yourself?" error_color tell end
default
name player_name ! swap pop me @ "summon/join_req" getConfig dup if
dup "_" rinstr strcut swap dup strlen 1 - strcut pop swap
atoi systime swap - 600 > not over pmatch 4 pick = and if
pop dup loc @ moveto
"_config/summon" remove_prop
me @ "_config/summon" remove_prop
me @ "Summoned." note_color tell
me @ location getPlayers pop pop foreach swap pop
dup player_name @ " has been summoned into the room." strcat note_color otell
repeat
exit
else
pop dup "summon/summon_req" me @ name "_" strcat systime intostr strcat setConfig
dup dup me @ name " has just sent you a summon request. Type 'mjoin " strcat me @ name strcat "' to accept." strcat
info_color otell
name "You have sent a summon request to " swap strcat me @ swap note_color tell
then
else
pop dup "summon/summon_req" me @ name "_" strcat systime intostr strcat setConfig
dup dup me @ name " has just sent you a summon request. Type 'mjoin " strcat me @ name strcat "' to accept." strcat
info_color otell
name "You have sent a summon request to " swap strcat me @ swap note_color tell
then
end
endcase
else
pop me @ "Who do you wish to summon?" error_color tell
then
;
: doJoin ( s -- )
dup if
dup pmatch dup case
ok? not when "I don't recognize a player named \"" rot strcat "!\"" strcat me @ swap error_color tell end
player? not when "I don't recognize a player named \"" rot strcat "!\"" strcat me @ swap error_color tell end
awake? not when swap pop name " is not awake." strcat me @ swap error_color tell end
me @ = when me @ "Joining yourself?" error_color tell end
default
pop swap pop me @ "summon/summon_req" getConfig dup if
dup "_" rinstr strcut swap dup strlen 1 - strcut pop swap
atoi systime swap - 600 > not over pmatch 4 pick = and if
pop dup location me @ swap moveto
"_config/summon" remove_prop
me @ "_config/summon" remove_prop
me @ "Joined." note_color tell
me @ location getPlayers pop pop foreach swap pop
dup me @ name " has been summoned into the room." strcat note_color otell
repeat
exit
else
pop dup "summon/join_req" me @ name "_" strcat systime intostr strcat setConfig
dup dup me @ name " has just sent you a join request. Type 'msummon " strcat me @ name strcat "' to accept." strcat
info_color otell
name "You have sent a join request to " swap strcat me @ swap note_color tell
then
else
pop dup "summon/join_req" me @ name "_" strcat systime intostr strcat setConfig
dup dup me @ name " has just sent you a join request. Type 'msummon " strcat me @ name strcat "' to accept." strcat
info_color otell
name "You have sent a join request to " swap strcat me @ swap note_color tell
then
end
endcase
else
pop me @ "Who do you wish to join?" error_color tell
then
;
: main ( s -- )
command @ case
"msummon" stringcmp not when doSummon exit end
"mjoin" stringcmp not when doJoin exit end
default
me @ "Please tell "
trigger @ owner name strcat
" that there is a bad command linked to the program " strcat
prog name strcat " called " strcat command @ strcat "." strcat
error_color tell
end
endcase
;
.
c
q