Filter:   InfoImg
download pwf.tcl
Language: Tcl
Copyright: (c)2002 kalhimeo - released under the BSD License ##
LOC: 1222
Project Info
xbot4 - The version of X-Bot to supercede ... 2003(xbot4)
Server: Google
Type: svn
...\bin\Debug\xTclLib\scripts\
   _BotnetStats1.9.desc
   _cutetopics100.desc
   _dict109.desc
   _entity92.desc
   _hangman101.desc
   _infobottcl.desc
   _jesusbot1.0.desc
   _jIRCserv-0.02n.desc
   _Lusers.desc
   _mp3list100.desc
   _MsgLog1.1.desc
   _mysqlseen1.1.desc
   _newtopics.desc
   _no.spam.desc
   _quizgod.desc
   _serials100.desc
   _skool101.desc
   _Split4.1.desc
   _thehelper100.desc
   _topicmaster1.1.desc
   _trivia.desc
   _UltramodeNews10.desc
   _UndernetCS.desc
   _userquotes100.desc
   _Veed_0.2.desc
   _WebBanList1.1.desc
   _words100.desc
   _zipcodes100.desc
   abuse100.desc
   abuse100.tcl
   action.fix.desc
   action.fix.tcl
   activech100.desc
   activech100.tcl
   adbseen192.desc
   Adbseen192.tcl
   addban10-mbti.desc
   addban10-mbti.tcl
   added140.desc
   Added140.tcl
   addicted100.desc
   addicted100.tcl
   advert105.desc
   advert105.tcl
   alice120.desc
   alice120.tcl
   alltools.desc
   alltools.tcl
   antiidle-narf-0.3.desc
   antiidle-narf-0.3.tcl
   auth103.desc
   auth103.tcl
   autolimit102.desc
   autolimit102.tcl
   autooper.desc
   autooper.tcl
   av.pubmsg.desc
   av.pubmsg.tcl
   bancheck.desc
   bancheck.tcl
   BanCount1.1.desc
   BanCount1.1.tcl
   BanTools1.2.desc
   BanTools1.2.tcl
   bitchxirix.desc
   bitchxirix.tcl
   bot-solutions.3.0.desc
   bot-solutions.3.0.tcl
   botping.desc
   botping.tcl
   bwscript20.desc
   bwscript20.tcl
   chancheck100.desc
   chancheck100.tcl
   ChanMax1.2.desc
   ChanMax1.2.tcl
   ChanPeak1.3.desc
   ChanPeak1.3.tcl
   chanrelay.desc
   chanrelay.tcl
   ClanAvail1.4.desc
   ClanAvail1.4.tcl
   ClanBase1.1.desc
   ClanBase1.1.tcl
   cmd_resolve.desc
   cmd_resolve.tcl
   compat.desc
   compat.tcl
   CopyVoice1.3.desc
   CopyVoice1.3.tcl
   cracks100.desc
   cracks100.tcl
   DALnetNews1.1.desc
   DALnetNews1.1.tcl
   date1.3.desc
   date1.3.tcl
   DateToDay1.0.desc
   DateToDay1.0.tcl
   daystill102.desc
   daystill102.tcl
   dccwatch104.desc
   dccwatch104.tcl
   Decide1.2.desc
   Decide1.2.tcl
   decide100.desc
   decide100.tcl
   define.desc
   define.tcl
   delhost1.01.desc
   delhost1.01.tcl
   delivery101.desc
   delivery101.tcl
   Dictionary1.1.desc
   Dictionary1.1.tcl
   DieAuth2.1.desc
   DieAuth2.1.tcl
   Dns2.5.desc
   Dns2.5.tcl
   DomainWhois1.2.desc
   DomainWhois1.2.tcl
   EFnetNews1.1.desc
   EFnetNews1.1.tcl
   egg-fu.1.7.desc
   egg-fu.1.7.tcl
   eggpad.desc
   eggpad.tcl
   englishonly102.desc
   englishonly102.tcl
   filerelay0.4.desc
   filerelay0.4.tcl
   fluxlearn1.5a.desc
   fluxlearn1.5a.tcl
   flyby101.desc
   flyby101.tcl
   gamble100.desc
   gamble100.tcl
   gamestar1.4.desc
   gamestar1.4.tcl
   GBan1.4.desc
   GBan1.4.tcl
   getops-2.6.desc
   getops-2.6.tcl
   getops.desc
   getops.tcl
   greeter101.desc
   greeter101.tcl
   guard101.desc
   guard101.tcl
   heise1.4.desc
   heise1.4.tcl
   HostSpy1.8.desc
   HostSpy1.8.tcl
   HostTools1.5.desc
   HostTools1.5.tcl
   HTMLOpVote2.0.desc
   HTMLOpVote2.0.tcl
   ident.desc
   ident.tcl
   ieXbeta1.1.desc
   ieXbeta1.1.tcl
   ilc100.desc
   ilc100.tcl
   infoegg-v1-3.desc
   infoegg-v1-3.tcl
   insult101.desc
   insult101.tcl
   inv.desc
   inv.tcl
   irco-fuckem.desc
   irco-fuckem.tcl
   irco-muh.desc
   irco-muh.tcl
   irco-psybnc.desc
   irco-psybnc.tcl
   irco-scanport.desc
   irco-scanport.tcl
   irco-soundkick.desc
   irco-soundkick.tcl
   irco-wingateban.desc
   irco-wingateban.tcl
   kick100.desc
   kick100.tcl
   kickad100.desc
   kickad100.tcl
   KillLog2.5.desc
   KillLog2.5.tcl
   klined.desc
   klined.tcl
   lamer.desc
   lamer.tcl
   lanparty.desc
   lanparty.tcl
   limit-v1.1.desc
   limit-v1.1.tcl
   limitchan.desc
   limitchan.tcl
   LinkedBots1.2.desc
   LinkedBots1.2.tcl
   maxvisitors101.desc
   maxvisitors101.tcl
   mc.banchan.desc
   mc.banchan.tcl
   mc.spamcheck.desc
   mc.spamcheck.tcl
   megadeth100.desc
   megadeth100.tcl
   mIRCShitlist1.2.desc
   mIRCShitlist1.2.tcl
   moi.desc
   moi.tcl
   netlink107.desc
   netlink107.tcl
   NetStats1.2.desc
   NetStats1.2.tcl
   news.desc
   news.tcl
   news2html.desc
   news2html.tcl
   NoAccess1.1.desc
   NoAccess1.1.tcl
   noads108.desc
   noads108.tcl
   noawayactions1.03.desc
   noawayactions1.03.tcl
   NoColors1.2.desc
   NoColors1.2.tcl
   nocomics100.desc
   nocomics100.tcl
   NoFservs1.5.desc
   NoFservs1.5.tcl
   nosense2.desc
   nosense2.tcl
   notes2.desc
   notes2.tcl
   NoTriggers2.3.desc
   NoTriggers2.3.tcl
   oannouce100.desc
   oannouce100.tcl
   ok1.3.desc
   ok1.3.tcl
   opbegger103.desc
   opbegger103.tcl
   opkillsnn.desc
   opkillsnn.tcl
   OpNotice1.9.desc
   OpNotice1.9.tcl
   pa-trgt3_68.desc
   pa-trgt3_68.tcl
   passgen.desc
   passgen.tcl
   pcgames.desc
   pcgames.tcl
   pickakick102.desc
   pickakick102.tcl
   PortCheck2.2.desc
   PortCheck2.2.tcl
   postal101.desc
   postal101.tcl
   Pub.desc
   Pub.tcl
   pwf.desc
   pwf.tcl
   ques5.desc
   ques5.tcl
   ran.desc
   ran.tcl
   RandRead1.1.desc
   RandRead1.1.tcl
   randtopic2.04.desc
   randtopic2.04.tcl
   recruiters100.desc
   recruiters100.tcl
   released102.desc
   released102.tcl
   SearchPage.desc
   SearchPage.tcl
   sentinel.desc
   sentinel.tcl
   Services2.0.desc
   Services2.0.tcl
   sharereactor1.0.desc
   sharereactor1.0.tcl
   ShellTime1.6.desc
   ShellTime1.6.tcl
   ShellUptime1.0.desc
   ShellUptime1.0.tcl
   shortnews.desc
   shortnews.tcl
   showchans104.desc
   showchans104.tcl
   sound_dos-0.02a.desc
   sound_dos-0.02a.tcl
   Spod.desc
   Spod.tcl
   spymsg.desc
   spymsg.tcl
   StockQuote.desc
   StockQuote.tcl
   striptease104.desc
   striptease104.tcl
   SubChan2.0.desc
   SubChan2.0.tcl
   superbitch0.45.desc
   superbitch0.45.tcl
   sync1.2.desc
   sync1.2.tcl
   tan101.desc
   tan101.tcl
   tempc100.desc
   tempc100.tcl
   textsearch0.2.desc
   textsearch0.2.tcl
   TimeIdent1.0.desc
   TimeIdent1.0.tcl
   TimeMessage1.0.desc
   TimeMessage1.0.tcl
   TimeRehash1.0.desc
   TimeRehash1.0.tcl
   tool-lyrics.desc
   tool-lyrics.tcl
   top10.desc
   top10.tcl
   topiclock2.04.desc
   topiclock2.04.tcl
   topiclogger1.01.desc
   topiclogger1.01.tcl
   ucsx0.2.desc
   ucsx0.2.tcl
   uptime1.08.desc
   uptime1.08.tcl
   UrlGet1.4.desc
   UrlGet1.4.tcl
   userinfo.desc
   userinfo.tcl
   VerboseMail1.1.desc
   VerboseMail1.1.tcl
   Voice1.1.desc
   Voice1.1.tcl
   voiceallbut102.desc
   voiceallbut102.tcl
   voicebitch0.1.desc
   voicebitch0.1.tcl
   VoiceFservs1.3.desc
   VoiceFservs1.3.tcl
   vote1.14.desc
   vote1.14.tcl
   warn100.desc
   warn100.tcl
   weather3.3.1.desc
   weather3.3.1.tcl
   WebSiteStatus1.0.desc
   WebSiteStatus1.0.tcl
   Whatis1.5.desc
   Whatis1.5.tcl
   Whom1.0.desc
   Whom1.0.tcl
   winfuture.desc
   winfuture.tcl
   winident1.2.desc
   winident1.2.tcl
   worldtime.desc
   worldtime.tcl
   x-commands0.1.desc
   x-commands0.1.tcl
   zdnet1.1.desc
   zdnet1.1.tcl

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
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
####################################################################
##                                                                ##
##                 pwf.tcl for eggdrop 1.6.x.                     ##
##                       By kalhimeo                              ##
##                                                                ##
##      (c)2002 kalhimeo - released under the BSD License         ##
##                                                                ##
##           check the last version of the script :               ##
##            http://sourceforge.net/projects/pwf/                ##
##                                                                ##
##             version 1.3 (stable) - 1st Juny 2002               ##
##                                                                ##
####################################################################
##                                                                ##
##                                                                ##
##  INTRODUCTION :                                                ##
##                                                                ##
##  This script is fully open-source, you are free to use,        ##
##  modify or improve it. The only things i ask you to keep are   ##
##  the reference to the #pwf channel and to the creator in       ##
##  respect for him.                                              ##
##                                                                ##
##  If you add big new features and agree to publish your work,   ##
##  you can mail me at kalhimeo@users.sourceforge.net to add      ##
##  these in the next release ( with reference to you nick for    ##
##  sure ).                                                       ##
##                                                                ##
##                                                                ##
##  INSTALLATION :                                                ##
##                                                                ##
##  This pickup script may work with every game without needing   ##
##  to modify the whole code. Just edit the six variables below   ##
##  and launch it with your favorite eggdrop.                     ##
##                                                                ##
##  You can then add the flag +G to your game-admins ( they       ##
##  can launch pickups ) and then teach these little padawan      ##
##  how to use this script :p                                     ##
##                                                                ##
##                                                                ##
##  FEATURES :                                                    ##
##                                                                ##
##  - Easy pickup management on your chan.                        ##
##  - Fully customisable for game , bot replies , etc.            ##
##  - Support nick tracking for player who rename/quit/part/kick. ##
##  - Authentication system for Game-Admins to increase security. ##
##  - Possibility to change game type/player number/map on the    ##
##    fly during the pickup organisation.                         ##
##  - Players who subscribe the match can vote for a map if the   ##
##    Game-Admin didn t set one yet.                              ##
##  - IP and password are send in private message to each player  ##
##    to prevent non-subscribed players to join the server.       ##
##  - Classic !add / !remove/ !teams / !help commands.            ##
##  - !ip command reply the ip of the game.                       ##
##  - Admins can !enable or !disable their chan for pickups.      ##
##  - Possibility for masters ( +m ) to add Game-Admins easyly    ##
##    with !addadmin ( or remove with !remaddmin ).               ##
##  - Game is ended if : chan is disable by a master, game admin  ##
##    who launced it quit chan or if he decide to stop it with    ##
##    the endgame command.                                        ##
##  - Built in permaban command !permban for Game-Admins.         ##
##  - Multi language support.                                     ##
##                                                                ##
##                                                                ##
##  COMMANDS :                                                    ##
##                                                                ##
##  I've included many control commands in this script. You       ##
##  won't probably use all of these.                              ##
##  Some commands have to be executed in the channel ( ie: most   ##
##  of the public commands ) and some others in private talk      ##
##  with the bot.                                                 ##
##                                                                ##
##  Public        = all users                                     ##
##  Game-Admins   = users with +G flag                            ##
##  Server-Holder = Game-Admin who have launched the current game ##
##  Masters       = users with +mG flag                           ##
##                                                                ##
##  To list the basic commands you can also use :                 ##
##            /msg botnick help    or    !help                    ##
##                                                                ##
##                                                                ##
##  Public commands ( channel ) :                                 ##
##    !add (or !addme)       => add yourself to the game          ##
##    !remove (or !removeme) => remove yourself...                ##
##    !votemap <map>         => vote for a map                    ##
##    !teams (or !team)      => list the team                     ##
##    !ip                    => get the ip of the next game       ##
##    !help                  => replies the commands available    ##
##                                                                ##
##  Public commands ( private ) :                                 ##
##    help                   => replies the commands available    ##
##                                                                ##
##  Game-Admins commands ( channel ) :                            ##
##    !enable                => enable the bot for pickup         ##
##    !disable               => shut-up bot !                     ##
##                                                                ##
##  Game-Admins commands ( private ) :                            ##
##    admin <pass>           => auth yourself                     ##
##    addgame <ip pass vip>  => start new game (vip= *see below)  ##
##    info <ok>              => confirm game informations         ##
##    permban <mask>         => ban this pickup lamer for life    ##
##    permbaninfo <ok>       => confirm permban info              ##
##                                                                ##
##  Server-Holder commands ( channel ) :                          ##
##    !addmap <map>          => set the map and enforce it        ##
##    !addtype <type>        => type of the game ( ie : CTF )     ##
##    !playernumber <number> => number of players (pair number)   ##
##                                                                ##
##  Server-Holder commands ( private ) :                          ##
##    endgame                => end current game                  ##
##                                                                ##
##  Master commands ( channel ) :                                 ##
##    !addadmin <nick>       => add Game-Admin rights             ##
##    !remadmin <nick>       => remove Game-Admin rights...       ##
##                                                                ##
##  Master commands ( private ) :                                 ##
##    enable <chan>          => same as !enable for Game-Admin    ##
##    disable <chan>         => same as !disable ...              ##
##                                                                ##
##     * you can add "VIP" string after the <password> to         ##
##       launch a VIP game ( only voiced and op users can         ##
##       use public commands )                                    ##
##                                                                ##
##                                                                ##
##                                                                ##
##  HISTORY :                                                     ##
##                                                                ##
##  1.3 :                                                         ##
##                                                                ##
##  - Add public !help command                                    ##
##  - Change some part of this header                             ##
##                                                                ##
##  1.2 :                                                         ##
##                                                                ##
##  - Flags for Masters is now +mG instead of +oG                 ##
##  - Permban is now accessible for Game-Admins                   ##
##  - When a Master disable a chan and a pickup is launching,     ##
##    the bot automaticly stop the pickup                         ##
##  - When a Game-Admin try to !disable a chan and a pickup is    ##
##    launching, the bot refuse to disable                        ##
##  - Bug when rehash and lost of authentication fixed            ##
##  - Some very very minor bugs fixed                             ##
##                                                                ##
##  1.1 :                                                         ##
##                                                                ##
##  - Multi-language support ( if you translate the script in     ##
##    a new language and agree to publish your work, you can      ##
##    mail me at kalhimeo@users.sourceforge.net, THX )            ##
##  - Easy to edit/remove some bot's reply or coulours            ##           
##  - Some minor bug fixes                                        ##
##                                                                ##
##                                                                ##
##                                                                ##
##                                                                ##
##  THANKS TO :                                                   ##
##                                                                ##
##  http://www.eggdrop-fr.org ( i learned TCL there :p )          ##
##  Lucas Nussbaum for the fastop script (= many code i'm using ) ##
##  k-rist for topicme script ( i'm also using some functions )   ##
##                                                                ##
####################################################################
##                                                                ##
##                 EDIT THE VARIABLES BELOW                       ##
##                                                                ##
####################################################################


## Set the channel where the bot has to do the pickups ( only 1 channel ).
set pwf_pickupchan "#pwf"

## Set the welcome msg sends to all users joining the channel ( you can remove the reference to #pwf in this message of course ).
set pwf_welcomemsg "New: PWF gather is now open source !! Looking for Help ? !help !! More info about PWF ? => /join #pwf"

## Set the default number of players for this kind of pickup. Only set pair numbers.
set pwf_defaultplayer 10

## Set the map available for votes ( ie : here is a sample with classic counter-strike maps )
set pwf_maps "de_dust de_dust2 de_aztec de_prodigy de_nuke de_inferno de_cbble de_train as_oilrig as_tundra cs_747 cs_assault cs_backalley cs_estate cs_italy cs_militia cs_office cs_siege"

## Set the the string that will be added after the topic if there isn't any pickup ( set pwf_nogametopic "" if you don't want any msg ).
set pwf_nogametopic "1-7|1- 3Pickup: No games currently 1-7|1-"

# Language the script will use for all messages : 
# 1 = English
# 2 = French
set pwf_language 1

####################################################################
##                                                                ##
##                 DO NOT EDIT THE LINES BELOW                    ##
##                                                                ##
####################################################################


bind pub - !addme pwf_addme
bind pub - !add pwf_addme
bind pub - !remove pwf_remove
bind pub - !removeme pwf_remove
bind pub - !addmap pwf_addmap
bind pub - !addtype pwf_addtype
bind pub - !playernumber pwf_playernumber
bind pub - !votemap pwf_votemap
bind pub - !ip pwf_ip
bind pub - !teams pwf_teams
bind pub - !team pwf_teams
bind pub - !help pwf_help
bind pub - !addadmin pwf_addadmin
bind pub - !remadmin pwf_removeadmin
bind pub G|G !enable pwf_enable
bind pub G|G !disable pwf_disable
bind msg - help pwf_msghelp
bind msg - admin pwf_auth
bind msg G|G addgame pwf_addgame
bind msg G|G endgame pwf_remgame
bind msg G|G info pwf_info
bind msg G|G permban pwf_permban
bind msg G|G permbaninfo pwf_permbaninfo
bind msg m|m enable pwf_msgenable
bind msg m|m disable pwf_msgdisable
bind join - * pwf_msgonjoin
bind nick - * pwf_nickchange
bind part - * pwf_playerquit
bind kick - * pwf_playerkicked
bind sign - * pwf_playersign
bind topc - * pwf_topicchange
utimer 10 pwf_remoldflag

set pwf_shutupchan 0
set pwf_type ""
set pwf_maxpl $pwf_defaultplayer
set pwf_voters [list ]
set pwf_baneduser ""
set pwf_quality 0
set pwf_serverholder ""
set pwf_active 0
set pwf_playernumber 0
set pwf_serverip ""
set pwf_serverpassword ""
set pwf_teamaserver [list ]
set pwf_teambserver [list ]
set pwf_maplock 0
set pwf_mapslength [llength $pwf_maps]
set pwf_timeoutdelay 30


if ![info exists pwf_antirehash] {
  timer 10 pwf_checkactive
  timer 2 pwf_tchk
  set pwf_antirehash 1
}


proc pwf_msgonjoin { nickname user handle channel } {
  global pwf_welcomemsg pwf_pickupchan botnick
  if { $channel == $pwf_pickupchan } {
    putserv "NOTICE $nickname :[pwf_txt welcome] $nickname . $pwf_welcomemsg"
  }
}


proc pwf_topicchange {nick uhost handle channel topic} {
  global botnick pwf_pickupchan
  if { ( $nick != $botnick ) && ( $channel == $pwf_pickupchan ) } {
    set thetopic [topic $channel]
    if {$thetopic == ""} {
     utimer 2 "pwf_waittopic $channel"
    } else {
     pwf_newtopic $channel $thetopic
    }
  }
  return 1
}


proc pwf_waittopic {channel} {
  set channelfile topic$channel
  if {[pwf_checkfile $channelfile "r"]} {
    set fileio [open $channelfile "r"]
    set restoredtopic [gets $fileio]
    close $fileio
    if {$restoredtopic != ""} {
      putserv "TOPIC $channel :$restoredtopic"
      pwf_newtopic $channel $restoredtopic
      return 1
    }
  }
}


proc pwf_newtopic {channel topic} {
  set channelfile topic$channel
  if {[file exists $channelfile]} {
    if {![pwf_checkfile $channelfile "w"]} {
	putlog "[pwf_txt misc1] $channelfile"
	return 0
    }
  }
  set fileio [open $channelfile "w"]
  puts $fileio $topic
  flush $fileio
  close $fileio
  return 1
}


proc pwf_checkfile {file rw} {
  if {[file exists $file] && [file isfile $file]} {
    if {$rw == "r"} {
      if {[file readable $file]} {
        return 1
      } else {
        return 0
      }
    } elseif {$rw == "w"} {
      if {[file writable $file]} {
        return 1
      } else {
        return 0
      }
    } else {
      return 1
    }
  }
  return 0
}


proc pwf_setnogame {} {
  global pwf_pickupchan pwf_shutupchan pwf_nogametopic
  set channel $pwf_pickupchan
  if { $pwf_shutupchan == 0 } {
    set channelfile topic$channel
    if {[pwf_checkfile $channelfile "r"]} {
      set fileio [open $channelfile "r"]
      set restoredtopic [gets $fileio]
      close $fileio
      if {$restoredtopic != ""} {
        set keyword [string range $pwf_nogametopic 0 5]
        if { [string match "*$keyword*" $restoredtopic]} {
     	    putserv "TOPIC $channel :$restoredtopic"
        } else {
          putserv "TOPIC $channel :$restoredtopic $pwf_nogametopic"
        }
      }
    }
  }
}


proc pwf_starttopic {} {
  global pwf_teamatopic pwf_teambtopic pwf_maptopic pwf_maxpl pwf_playernumber pwf_serverholder pwf_quality pwf_pickupchan pwf_shutupchan pwf_type
  pwf_buildteams
  if { $pwf_quality == 0 } {
    if { $pwf_shutupchan == 0 } {
      if { $pwf_type == "" } {
        putserv "TOPIC $pwf_pickupchan :[pwf_txt topic1] $pwf_serverholder [pwf_txt topic2] $pwf_maptopic"
      } else {
        putserv "TOPIC $pwf_pickupchan :[pwf_txt topic1] $pwf_serverholder [pwf_txt topic4] $pwf_type [pwf_txt topic2] $pwf_maptopic"
      }
    }
  } else {
    if { $pwf_shutupchan == 0 } {
      if { $pwf_type == "" } {
        putserv "TOPIC $pwf_pickupchan :[pwf_txt topic1] $pwf_serverholder [pwf_txt topic5] [pwf_txt topic2] $pwf_maptopic"
      } else {
        putserv "TOPIC $pwf_pickupchan :[pwf_txt topic1] $pwf_serverholder [pwf_txt topic5] [pwf_txt topic4] $pwf_type [pwf_txt topic2] $pwf_maptopic"
      }
    }
  }
}


proc pwf_settopic {} {
  global pwf_teamatopic pwf_teambtopic pwf_maxpl pwf_playernumber pwf_serverholder pwf_pickupchan pwf_shutupchan
  pwf_buildteams
  if { $pwf_shutupchan == 0 } {
      putserv "PRIVMSG $pwf_pickupchan :[pwf_txt teams1] $pwf_playernumber/$pwf_maxpl [pwf_txt separator] $pwf_teamatopic [pwf_txt separator] $pwf_teambtopic"
  }
}


proc pwf_addme { nick uhost handle channel team } {
  global pwf_teamaserver pwf_teambserver pwf_playernumber pwf_maxpl pwf_pickupchan pwf_active pwf_quality pwf_shutupchan
  if { $channel == $pwf_pickupchan } { 
    if { $pwf_shutupchan == 0 } {
      if { $pwf_active == 1 } {
        set team [string tolower $team]
        if { $team == "" } {
          set numberteama [lsearch -exact $pwf_teamaserver $nick ]
          set numberteamb [lsearch -exact $pwf_teambserver $nick ]
          set ispresent [expr $numberteama + $numberteamb]
          if { $ispresent == -2 } {
            if { [llength $pwf_teambserver] < [llength $pwf_teamaserver] } {
              set team b
            } else {
              set team a
            }
          } else {
            putserv "NOTICE $nick :[pwf_txt addme1]"
            return 0
          }
        }
        if { $pwf_quality == 1 } {
          if { ( [isvoice $nick $channel] ) || ( [isop $nick $channel] ) } {
            if { ( [lsearch -exact $team a ] >-1 ) && ( [lsearch -exact $pwf_teamaserver $nick ] <0 ) && ( [llength $pwf_teamaserver] < [expr $pwf_maxpl/2] ) } {
              set pwf_teamaserver [linsert $pwf_teamaserver end $nick ]
              if {[lsearch -exact $pwf_teambserver $nick ] >-1 } {
                set playerindex [lsearch -exact $pwf_teambserver $nick ]
                set pwf_teambserver [lreplace $pwf_teambserver $playerindex $playerindex ]
              }
              set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
              pwf_settopic
            } elseif { ( [lsearch -exact $team b] >-1 ) && ( [lsearch -exact $pwf_teambserver $nick ] <0 ) && ( [llength $pwf_teambserver] < [expr $pwf_maxpl/2] ) } {
              set pwf_teambserver [linsert $pwf_teambserver end $nick ]
              if {[lsearch -exact $pwf_teamaserver $nick ] >-1 } {
                set playerindex [lsearch -exact $pwf_teamaserver $nick ]
                set pwf_teamaserver [lreplace $pwf_teamaserver $playerindex $playerindex ]
              }
              set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
              pwf_settopic
            } else {
              putserv "NOTICE $nick :[pwf_txt addme1]"
            }
            if { $pwf_playernumber == $pwf_maxpl } {
              pwf_launchgame
              set pwf_quality 0
            }
          } else {
            putserv "NOTICE $nick :[pwf_txt addme2]"
          }
        } elseif { $pwf_quality == 0 } {
          if { ( [lsearch -exact $team a ] >-1 ) && ( [lsearch -exact $pwf_teamaserver $nick ] <0 ) && ( [llength $pwf_teamaserver] < [expr $pwf_maxpl/2] ) } {
            set pwf_teamaserver [linsert $pwf_teamaserver end $nick ]
            if {[lsearch -exact $pwf_teambserver $nick ] >-1 } {
              set playerindex [lsearch -exact $pwf_teambserver $nick ]
              set pwf_teambserver [lreplace $pwf_teambserver $playerindex $playerindex ]
            }
            set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
            pwf_settopic
          } elseif { ( [lsearch -exact $team b] >-1 ) && ( [lsearch -exact $pwf_teambserver $nick ] <0 ) && ( [llength $pwf_teambserver] < [expr $pwf_maxpl/2] ) } {
            set pwf_teambserver [linsert $pwf_teambserver end $nick ]
            if {[lsearch -exact $pwf_teamaserver $nick ] >-1 } {
              set playerindex [lsearch -exact $pwf_teamaserver $nick ]
              set pwf_teamaserver [lreplace $pwf_teamaserver $playerindex $playerindex ]
            }
            set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
            pwf_settopic
          } else {
            putserv "NOTICE $nick :[pwf_txt addme1]"
          }
          if { $pwf_playernumber == $pwf_maxpl } {
            pwf_launchgame
          }
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt addme3]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt addme4]"
    }
  }
}


proc pwf_remove { nick uhost handle channel arg} {
  global pwf_teamaserver pwf_teambserver pwf_playernumber pwf_active pwf_pickupchan pwf_shutupchan
  if { $channel == $pwf_pickupchan } {
    if { $pwf_shutupchan == 0 } {
      if { $pwf_active == 1 } {
        if { [lsearch -exact $pwf_teamaserver $nick ] >-1 } {
          set playerindex [lsearch -exact $pwf_teamaserver $nick ]
          set pwf_teamaserver [lreplace $pwf_teamaserver $playerindex $playerindex ]
          set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
          pwf_settopic
        } elseif { [lsearch -exact $pwf_teambserver $nick ] >-1 } {
          set playerindex [lsearch -exact $pwf_teambserver $nick ]
          set pwf_teambserver [lreplace $pwf_teambserver $playerindex $playerindex ]
          set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
          pwf_settopic
        } else {
          putserv "NOTICE $nick :[pwf_txt addme5]"
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt addme3]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt addme4]"
    }
  }
}


proc pwf_votemap { nick uhost handle channel votemap } {
  global pwf_teamaserver pwf_teambserver pwf_active pwf_maplock pwf_voters pwf_maps pwf_maptopic pwf_mapslength pwf_pickupchan pwf_shutupchan
  if { $channel == $pwf_pickupchan } {
    if { $pwf_shutupchan == 0 } {
      if { $pwf_active == 1 } {
        set numberteama [lsearch -exact $pwf_teamaserver $nick ]
        set numberteamb [lsearch -exact $pwf_teambserver $nick ]
        set ispresent [expr $numberteama + $numberteamb]
        if { $ispresent > -2 } {
          if { $pwf_maplock == 0 } {
            if { [lsearch -exact $pwf_voters $nick] == -1 } {
              set votemap [string tolower $votemap]
              set mapindex [lsearch $pwf_maps $votemap]
              if { $mapindex > -1 } {
                set pwf_voters [linsert $pwf_voters end $nick]
                set pwf_voters [linsert $pwf_voters end $mapindex]
                putserv "NOTICE $nick :[pwf_txt vote1]"
              } else {
                putserv "NOTICE $nick :[pwf_txt vote2]"
              }
            } else {
              set mapindex [lsearch $pwf_maps $votemap]
              if { $mapindex > -1 } {
                set voterindex [lsearch -exact $pwf_voters $nick]
                set voterindex [incr voterindex]
                set pwf_voters [lreplace $pwf_voters $voterindex $voterindex $mapindex]
                putserv "NOTICE $nick :[pwf_txt vote1]"
              } else {
                putserv "NOTICE $nick :[pwf_txt vote2]"
              }
            }
            set previousmap $pwf_maptopic
            set voters2 $pwf_voters
            set voters2length [llength $voters2]
            set mapranking [list ]
            set maps2 [list ]
            for {set x 0} { $x < $pwf_mapslength } {incr x} {
              set maps2 [linsert $maps2 0 0]
            }
            for {set x 1} { $x < $voters2length } {incr x 2} {
              set votedmap [lindex $voters2 $x]
              set numbervote [lindex $maps2 $votedmap]
              incr numbervote
              set maps2 [lreplace $maps2 $votedmap $votedmap $numbervote]
            }
            for {set x 0} { $x < $pwf_mapslength } {incr x} {
              set themap [list [lindex $maps2 $x] [lindex $pwf_maps $x]]
              set mapranking [linsert $mapranking end $themap]
            }
            set mapranking [lsort -decreasing -index 0 $mapranking]
            set mapwin [list [lindex $mapranking 0 ]]
            set endindex [expr [string length $mapwin ] - 2 ]
            set pwf_maptopic [string range $mapwin 3 $endindex]
            if { ( $pwf_maptopic == $votemap ) && ( $pwf_maptopic != $previousmap ) } {
              putserv "PRIVMSG $channel :[pwf_txt vote3] $pwf_maptopic"
              pwf_starttopic
            }
          } else {
            putserv "NOTICE $nick :[pwf_txt vote4]"
          }
        } else {
          putserv "NOTICE $nick :[pwf_txt vote5]"
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt addme3]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt addme4]"
    }
  }
}


proc pwf_ip { nick uhost handle channel arg } {
  global pwf_active pwf_pickupchan pwf_serverip pwf_shutupchan
  if { $channel == $pwf_pickupchan } {
    if { $pwf_shutupchan == 0 } {
      if { $pwf_active == 1 } {
        putserv "PRIVMSG $channel :[pwf_txt ip1] $pwf_serverip [pwf_txt ip2]"
      } else {
        putserv "NOTICE $nick :[pwf_txt addme3]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt addme4]"
    }
  }
}


proc pwf_teams { nick uhost handle channel arg } {
  global pwf_active pwf_pickupchan pwf_teamatopic pwf_teambtopic pwf_shutupchan
    if { $channel == $pwf_pickupchan } {
      if { $pwf_shutupchan == 0 } {
        if { $pwf_active == 1 } {
          putserv "PRIVMSG $channel : $pwf_teamatopic [pwf_txt separator] $pwf_teambtopic"
        } else {
          putserv "NOTICE $nick :[pwf_txt addme3]"
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt addme4]"
      }
   }
}


proc pwf_addmap { nick uhost handle channel map } {
  global pwf_maptopic pwf_active pwf_pickupchan pwf_maplock pwf_serverholder pwf_shutupchan
  if { $channel == $pwf_pickupchan } {
    if { $pwf_shutupchan == 0 } {
      if { $pwf_active == 1 } {
        if { $nick == $pwf_serverholder } {
          if { $map != "" } {
            set pwf_maptopic $map
            pwf_starttopic
            set pwf_maplock 1
          } else {
            putserv "NOTICE $nick :[pwf_txt admin1]"
          }
        } else {
          putserv "NOTICE $nick :[pwf_txt admin2]"
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt addme3]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt addme4]"
    }
  }
}


proc pwf_addtype { nick uhost handle channel arg } {
  global pwf_type pwf_active pwf_pickupchan pwf_serverholder pwf_shutupchan
  if { $channel == $pwf_pickupchan } {
    if { $pwf_shutupchan == 0 } {
      if { $pwf_active == 1 } {
        if { $nick == $pwf_serverholder } {
          set pwf_type $arg
          pwf_starttopic
        } else {
          putserv "NOTICE $nick :[pwf_txt admin2]"
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt addme3]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt addme4]"
    }
  }
}


proc pwf_playernumber { nick uhost handle channel arg } {
  global pwf_maxpl pwf_active pwf_pickupchan pwf_serverholder pwf_shutupchan
  if { $channel == $pwf_pickupchan } {
    if { $pwf_shutupchan == 0 } {
      if { $pwf_active == 1 } {
        if { $nick == $pwf_serverholder } {
          if { $arg != "" } {
            if { [expr $arg % 2 ] == "0" } {
              set pwf_maxpl $arg
              pwf_starttopic
              pwf_settopic
            } else {
              putserv "NOTICE $nick :[pwf_txt admin4]"
            }
          } else {
            putserv "NOTICE $nick :[pwf_txt admin3]"
          }
        } else {
          putserv "NOTICE $nick :[pwf_txt admin2]"
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt addme3]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt addme4]"
    }
  }
}


proc pwf_addgame { nick uhost handle arg } {
  global pwf_active pwf_pickupchan pwf_shutupchan pwf_serverip pwf_serverpassword pwf_serverholder pwf_quality botnick
  if { [matchattr $handle H] } {
    if { $pwf_shutupchan == 0 } {
      if { ( $pwf_active == 0 ) } {
        set pwf_serverip [lindex $arg 0]
        set pwf_serverpassword [lindex $arg 1]
        set gamequality [lindex $arg 2]
        set qualitytxt "vip"
        if { ( $pwf_serverpassword != "" ) && ( $pwf_serverip != "" ) && ( $pwf_serverpassword != $qualitytxt ) } {
          if { $gamequality == $qualitytxt } {
            if { $pwf_quality == 0 } {
              set pwf_quality 1
              set pwf_serverholder $nick
              putserv "PRIVMSG $pwf_serverholder :[pwf_txt addgame1] $pwf_serverip [pwf_txt addgame2] $pwf_serverpassword [pwf_txt addgame3] [pwf_txt addgame4]"
            } else {
              putserv "PRIVMSG $pwf_serverholder :[pwf_txt addgame5]"
              set pwf_serverip ""
              set pwf_serverpassword ""
            }
          } else {
            set pwf_serverholder $nick
            putserv "PRIVMSG $pwf_serverholder :[pwf_txt addgame1] $pwf_serverip [pwf_txt addgame2] $pwf_serverpassword [pwf_txt addgame4]"
          }
        } else {
          putserv "PRIVMSG $nick :[pwf_txt addgame8]"
          set pwf_serverip ""
          set pwf_serverpassword ""
        }
      } else {
        putserv "PRIVMSG $nick :[pwf_txt addgame6] $pwf_serverholder [pwf_txt addgame7]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt addgame10] $pwf_pickupchan"
    }
  } else {
    putserv "NOTICE $nick :[pwf_txt noauth]"
  }
}


proc pwf_info { nick uhost handle arg } {
  global pwf_active pwf_pickupchan pwf_serverip pwf_serverpassword pwf_serverholder pwf_pickupchan pwf_quality botnick
  if { ( $nick == $pwf_serverholder ) && ( $pwf_active == 0 )} {
    if { $arg == "ok" } {
      putserv "PRIVMSG $nick :[pwf_txt addgame9]"
      set pwf_active 1
      pwf_starttopic
    } else {
      set pwf_serverpassword ""
      set pwf_serverip ""
      set pwf_serverholder ""
      putserv "PRIVMSG $nick :[pwf_txt addgame0]"
    }
  }
}


proc pwf_help { nick uhost handle channel arg } {
   global botnick pwf_pickupchan
   if { $channel == $pwf_pickupchan } {
     putserv "NOTICE $nick :[pwf_txt help1]"
     putserv "NOTICE $nick :[pwf_txt help2]"
     putserv "NOTICE $nick :[pwf_txt help3]"
     putserv "NOTICE $nick :[pwf_txt help4]"
     putserv "NOTICE $nick :[pwf_txt help5]"
     putserv "NOTICE $nick :[pwf_txt help6] #pwf ( Quakenet ) - http://sourceforge.net/projects/pwf/ - PWF by kalhimeo"
   }
}


proc pwf_msghelp { nick uhost handle arg } {
   global botnick
   putserv "NOTICE $nick :[pwf_txt help1]"
   putserv "NOTICE $nick :[pwf_txt help2]"
   putserv "NOTICE $nick :[pwf_txt help3]"
   putserv "NOTICE $nick :[pwf_txt help4]"
   putserv "NOTICE $nick :[pwf_txt help5]"
   putserv "NOTICE $nick :[pwf_txt help6] #pwf ( Quakenet ) - http://sourceforge.net/projects/pwf/ - PWF by kalhimeo"
}


proc pwf_checkactive {} {
   global pwf_active pwf_serverpassword pwf_serverip pwf_serverholder pwf_baneduser
   timer 10 pwf_checkactive
   if { ( $pwf_active == 0 ) && ( $pwf_serverholder != "" ) } {
     set pwf_serverpassword ""
     set pwf_serverip ""
     set pwf_serverholder ""
   }
   set pwf_baneduser ""
}


proc pwf_remgame { nick uhost handle arg } {
  global pwf_active pwf_quality pwf_maptopic pwf_playernumber pwf_serverip pwf_teamaserver pwf_teambserver pwf_serverpassword pwf_pickupchan pwf_maplock pwf_serverholder botnick pwf_voters pwf_type pwf_maxpl pwf_defaultplayer
  if { [matchattr $handle H] } {
    if { $pwf_active == 1 } {
      if { $nick == $pwf_serverholder } {
        putserv "PRIVMSG $pwf_pickupchan : [pwf_txt cancel1] $pwf_serverholder [pwf_txt cancel2]"
        set pwf_active 0
        set pwf_serverip ""
        set pwf_serverpassword ""
        set pwf_playernumber 0
        set pwf_teamaserver [list ]
        set pwf_teambserver [list ]
        set pwf_maplock 0
        set pwf_serverholder 0
        set pwf_maptopic "Map not defined yet"
        set pwf_voters [list ]
        pwf_setnogame
        set pwf_quality 0
        set pwf_type ""
        set pwf_maxpl $pwf_defaultplayer
      } else {
        putserv "NOTICE $nick :[pwf_txt cancel5]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt cancel4]"
    }  
  } else {
    putserv "NOTICE $nick :[pwf_txt noauth]"
  }
}


proc pwf_nickchange { nick uhost handle channel newnick } {
   global pwf_teamaserver pwf_teambserver pwf_serverholder pwf_shutupchan pwf_authnick pwf_pickupchan
   if { $channel == $pwf_pickupchan } {
     if { $pwf_shutupchan == 0 } {
       if {[lsearch -exact $pwf_teamaserver $nick ] >-1 } {
         set playerindex [lsearch -exact $pwf_teamaserver $nick ]
         set pwf_teamaserver [lreplace $pwf_teamaserver $playerindex $playerindex $newnick]
       } elseif {[lsearch -exact $pwf_teambserver $nick ] >-1 } {
         set playerindex [lsearch -exact $pwf_teambserver $nick ]
         set pwf_teambserver [lreplace $pwf_teambserver $playerindex $playerindex $newnick]
       }
       if { $nick == $pwf_serverholder } {
         set pwf_serverholder $newnick
       }
     }
     if [info exists pwf_authnick($nick)] {
       set pwf_authnick($newnick) $pwf_authnick($nick)
       unset pwf_authnick($nick)
     }
   }
}



proc pwf_playerquit { nick uhost handle channel arg } {
  global pwf_teamaserver pwf_teambserver pwf_playernumber pwf_pickupchan pwf_serverholder pwf_shutupchan pwf_authnick
  if { $channel == $pwf_pickupchan } {
    if { $pwf_shutupchan == 0 } {
      if {[lsearch -exact $pwf_teamaserver $nick ] >-1 } {
        set playerindex [lsearch -exact $pwf_teamaserver $nick ]
        set pwf_teamaserver [lreplace $pwf_teamaserver $playerindex $playerindex ]
        set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
        pwf_settopic
      } elseif {[lsearch -exact $pwf_teambserver $nick ] >-1 } {
        set playerindex [lsearch -exact $pwf_teambserver $nick ]
        set pwf_teambserver [lreplace $pwf_teambserver $playerindex $playerindex ]
        set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
        pwf_settopic
      }
      if { $nick == $pwf_serverholder } {
        if { $pwf_shutupchan == 0 } { 
          putserv "PRIVMSG $pwf_pickupchan :[pwf_txt cancel1] $pwf_serverholder [pwf_txt cancel3]"
        }
        pwf_endgame
      }
    }
    if ![info exists pwf_authnick($nick)] {
      return 0
    }
    if ![matchattr $pwf_authnick($nick) H] {
      return 0
    }
    chattr $pwf_authnick($nick) -H
    unset pwf_authnick($nick)
    putserv "NOTICE $nick :[pwf_txt deauthpart]"
    return 0
  }
}


proc pwf_playerkicked { kickernick uhost hand channel nick reason } {
  global pwf_teamaserver pwf_teambserver pwf_playernumber pwf_pickupchan pwf_serverholder pwf_shutupchan pwf_authnick
  if { $channel == $pwf_pickupchan } {
    if { $pwf_shutupchan == 0 } {
      if {[lsearch -exact $pwf_teamaserver $nick ] >-1 } {
        set playerindex [lsearch -exact $pwf_teamaserver $nick ]
        set pwf_teamaserver [lreplace $pwf_teamaserver $playerindex $playerindex ]
        set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
        pwf_settopic
      } elseif {[lsearch -exact $pwf_teambserver $nick ] >-1 } {
        set playerindex [lsearch -exact $pwf_teambserver $nick ]
        set pwf_teambserver [lreplace $pwf_teambserver $playerindex $playerindex ]
        set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
        pwf_settopic
      }
      if { $nick == $pwf_serverholder } {
        if { $pwf_shutupchan == 0 } { 
          putserv "PRIVMSG $pwf_pickupchan :[pwf_txt cancel1] $pwf_serverholder [pwf_txt cancel3]"
        }
        pwf_endgame
      }
    }
    if ![info exists pwf_authnick($nick)] {
      return 0
    }
    if ![matchattr $pwf_authnick($nick) H] {
      return 0
    }
    chattr $pwf_authnick($nick) -H
    unset pwf_authnick($nick)
    putserv "NOTICE $nick :[pwf_txt deauthkick]"
    return 0
  }
}


proc pwf_playersign {nick uhost hand channel rest} { 
  global pwf_teamaserver pwf_teambserver pwf_playernumber pwf_pickupchan pwf_serverholder pwf_shutupchan pwf_authnick
  if { $channel == $pwf_pickupchan } {
    if { $pwf_shutupchan == 0 } {
      if {[lsearch -exact $pwf_teamaserver $nick ] >-1 } {
        set playerindex [lsearch -exact $pwf_teamaserver $nick ]
        set pwf_teamaserver [lreplace $pwf_teamaserver $playerindex $playerindex ]
        set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
        pwf_settopic
      } elseif {[lsearch -exact $pwf_teambserver $nick ] >-1 } {
        set playerindex [lsearch -exact $pwf_teambserver $nick ]
        set pwf_teambserver [lreplace $pwf_teambserver $playerindex $playerindex ]
        set pwf_playernumber [expr [llength $pwf_teamaserver]+[llength $pwf_teambserver]]
        pwf_settopic
      }
      if { $nick == $pwf_serverholder } {
        if { $pwf_shutupchan == 0 } { 
          putserv "PRIVMSG $pwf_pickupchan :[pwf_txt cancel1] $pwf_serverholder [pwf_txt cancel3]"
        }
        pwf_endgame
      }
    }
    if ![info exists pwf_authnick($nick)] {
      return 0
    }
    if ![matchattr $pwf_authnick($nick) H] {
      return 0
    }
    chattr $pwf_authnick($nick) -H
    unset pwf_authnick($nick)
  }
}


proc pwf_endgame {} {
  global pwf_active pwf_maptopic pwf_playernumber pwf_serverip pwf_teamaserver pwf_teambserver pwf_serverpassword pwf_pickupchan pwf_maplock pwf_serverholder pwf_voters pwf_type pwf_maxpl pwf_defaultplayer
  set pwf_active 0
  set pwf_serverip ""
  set pwf_serverpassword ""
  set pwf_playernumber 0
  set pwf_teamaserver [list ]
  set pwf_teambserver [list ]
  set pwf_maplock 0
  set pwf_serverholder 0
  set pwf_maptopic "Map not defined yet"
  set pwf_voters [list ]
  set pwf_type ""
  set pwf_maxpl $pwf_defaultplayer
  pwf_setnogame
}


proc pwf_buildteams {} {
  global pwf_teamaserver pwf_teambserver pwf_teamatopic pwf_teambtopic pwf_maxpl
  set lengthteama [llength $pwf_teamaserver]
  set lengthteamb [llength $pwf_teambserver]
  set x 0
  set y 0
  set pwf_teamatopic [pwf_txt defteama]
  set pwf_teambtopic [pwf_txt defteamb]
  while {$x<$lengthteama} {
    set pwf_teamatopic "$pwf_teamatopic [lindex $pwf_teamaserver $x] -"
    incr x
  }
  while {$x<[expr $pwf_maxpl/2]} {
    set pwf_teamatopic "$pwf_teamatopic ? -"
    incr x
  }
  while {$y<$lengthteamb} {
    set pwf_teambtopic "$pwf_teambtopic [lindex $pwf_teambserver $y] -"
    incr y
  }
    while {$y<[expr $pwf_maxpl/2]} {
    set pwf_teambtopic "$pwf_teambtopic ? -"
    incr y
  }
  set endindexa [expr [string length $pwf_teamatopic ] - 2 ]
  set pwf_teamatopic [string range $pwf_teamatopic 0 $endindexa]
  set endindexb [expr [string length $pwf_teambtopic ] - 2 ]
  set pwf_teambtopic [string range $pwf_teambtopic 0 $endindexb]
}


proc pwf_launchgame {} {
  global pwf_serverip pwf_serverpassword pwf_maxpl pwf_active pwf_teamaserver pwf_teambserver pwf_serverholder pwf_pickupchan pwf_shutupchan
  set pwf_active 0
  set limit [expr $pwf_maxpl / 2 ]
  if { $pwf_shutupchan == 0 } {
    putserv "TOPIC $pwf_pickupchan :[pwf_txt start1]"
  }
  set msgteama "[pwf_txt addgame1] $pwf_serverip [pwf_txt addgame2] $pwf_serverpassword [pwf_txt start2] $pwf_serverholder [pwf_txt start4]"
  set msgteamb "[pwf_txt addgame1] $pwf_serverip [pwf_txt addgame2] $pwf_serverpassword [pwf_txt start3] $pwf_serverholder [pwf_txt start4]"
  for {set x 0} { $x < $limit } {incr x} {
    putserv "PRIVMSG [lindex $pwf_teamaserver $x] :$msgteama"
    putserv "PRIVMSG [lindex $pwf_teambserver $x] :$msgteamb"
  }      
  pwf_endgame
}


proc pwf_permban { nick uhost handle arg } {
  global pwf_baneduser botnick
  if { [matchattr $handle H] } { 
    set pwf_baneduser $arg
    putserv "PRIVMSG $nick :[pwf_txt banconf1] $pwf_baneduser [pwf_txt banconf2]"
  } else {
    putserv "NOTICE $nick :[pwf_txt noauth]"
  }
}


proc pwf_permbaninfo { nick uhost handle arg } {
  global pwf_pickupchan pwf_baneduser botnick
  set ok ok
  if { $pwf_baneduser != "" } {
    if { $arg == $ok } {
      set reason [pwf_txt banconf5]
      newchanban $pwf_pickupchan $pwf_baneduser $handle $reason 0
      putserv "PRIVMSG $nick :[pwf_txt banconf3]"
      set pwf_baneduser ""
    } else {
      set pwf_baneduser ""
      putserv "PRIVMSG $nick :[pwf_txt banconf4]"
    }
  }
}


proc pwf_enable { nick uhost handle channel arg } {
  global pwf_pickupchan pwf_shutupchan botnick
  if { $channel == $pwf_pickupchan } {
    if { [matchattr $handle H] } {
      if { $pwf_shutupchan == 1 } {
        set pwf_shutupchan 0
        putserv "PRIVMSG $channel :[pwf_txt enable1]"
      } else {
        putserv "NOTICE $nick :[pwf_txt enable2]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt noauth]"
    }
  }
}


proc pwf_disable { nick uhost handle channel arg } {
  global pwf_pickupchan pwf_shutupchan pwf_active botnick
  if { $channel == $pwf_pickupchan } {
    if { [matchattr $handle H ] } {
      if { $pwf_shutupchan == 0 } {
        if { $pwf_active == 0 } {
          set pwf_shutupchan 1
          putserv "PRIVMSG $channel :[pwf_txt disable1]"
        } elseif { [matchattr $handle m|m ] } {
          pwf_endgame
          putserv "PRIVMSG $channel :[pwf_txt disable1]"
          set pwf_shutupchan 1
        } else {
          putserv "NOTICE $nick :[pwf_txt disable4]"
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt disable2]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt noauth]"
    }
  }
}


proc pwf_msgenable { nick uhost handle arg } {
  global pwf_pickupchan pwf_shutupchan botnick
  if { [matchattr $handle H] } {
    set channel $arg
    if {[string index $channel 0] != "#"} {
      set channel "#$channel"
    }
    if { ( $pwf_shutupchan == 1 ) && ( $pwf_pickupchan == $channel ) } {
      set pwf_shutupchan 0
      putserv "PRIVMSG $channel :[pwf_txt enable1]"
    } else {
      putserv "PRIVMSG $nick :[pwf_txt enable3]"
    }
  } else {
    putserv "NOTICE $nick :[pwf_txt noauth]"
  }
}


proc pwf_msgdisable { nick uhost handle arg } {
  global pwf_pickupchan pwf_shutupchan pwf_active botnick
  if { [matchattr $handle H] } {
    set channel $arg
    if {[string index $channel 0] != "#"} {
      set channel "#$channel"
    }
    if { ( $pwf_shutupchan == 0 ) && ( $pwf_pickupchan == $channel ) } {
      putserv "PRIVMSG $channel :[pwf_txt disable1]"
      if { $pwf_active == 1 } {
        pwf_endgame
      }
      set pwf_shutupchan 1
    } else {
      putserv "PRIVMSG $nick :[pwf_txt disable3]"
    }
  } else {
    putserv "NOTICE $nick :[pwf_txt noauth]"
  }
}


proc pwf_addadmin {nick uhost hand channel rest} {
  global botnick pwf_pickupchan
  if { $channel == $pwf_pickupchan } {
    set victime [lindex $rest 0]
    if { [matchattr $hand H] } {
      if [matchattr $hand m|m $channel] {
        if [onchan $victime $channel] {
          set victhand [nick2hand $victime]
          if [string compare $victhand "*"] {
            if [matchattr $victhand G|G $channel] {
              putserv "NOTICE $nick :[pwf_txt right1]"
            } else {
              chattr $victhand +|GY $channel
              putserv "NOTICE $nick :[pwf_txt right2] $victime"
              putserv "NOTICE $victime :[pwf_txt right3] $channel [pwf_txt right4a]"
              return 1
            }
          } else {
            adduser $victime [maskhost [getchanhost $victime $channel]]
            chattr [nick2hand $victime] +|GY $channel
            putserv "NOTICE $nick :[pwf_txt right2] $victime"
            putserv "NOTICE $victime :[pwf_txt right3] $channel [pwf_txt right4b]"
            return 1
          }
        } else {
          putserv "NOTICE $nick :[pwf_txt right5]"
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt right6]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt noauth]"
    }
  }
}


proc pwf_removeadmin {nick uhost hand channel rest} {
  global botnick pwf_pickupchan
  if { $channel == $pwf_pickupchan } {
    set victime [lindex $rest 0]
    if { [matchattr $hand H] } { 
      if [matchattr $hand m|m $channel] {
        if [onchan $victime $channel] {
          set victhand [nick2hand $victime]
          if [matchattr $victhand &G $channel] {
            chattr $victhand |-GYZ $channel
            putserv "NOTICE $nick :[pwf_txt right7] $victime"
            putserv "NOTICE $victime :[pwf_txt right8]"
            return 1
          } else {
            putserv "NOTICE $nick :[pwf_txt right9]"
          }
        } else {
          if [validuser $victime] {
            if [matchattr $victime &|G $channel] {
              chattr $victime |-GYZ $channel
              putserv "NOTICE $nick :[pwf_txt right7] $victime"
              return 1
            } else {
              putserv "NOTICE $nick :[pwf_txt right9]"
            }
          } else {
            putserv "NOTICE $nick :[pwf_txt right9]"
          }
        }
      } else {
        putserv "NOTICE $nick :[pwf_txt right0]"
      }
    } else {
      putserv "NOTICE $nick :[pwf_txt noauth]"
    }
  }
}


proc pwf_remoldflag {} {
  global pwf_pickupchan pwf_authnick
  foreach pwf_handlecheck [userlist H] {
    set pwf_nickcheck [hand2nick $pwf_handlecheck $pwf_pickupchan]
    if { ( $pwf_nickcheck == "" ) || ( ![info exists pwf_authnick($pwf_nickcheck)] ) } {
      chattr $pwf_handlecheck -H
      if { [info exists pwf_authnick($pwf_nickcheck)] } {
        unset pwf_authnick($pwf_nickcheck)
      }
    }
  }
}


proc pwf_isauth { nick chan } {
  global pwf_authnick
  if ![info exists pwf_authnick($nick)] { return "" }
    if [matchattr $pwf_authnick($nick) G|G $chan] {
      if [matchattr $pwf_authnick($nick) H] {
        return $pwf_authnick($nick)
      }
    }
  return ""
}


proc pwf_auth {nick uhost hand rest} {
  global pwf_authnick botnick pwf_pickupchan
  set handle hand
  set pw [lindex $rest 0]
  set givenick [lindex $rest 1]
  if [string length $givenick] {
    set hand $givenick
  } else {
    if ![string compare $hand "*"] {
      putserv "NOTICE $nick :[pwf_txt auth1]"
      return 0
    }
  }
  if [lsearch -exact [userlist G|G] $hand]==-1 {
    putserv "NOTICE $nick :[pwf_txt auth2]"
    return 0
  }
  set ok 0
  if [onchan $nick $pwf_pickupchan] {
     set ok 1
  }
  if !$ok {
    putserv "NOTICE $nick :[pwf_txt auth3] $pwf_pickupchan [pwf_txt auth4]"
    return 0
  }
  if [info exists pwf_authnick($nick)] {
    putserv "NOTICE $nick :[pwf_txt auth5] $pwf_authnick($nick)."
    return 0
  }
  if ![string length $pw] {
    putserv "NOTICE $nick :[pwf_txt auth6]"
    return 0
  }
  if [passwdok $hand ""] {
    putserv "NOTICE $nick :[pwf_txt auth7]"
    return 0
  }
  if [passwdok $hand $pw] {
    chattr $hand +H
    set pwf_authnick($nick) $hand
    putserv "NOTICE $nick :[pwf_txt auth8]"
    putcmdlog "($nick!$uhost) !$hand! admin ..."
  } else {
    putserv "NOTICE $nick :[pwf_txt auth9]"
    putcmdlog "($nick!$uhost) !$hand! FAILED admin"
  }
}

proc pwf_tchk { } {
  global pwf_timeoutdelay pwf_authnick pwf_pickupchan
  timer 2 pwf_tchk
  set inactnicks ""
  set actnicks ""
  set chan $pwf_pickupchan
  foreach nick [chanlist $chan] {
    if [string length [pwf_isauth $nick $chan]] {
      set inactindex [lsearch -exact $inactnicks $nick]
      set actindex [lsearch -exact $actnicks $nick]
      if [getchanidle $nick $chan]>$pwf_timeoutdelay {
        if ($inactindex==-1)&&($actindex==-1) {
          lappend inactnicks $nick
        }
      } else {
        if ($actindex!=-1) {
          lappend actnicks $nick
        }
        set inactnicks [lreplace $inactnicks $inactindex $inactindex]
      }
    }
  }
  foreach nick $inactnicks {
    chattr $pwf_authnick($nick) -H
    unset pwf_authnick($nick)
    putserv "NOTICE $nick :[pwf_txt auth0]"
  }
}


proc pwf_txt { txt } {
  global pwf_reply botnick pwf_maptopic
  if { [info exists pwf_maptopic] } {
    return $pwf_reply($txt)
  } else {
    return $pwf_reply(wait)
  }
}

## You can easyly translate and edit all the msg the bot reply here ( utimer is used to wait for the value of $botnick , do not use variable wich are not glabal )  

set pwf_reply(wait) "Please wait during language initialisation. Try again in some seconds ( 60 secs max )"

utimer 60 {
if $pwf_language==1 {
set pwf_reply(addme1) "4Invalid team 14( try a team using !addme a or b )"
set pwf_reply(addme2) "14Sorry but the current game is a ** VIP ** match, only voiced users and opers can add themselves."
set pwf_reply(addme3) "4There is no match for the moment."
set pwf_reply(addme4) "14Match are disable on this chan."
set pwf_reply(addme5) "4I can't find you in any team."
set pwf_reply(vote1) "Vote Recorded"
set pwf_reply(vote2) "4This map is not in my database."
set pwf_reply(vote3) "7The most voted map is now"
set pwf_reply(vote4) "4Map has been set by the pickup admin, votes are disabled."
set pwf_reply(vote5) "4You have to be in a valid team to vote for a map."
set pwf_reply(ip1) "5The next match will start on"
set pwf_reply(ip2) "5Check your ping..."
set pwf_reply(admin1) "4Ambiguous command, use !addmap <map>"
set pwf_reply(admin2) "4You are not the administror of this match."
set pwf_reply(admin3) "4Ambiguous number, use !playernumber <number>"
set pwf_reply(admin4) "4Invalid player number. Please enter a pair number."
set pwf_reply(addgame1) "14IP :"
set pwf_reply(addgame2) "- Password :"
set pwf_reply(addgame3) "- ** VIP **"
set pwf_reply(addgame4) "- If these informations are correct, use /msg $botnick info ok , if not use /msg $botnick info wrong"
set pwf_reply(addgame5) "5The last match was a 14** VIP ** game, you can't launch an other one now. Please use addgame again."
set pwf_reply(addgame6) "14A pickup is currently running on the channel and is managed by"
set pwf_reply(addgame7) "14, try again it will be finished."
set pwf_reply(addgame8) "14You have to enter both : <ip:port> AND <password> . Please use addgame command again."
set pwf_reply(addgame9) "14Ok, thank you for confirming, your game is now launched"
set pwf_reply(addgame0) "14Your server info are now deleted, please use the /msg $botnick addgame <ip:port> <password> command again"
set pwf_reply(addgame10) "14You can't laucnh a new match now because pickups have been disabled on"
set pwf_reply(noauth) "You are not authenticated, use /msg $botnick admin <password>"
set pwf_reply(help1) "Public Channel commands are : !add <team> - !remove - !votemap <map> - !ip - !teams"
set pwf_reply(help2) "Admins Channel commands are : !addmap <map> - !addtype <type> - !playernumber <number> - !enable - !disable"
set pwf_reply(help3) "Admins Private commands are : addgame <ip:port> <password> - info <ok> - endgame - permban <mask> - permbaninfo <ok>"
set pwf_reply(help4) "Admins don't forget to authenticate yourself before using commands by typing /msg $botnick admin <password>"
set pwf_reply(help5) "Don't be lame and enjoy your pickup."
set pwf_reply(help6) "More info about this script :"
set pwf_reply(cancel1) "4The server admin ("
set pwf_reply(cancel2) ") canceled the game :("
set pwf_reply(cancel3) ") left the channel, the game is canceled :("
set pwf_reply(cancel4) "14You try to cancel a game but no games are launched."
set pwf_reply(cancel5) "14You are not the Server-Holder of the current game, you can't end it."
set pwf_reply(deauthpart) "Auto-deauthentication after a channel part."
set pwf_reply(deauthkick) "Auto-deauthentication after a channel kick."
set pwf_reply(start1) "4Match Starting, please wait during password forwarding... ( if you subscribed this match, check your private messages )"
set pwf_reply(start2) "14- You are in team 4A14 ( Start 12CT14 ) - Your admin is4"
set pwf_reply(start3) "14- You are in team 4B14 ( Start 4Terro14 ) - Your admin is4"
set pwf_reply(start4) "14- GO GO GO connect to the server NOW"
set pwf_reply(banconf1) "14Ban this mask for life :"
set pwf_reply(banconf2) "? ( use /msg $botnick permbaninfo ok to confirm )"
set pwf_reply(banconf3) "14Ok , user is now banned :/"
set pwf_reply(banconf4) "14Ban canceled, use /msg $botnick permban again."
set pwf_reply(banconf5) "pickup-lamer successfully removed"
set pwf_reply(enable1) "4Pickup are now enbale on this channel."
set pwf_reply(enable2) "14This channel is already enabled."
set pwf_reply(enable3) "4This channel is not in my channel database or this chan is already enabled."
set pwf_reply(disable1) "4Pickup are now disabled on this channel."
set pwf_reply(disable2) "14This chan is already disabled."
set pwf_reply(disable3) "4This channel is not in my channel database or this chan is already disabled."
set pwf_reply(disable4) "14You cannot disable a chan where a pickup is launching if you are not a channel master."
set pwf_reply(right1) "14The user you are trying to add a Game-Admin acces already have one."
set pwf_reply(right2) "14You just added a Game-Admin access to :"
set pwf_reply(right3) "4Congratulations, you now have the Game-Admin access on"
set pwf_reply(right4a) "!14 You can authenticate yourself using: /msg $botnick admin <password> . Help available on /msg $botnick help"
set pwf_reply(right4b) "!14 You should specify a password immediatly using: /msg $botnick pass <password> . You can then authenticate yourself using: /msg $botnick admin <password> . Help available on /msg $botnick help"
set pwf_reply(right5) "14The user you are trying to add a Game-Admin acces is not on the channel for the moment."
set pwf_reply(right6) "14You are authenticated, but you don't have the required rights to add a new Game-Admin access."
set pwf_reply(right7) "14You have removed Game-Admin access to"
set pwf_reply(right8) "4You Game-Admin access has been removed. 14You won't be able to use commands anymore on"
set pwf_reply(right9) "14This user dont't have Game-Admin access."
set pwf_reply(right0) "14You are authenticated, but you don't have the rights to remove a Game-Admin access."
set pwf_reply(auth1) "14You aren't recognized by the bot. Maybe you changed your ident@host. Please contact an operator."
set pwf_reply(auth2) "14You are recognized, but you don't have the Game-Admin access. Please contact an operator."
set pwf_reply(auth3) "14You have to be on"
set pwf_reply(auth4) "to authenticate yourself."
set pwf_reply(auth5) "14You are already authenticated as a Game-Admin with the nick"
set pwf_reply(auth6) "14Syntax : /msg $botnick admin <password>"
set pwf_reply(auth7) "4You don't have any password set.14 Type /msg $botnick pass <password>"
set pwf_reply(auth8) "14You are now authenticated as a Game-Admin."
set pwf_reply(auth9) "4Authentication failed ... logged !"
set pwf_reply(auth0) "14Your Game-Admin authentication has been removed automatcly because of your idleness."
set pwf_reply(rehash) "4database has been restarted, sorry for the disturbance."
set pwf_reply(welcome) "Welcome"
set pwf_reply(topic1) "7Ready for next match 1-2 Admin is"
set pwf_reply(topic2) "1-3"
set pwf_reply(topic4) "1-10 Game Type :"
set pwf_reply(topic5) "1- 14** VIP GAME **"
set pwf_reply(teams1) "2 Currently :3"
set pwf_reply(separator) "1-"
set pwf_reply(defteama) "5Team A : 2"
set pwf_reply(defteamb) "5Team B : 2"
set pwf_reply(defteama2) "5Team A :2 ? - ? - ? - ? - ? -"
set pwf_reply(defteamb2) "5Team B :2 ? - ? - ? - ? - ?"
set pwf_reply(defmap) "Map not defined yet"
set pwf_reply(misc1) "topicmem : could not edit the topic file of"
} elseif $pwf_language==2 {
set pwf_reply(addme1) "4Team invalide 14( essayez une team avec !addme a ou b )"
set pwf_reply(addme2) "14Dsoler mais le jeu actuel est un match ** VIP ** , seuls les utilisateurs voice ou op peuvent s'ajouter."
set pwf_reply(addme3) "4Aucun pickup pour l'instant."
set pwf_reply(addme4) "14Les pickup sont actuellement dsactivs sur ce channel."
set pwf_reply(addme5) "4Je ne vous ai trouv dans aucune team."
set pwf_reply(vote1) "Vote enrgistr"
set pwf_reply(vote2) "4Cette map n'est pas dans ma base de donne."
set pwf_reply(vote3) "7La map la plus sollicite est maintenant"
set pwf_reply(vote4) "4La map a t choisie par l'administeur de ce pickup, les votes sont dsactivs."
set pwf_reply(vote5) "4Vous devez tre dans une team pour pouvoir voter."
set pwf_reply(ip1) "5Le prochain match se jouera sur"
set pwf_reply(ip2) "5Testez votre ping..."
set pwf_reply(admin1) "4Commande ambigu, utilisez !addmap <map>"
set pwf_reply(admin2) "4Vous n'tes pas l'administrateur de ce pickup."
set pwf_reply(admin3) "4Commande ambigu, utlisez !pwf_playernumber <nombre>"
set pwf_reply(admin4) "4Nombre de joueurs invalide. N'utilisez que des nombres pairs svp"
set pwf_reply(addgame1) "14IP :"
set pwf_reply(addgame2) "- Mot-de-Passe :"
set pwf_reply(addgame3) "- ** VIP **"
set pwf_reply(addgame4) "- Si ces informations sont correctent, utilisez /msg $botnick info ok , sinon utilisez /msg $botnick info erreure"
set pwf_reply(addgame5) "5Le dernier pickup tait dja un match 14** VIP **, vous ne pouvez pas en lancer un nouveau maintenant. Veuillez utilisez addgame  nouveau."
set pwf_reply(addgame6) "14Un match est dj en cour sur le channel et est administrer par"
set pwf_reply(addgame7) "14, ressayez quand celui ci sera termnin."
set pwf_reply(addgame8) "14Commande ambigu, vous devez entrer <ip:port> ET <mot-de-passe> . Veuillez utilisez addgame  nouveau."
set pwf_reply(addgame9) "14Ok, merci d'avoir confirm, votre match est lanc."
set pwf_reply(addgame0) "14Les informations que vous avez entr ont t effaces, utilisez la commande /msg $botnick addgame <ip:port> <mot-de-passe>  nouveau."
set pwf_reply(addgame10) "14Vous ne pouvez pas lancer de nouveau match pour le moment car les pickup ont t dsactivs sur"
set pwf_reply(noauth) "14Vous n'tes pas authentifi, utilisez /msg $botnick admin <mot-de-passe>"
set pwf_reply(help1) "Commandes Publiques sur le channel  : !add <team> - !remove - !votemap <map> - !ip - !teams"
set pwf_reply(help2) "Commandes des Admins sur le channel : !addmap <map> - !addtype <type> - !playernumber <nombre> - !enable - !disable"
set pwf_reply(help3) "Commandes des Admins en priv       : addgame <ip:port> <password> - info <ok> - endgame - permban <mask> - permbaninfo <ok>"
set pwf_reply(help4) "Pour les Admins, n'oubliez pas de vous authentifier pour utiliser les commandes en tapant /msg $botnick admin <mot-de-passe>"
set pwf_reply(help5) "Respectez les autres joueurs et amusez vous bien."
set pwf_reply(help6) "Pour plus d'informations  propos de ce script :"
set pwf_reply(cancel1) "4L'administrateur du match ("
set pwf_reply(cancel2) ") a annul le pickup :("
set pwf_reply(cancel3) ") a quitt le channel, le match est donc annul :("
set pwf_reply(cancel4) "14Vous essayez d'annuler un match en cour mais il n'y en a aucun."
set pwf_reply(cancel5) "14Vous n'tes pas le Server-Holder de ce match, vous ne pouvez pas annuler le match."
set pwf_reply(deauthpart) "14Dsauthentification automatique aprs avoir quitter le channel."
set pwf_reply(deauthkick) "14Dsauthentification automatique aprs avoir t kicker."
set pwf_reply(start1) "4Le match va maintenant commencer, veillez patienter pendant l'envoi du mot-de-passe... ( si vous tes inscris pour ce match, vrifiez vos messages privs )"
set pwf_reply(start2) "14- Vous tes dans l'quipe 4A14 ( Dbutez 12CT14 ) - Votre admin est4"
set pwf_reply(start3) "14- Vous tes dans l'quipe 4B14 ( Dbutez 4Terro14 ) - Votre admin est4"
set pwf_reply(start4) "14- GO GO GO connectez le serveur maintenant."
set pwf_reply(banconf1) "14Bannir ce mask de faon permanente :"
set pwf_reply(banconf2) "? ( utilisez /msg $botnick permbaninfo ok pour confirmer )"
set pwf_reply(banconf3) "14Ok, l'utilisateur est bannis de faon permanente :/"
set pwf_reply(banconf4) "14Ban annul, utilisez /msg $botnick permban  nouveau."
set pwf_reply(banconf5) "pickup-lamer successfully removed"
set pwf_reply(enable1) "4Les pickup sont maintenant actifs sur ce channel."
set pwf_reply(enable2) "14Ce channel est dj activ."
set pwf_reply(enable3) "4Ce channel n'est pas dans ma base de donne ou ce channel est dj activ."
set pwf_reply(disable1) "4Les pickup sont maintenant dsactivs sur ce channel."
set pwf_reply(disable2) "14Ce channel est dj dsactiv."
set pwf_reply(disable3) "4Ce channel n'est pas dans ma base de donne ou ce channel est dj dsactiv."
set pwf_reply(disable4) "14Vous ne pouvez pas dsactiver ce channel si vous n'tes pas master de celui-ci."
set pwf_reply(right1) "14L'utilisateur pour lequel vous essayez d'ajouter l'accs Game-Admin l'a dj."
set pwf_reply(right2) "14Vous avez donn l'accs Game-Admin "
set pwf_reply(right3) "4Flicitation, vous tes maintenant un Game-Admin sur"
set pwf_reply(right4a) "!14 Vous pouvez vous authentifier en utilisant: /msg $botnick admin <mot-de-passe> . Si vous avez besoin d'aide tapez /msg $botnick help"
set pwf_reply(right4b) "!14 Vous devriez dfinir votre mot de passe en utilisant: /msg $botnick pass <mot-de-passe> . Vous pourrez ensuite vous authentifier avec: /msg $botnick admin <mot-de-passe> . Si vous avez besoin d'aide tapez /msg $botnick help"
set pwf_reply(right5) "14L'utilisateur pour lequel vous tentez d'ajouter un accs Game-Admin n'est pas sur le channel pour l'instant."
set pwf_reply(right6) "14Vous tes authentifi mais vous n'avez pas les droits pour ajouter un nouvel accs Game-Admin."
set pwf_reply(right7) "14Vous avez effacer l'acces Game-Admin de"
set pwf_reply(right8) "4Votre accs Game-Admin vous a t supprimer, vous ne pouvez plus utiliss les commandes d'administration sur"
set pwf_reply(right9) "14Cet utilisateur n'a pas d'accs Game-Admin."
set pwf_reply(right0) "14Vous tes authentifi mais vous n'avez pas les droits pour supprimer un accs Game-Admin."
set pwf_reply(auth1) "14Vous n'tes pas reconnu, peut-tre avez vous modifi votre ident@host. Veuillez contacter un oprateur."
set pwf_reply(auth2) "14Vous tes reconnu, mais vous n'avez pas d'accs Game-Admin. Veuillez contacter un oprateur."
set pwf_reply(auth3) "14Vous devez etre prsent sur"
set pwf_reply(auth4) "pour vous authentifier."
set pwf_reply(auth5) "14Vous tes dj authentifi en tant que Game-Admin avec le nick"
set pwf_reply(auth6) "14Syntaxe : /msg $botnick admin <mot-de-passe>"
set pwf_reply(auth7) "4Vous n'avez encore aucun mot de passe dfini.14 Tapez /msg $botnick pass <mot-de-passe>"
set pwf_reply(auth8) "14Vous tes maintenant authentifi en tant que Game-Admin."
set pwf_reply(auth9) "4L'authentification a chouer ... essais logger !"
set pwf_reply(auth0) "14Votre authentification vous a t automatiquement retire suite  une absence prolonge."
set pwf_reply(rehash) "4La base de donne a t remise a zro, veuillez nous excuser."
set pwf_reply(welcome) "Bienvenue"
set pwf_reply(topic1) "7Prt pour le prochain match 1-2 Admin :"
set pwf_reply(topic2) "1-3"
set pwf_reply(topic4) "1-10 Type de match :"
set pwf_reply(topic5) "1- 14** MATCH VIP **"
set pwf_reply(teams1) "2 Actuellement :3"
set pwf_reply(separator) "1-"
set pwf_reply(defteama) "5Team A : 2"
set pwf_reply(defteamb) "5Team B : 2"
set pwf_reply(defteama2) "5Team A :2 ? - ? - ? - ? - ? -"
set pwf_reply(defteamb2) "5Team B :2 ? - ? - ? - ? - ?"
set pwf_reply(defmap) "Map non dsigne pour l'instant"
set pwf_reply(misc1) "topicmem : impossible d'editer le fichier topic de"
} else {
  putlog "Error with language in pwf.tcl , please verify your config"
}
  set pwf_teamatopic [pwf_txt defteama2]
  set pwf_teambtopic [pwf_txt defteamb2]
  set pwf_maptopic [pwf_txt defmap]
}

if [info exists pwf_rehashmsg] {
  putserv "PRIVMSG $pwf_pickupchan :[pwf_txt rehash]"
} else {
  set pwf_rehashmsg 1
}

pwf_setnogame

putlog "Play With Friends by kalhimeo has successfully loaded"