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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
|
//===== rAthena Script =======================================
//= Message Man
//===== By: ==================================================
//= Vicious
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= a message board where you can post and read messages
//===== Additional Comments: =================================
//=
//============================================================
geffen,122,102,4 script Message Man 774,{
mes "[Robert]";
mes "Hello, I am here to serve you. Enjoy my service. ^_-";
next;
mes "[Robert]";
mes "Please keep in mind, that all messages are wiped once every two days";
mes "-Msg From Creator- In new version this will be set able, look forward to this! -End Msg From Creator-";
next;
L_Menu01:
mes "[Robert]";
mes "What would you like to do??";
next;
if((getgmlevel() >= 90)) menu "Public board",L_pubgmmenu,"Gm Board",L_gmmenu,"Close Public Board",L_clospub,"Open Public Board",L_openpub;
if(($messagepubclose == 1)) goto L_pubclosed;
menu "Read messages!",L_readmsg,"Post a message!",L_Postmsg,"Leave",L_leave;
L_pubgmmenu:
if(($messagepubclose == 1)) goto L_pubclosed;
menu "Re-set the rotation",L_setrot,"Reset Message",L_Clearmsgs,"Read messages!",L_readmsg,"Post a message!",L_Postmsg,"Leave",L_leave;
L_gmmenu:
menu "Read messages!",L_gmboardread,"Post a Message!",L_gmboardpost,"Reset Messages",L_gmboardreset;
L_openpub:
mes "[Robert]";
mes "Are you sure?";
menu "Yes",-,"No",L_openpubn;
mes "[Robert]";
mes "It is done.";
close2;
set $messagepubclose,0;
end;
L_openpubn:
mes "[Robert]";
mes "Very well it shall remain closed.";
close;
L_pubclosed:
mes "[Robert]";
mes "Im sorry. The public boards are currently Closed.";
close;
L_clospub:
mes "[Robert]";
mes "Are you sure?";
next;
menu "Yes.",-,"No",L_closepubn;
mes "[Robert]";
mes "Very well I will not allow anyone into the public board.";
close2;
set $messagepubclose,1;
end;
L_closepubn:
mes "[Robert]";
mes "Have a nice day";
close;
L_gmboardreset:
mes "[Robert]";
mes "This will require atleast 2 GM's approval to reset the gm board.";
mes "-Msg From Creator- This is bugged same gm can vote twice. Planned to revise in next version. -End Msg From Creator-";
next;
menu "Vote for reset.",L_gmboardresetvote,"Back to main.",L_Menu01,"Leave.",L_leave;
L_gmboardresetvote:
callfunc "F_gmresetcheck";
set @tempid,getcharid(0);
set $gmboardresetvotenumb,$gmboardresetvotenumb+1;
set $gmboardresetvoted[$gmboardresetvotenumb],1;
set $gmboardresetvoteid[$gmboardresetvotenumb],@tempid;
set @tempid,0;
set $gmboardreset,$gmboardreset-1;
mes "[Robert]";
mes "Thank you.";
next;
if(($gmboardreset == 0)) goto L_gmresetdone;
if(($gmboardreset >= 1)) goto L_gmresetnotdone;
close;
L_gmresetdone:
deletearray $gmmessageboardpost$[1],$gmmessageboardpostnumber;
deletearray $gmmessageboardpostdate$[1],$gmmessageboardpostnumber;
deletearray $gmmessageboardpostname$[1],$gmmessageboardpostnumber;
deletearray $gmmessageboardeditdate$[1],$gmmessageboardpostnumber;
deletearray $gmboardresetvoted[1],$gmboardresetvotenumber;
deletearray $gmboardresetvoted[1],$gmboardresetvotenumber;
deletearray $gmboardresetvoteid[1],$gmboardresetvotenumber;
set $gmboardresetvotenumber,0;
set $gmboardreset,2;
mes "[Robert]";
mes "The reset has been done.";
close;
L_gmresetnotdone:
mes "[Robert]";
mes "There needs to be "+$gmboardreset+" more gm(s) approval to do the reset.";
close;
L_gmboardread:
if(($gmmessageboardpostnumber == 0)) goto L_msgno;
callfunc "F_gmmessage";
end;
L_gmboardpost:
if(($gmmessageboardpostnumber >= 127)) goto L_postmsgyestm;
set @gmmessageboardpostername$,strcharinfo(0);
set @gmmessageboarddate$,gettimestr("%Y-%m/%d %H:%M:%S",21);
set $gmmessageboardpostnumber,$gmmessageboardpostnumber+1;
input @gmmsgboardmsgt$;
set $gmmessageboardpost$[$gmmessageboardpostnumber],@gmmsgboardmsgt$;
set $gmmessageboardpostdate$[$gmmessageboardpostnumber],@gmmessageboarddate$;
set $gmmessageboardpostname$[$gmmessageboardpostnumber],@gmmessageboardpostername$;
mes "[Robert]";
mes "Here is what your message looks like";
next;
mes "Posted by: "+$gmmessageboardpostname$[$gmmessageboardpostnumber]+".";
mes "On: "+$gmmessageboardpostdate$[$gmmessageboardpostnumber]+".";
mes $gmmessageboardpost$[$gmmessageboardpostnumber];
close;
L_setrot:
set $@determinedayrotation,gettime(4); //this determines the day rotation for clearing messages.
if(($@determinedayrotation == 0)) set $rotation,0;
if(($@determinedayrotation == 1)) set $rotation,1;
if(($@determinedayrotation == 2)) set $rotation,0;
if(($@determinedayrotation == 3)) set $rotation,1;
if(($@determinedayrotation == 4)) set $rotation,0;
if(($@determinedayrotation == 5)) set $rotation,1;
if(($@determinedayrotation == 6)) set $rotation,0;
mes "It is done.";
close;
L_Clearmsgs:
mes "[Robert]";
mes "Are you sure?";
next;
menu "Yes",L_clearmsgsy,"No thanks.",L_Menu01;
L_clearmsgsy:
deletearray $messageboardpost$[1],$messageboardpostnumber;
deletearray $messageboardpostdate$[1],$messageboardpostnumber;
deletearray $messageboardpostname$[1],$messageboardpostnumber;
deletearray $messageboardeditdate$[1],$messageboardpostnumber;
deletearray $mymessage[1],$messageboardpostnumber;
set $messageboardpostnumber,0;
mes "[Robert]";
mes "It is done.";
close;
L_leave:
close;
L_Postmsg:
mes "[Robert]";
mes "What do you want to say in your message?";
next;
set @msgboardmsgt$,0;
input @msgboardmsgt$;
mes "[Robert]";
mes "are you sure this is the message you want?";
mes @msgboardmsgt$;
next;
menu "Yes!",L_postmsgyes,"No let me re-do it!",L_Postmsg,"Ive changed my mind let me leave.",lleave;
L_postmsgyes:
if(($messageboardpostnumber >= 127)) goto L_postmsgyestm;
set @messageboardpostername$,strcharinfo(0);
set @messageboarddate$,gettimestr("%Y-%m/%d %H:%M:%S",21);
set $messageboardpostnumber,$messageboardpostnumber+1;
set @mymessage2,$messageboardpostnumber;
set $mymessage[$messageboardpostnumber],5;
set $messageboardpost$[$messageboardpostnumber],@msgboardmsgt$;
set $messageboardpostdate$[$messageboardpostnumber],@messageboarddate$;
set $messageboardpostname$[$messageboardpostnumber],@messageboardpostername$;
mes "[Robert]";
mes "here is what your message looks like";
next;
mes "Posted by: "+$messageboardpostname$[$messageboardpostnumber]+".";
mes "On: "+$messageboardpostdate$[$messageboardpostnumber]+".";
mes $messageboardpost$[$messageboardpostnumber];
close;
L_postmsgyestm:
set @mesboardmsgt$,0;
mes "[Robert]";
mes "Im sorry your going to have to wait till more space opens up for messages, it should be in 1 or 2 days =)";
close;
lleave:
deletearray $messageboardpost$[@tempview],@tempview;
deletearray $messageboardpostname$[@tempview],@tempview;
deletearray $messageboardpostdate$[@tempview],@tempview;
deletearray $mymessage[@tempview],@tempview;
set $messageboardpostnumber,$messageboardpostnumber-1;
set @msgboardmsgt$,0;
close;
L_readmsg:
if(($messageboardpostnumber == 0)) goto L_msgno;
callfunc "F_message";
end;
L_msgno:
mes "[Robert]";
mes "There are currently no messages.";
close;
OnInit:
set $gmboardreset,2;
set $gmboardresetvotenumb,0;
end;
OnInterIfInitOnce:
set $@determinedayrotation,gettime(4); //this determines the day rotation for clearing messages.
if(($@determinedayrotation == 0)) set $rotation,0;
if(($@determinedayrotation == 1)) set $rotation,1;
if(($@determinedayrotation == 2)) set $rotation,0;
if(($@determinedayrotation == 3)) set $rotation,1;
if(($@determinedayrotation == 4)) set $rotation,0;
if(($@determinedayrotation == 5)) set $rotation,1;
if(($@determinedayrotation == 6)) set $rotation,0;
end;
OnSun1200:
if(($rotation == 1)) end;
deletearray $messageboardpost$[1],$messageboardpostnumber;
deletearray $messageboardpostdate$[1],$messageboardpostnumber;
deletearray $messageboardpostname$[1],$messageboardpostnumber;
deletearray $mymessage[1],$messageboardpostnumber;
set $messageboardpostnumber,0;
end;
OnSat1200:
if(($rotation == 0)) end;
deletearray $messageboardpost$[1],$messageboardpostnumber;
deletearray $messageboardpostdate$[1],$messageboardpostnumber;
deletearray $messageboardpostname$[1],$messageboardpostnumber;
deletearray $mymessage[1],$messageboardpostnumber;
set $messageboardpostnumber,0;
end;
OnMon1200:
if(($rotation == 1)) end;
deletearray $messageboardpost$[1],$messageboardpostnumber;
deletearray $messageboardpostdate$[1],$messageboardpostnumber;
deletearray $messageboardpostname$[1],$messageboardpostnumber;
deletearray $mymessage[1],$messageboardpostnumber;
set $messageboardpostnumber,0;
end;
OnTue1200:
if(($rotation == 0)) end;
deletearray $messageboardpost$[1],$messageboardpostnumber;
deletearray $messageboardpostdate$[1],$messageboardpostnumber;
deletearray $messageboardpostname$[1],$messageboardpostnumber;
deletearray $mymessage[1],$messageboardpostnumber;
set $messageboardpostnumber,0;
end;
OnWed1200:
if(($rotation == 1)) end;
deletearray $messageboardpost$[1],$messageboardpostnumber;
deletearray $messageboardpostdate$[1],$messageboardpostnumber;
deletearray $messageboardpostname$[1],$messageboardpostnumber;
deletearray $mymessage[1],$messageboardpostnumber;
set $messageboardpostnumber,0;
end;
OnThu1200:
if(($rotation == 0)) end;
deletearray $messageboardpost$[1],$messageboardpostnumber;
deletearray $messageboardpostdate$[1],$messageboardpostnumber;
deletearray $messageboardpostname$[1],$messageboardpostnumber;
deletearray $mymessage[1],$messageboardpostnumber;
set $messageboardpostnumber,0;
end;
OnFri1200:
if(($rotation == 1)) end;
deletearray $messageboardpost$[1],$messageboardpostnumber;
deletearray $messageboardpostdate$[1],$messageboardpostnumber;
deletearray $messageboardpostname$[1],$messageboardpostnumber;
deletearray $mymessage[@tempview],@tempview;
set $messageboardpostnumber,0;
end;
}
function script F_gmresetcheck {
set @tempcheck,0;
L_top:
set @tempcheck,@tempcheck+1;
if(($gmboardresetvoted[@tempview] == 1)) goto L_votecheck;
if(($gmboardresetvoted[@tempview] == 0)) return;
goto L_top;
end;
L_votecheck:
set @tempcheckid,0;
set @tempcheckid,getcharid(0);
if(($gmboardresetvoteid[@tempview] != @tempcheckid)) goto L_top;
if(($gmboardresetvoteid[@tempview] == @tempcheckid)) goto L_voted;
end;
}
function script F_gmmessage {
set @tempview,0;
L_top:
set @tempview,@tempview+1;
mes "Posted By: "+$gmmessageboardpostname$[@tempview]+".";
mes "On: "+$gmmessageboardpostdate$[@tempview]+".";
mes $gmmessageboardpost$[@tempview]+".";
menu "Next Message",L_top2;
L_top2:
if(($gmmessageboardpostnumber > @tempview)) goto L_top;
close;
}
function script F_message {
set @tempview,0;
L_top:
set @tempview,@tempview+1;
mes "Posted By: "+$messageboardpostname$[@tempview]+".";
mes "On: "+$messageboardpostdate$[@tempview]+".";
mes $messageboardpost$[@tempview]+".";
next;
if(($mymessage[@tempview] == 5) && (getgmlevel()>0)) menu "Next Message",L_top2,"Delete My Message",L_delmy,"Edit my message",L_editmy,"Delete This message",L_Del;
if((getgmlevel()>0)) menu "Next Message",L_top2,"Delete This message",L_Del;
if(($mymessage[@tempview] == 5)) menu "Next Message",L_top2,"Delete My Message",L_delmy,"Edit my message",L_editmy;
menu "Next message",L_top2;
close;
L_editmy:
mes "Are you sure?";
next;
menu "Yes",L_editmyy,"No",L_editmyn;
L_editmyy:
mes "what do you want your new message to be?";
next;
mes "Current message!";
mes $messageboardpost$[@tempview];
set @tempeditmsg$,0;
input @tempeditmsg$;
next;
mes "is this what you want?";
mes @tempeditmsg$;
next;
menu "Yes!",L_editmyyy,"No.",L_editmyyn;
L_editmyyy:
deletearray $messageboardpost$[@tempview],@tempview;
set $messageboardpost$[@tempview],@tempeditmsg$;
mes "Here is what your new message looks like.";
next;
mes "Posted By: "+$messageboardpostname$[@tempview]+".";
mes "On: "+$messageboardpostdate$[@tempview]+".";
mes $messageboardpost$[@tempview]+".";
close2;
set @tempview,0;
end;
L_editmyn:
Mes "So be it.";
set @tempview,0;
close;
L_editmyyn:
mes "So be it!";
set @tempeditmsg$,0;
set @tempview,0;
close;
L_delmy:
mes "Are you sure...?";
next;
menu "Yes",L_delmyy,"No thanks.",L_delmyn;
L_delmyy:
deletearray $messageboardpost$[@tempview],@tempview;
deletearray $messageboardpostname$[@tempview],@tempview;
deletearray $messageboardpostdate$[@tempview],@tempview;
deletearray $mymessage[@tempview],@tempview;
deletearray $messageboardeditdate$[@tempview],@tempview;
set $messageboardpostnumber,$messageboardpostnumber-1;
set @tempview,0;
mes "It is done.";
close;
L_delmyn:
mes "Come back soon.";
set @tempview,0;
close;
L_top2:
if(($messageboardpostnumber > @tempview)) goto L_top;
close;
L_Del:
mes "Are you sure?";
next;
menu "Yes",L_Dely,"No",L_Deln;
L_Dely:
deletearray $messageboardpost$[@tempview],@tempview;
deletearray $messageboardpostname$[@tempview],@tempview;
deletearray $messageboardpostdate$[@tempview],@tempview;
deletearray $mymessage[@tempview],@tempview;
deletearray $messageboardeditdate$[@tempview],@tempview;
set $messageboardpostnumber,$messageboardpostnumber-1;
mes "It is done.";
set @tempview,0;
close;
L_Deln:
mes "Come back soon!";
set @tempview,0;
close;
}
|