This file is indexed.

/usr/share/irssi/scripts/twsocials.pl is in irssi-scripts 20170711.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
use Irssi::Irc;
use DBI;

$VERSION = '1.02';
%IRSSI = (
   authors      => 'John Engelbrecht',
   contact      => 'jengelbr@yahoo.com',
   name         => 'twsocials.pl',
   description  => 'IRC version of Social Commands',
   license      => 'Public Domain',
   changed      => 'Sat Nov 20 18:25:12 CST 2004',
   url          => 'http://irssi.darktalker.net/',
);

my $instrut =
  ".------------------------------------------------------.\n".
  "| 1.) shell> mkdir ~/.irssi/scripts                    |\n".
  "| 2.) shell> cp twsocials.pl ~/.irssi/scripts/         |\n".
  "| 3.) shell> mkdir ~/.irssi/scripts/autorun            |\n".
  "| 4.) shell> ln -s ~/.irssi/scripts/twsocials.pl \\     |\n".
  "|            ~/.irssi/scripts/autorun/twsocials.pl     |\n".
  "| 5.) /help            (Will list all your socials)    |\n".
  "|     /socials         (Shows you a list of arguments) |\n".
  "|     /socials list    (Shows a list of socials)       |\n".
  "|     /socials <social>(Contents of the Social command)|\n".
  "| 6.) /toggle twsocials_instruct and last /save        |\n".
  "|------------------------------------------------------|\n".
  "|  Options:                                   Default: |\n".
  "|  /toggle twsocials_remote                     OFF    |\n".
  "|  /toggle twtopic_instruct     |Startup instructions  |\n".
  "|------------------------------------------------------|\n".
  "|  Note:                                               |\n".
  "|  If twsocials_remote is ON, that will enable public  |\n".
  "|  and private social commands to work, such as the    |\n".
  "|  the following.                                      |\n".
  "|                                                      |\n".
  "|  < TechWizard> !social                               |\n".
  "|  < TechWizard> !social list                          |\n".
  "|  < TechWizard> !social blist                         |\n".
  "|  < TechWizard> !hug                                  |\n".
  "|  < TechWizard> !hug JohnDoe                          |\n".
  "|  < TechWizard> !hug JohnDoe 1                        |\n".
  "\`------------------------------------------------------'";


my $maxsize=62;
my $lastcmd="";
my $home_chan="";
my $path = "~/.irssi/socials";
my @colname = ("Dark Black","Dark Red","Dark Green","Dark Yellow","Dark Blue","Dark Magenta","Dark Cyan","Dark White","Bold Black","Bold Red","Bold Green","Bold Yellow","Bold Blue","Bold Magenta","Bold Cyan","Bold White","Reset","O");
my @mirc_color_name = ("~R0","~R1","~R2","~R3","~R4","~R5","~R6","~R7","~B0","~B1","~B2","~B3","~B4","~B5","~B6","~B7","~RS");
my @mirc_color_arr = ("\0031","\0035","\0033","\0037","\0032","\0036","\00310","\0030","\00314","\0034","\0039","\0038","\00312","\00313","\00311","\00315","\017");
my ($r0,$r1,$r2,$r3,$r4,$r5,$r6,$r7,$b0,$b1,$b2,$b3,$b4,$b5,$b6,$b7,$rs) = @mirc_color_arr;
   $path =~ s/^~\//$ENV{'HOME'}\//;
my $bc=$r4;
my $bt=$r2;
my $m1=$r1;
my $m2=$b1;

################ Checking Social's home Directory #############
init_socpath();   
###############################################################

sub message_public {
  my($server, $data, $nick, $address, $target) = @_;
  if(!Irssi::settings_get_bool('twsocials_remote')) { return; }
  $home_chan=$target;
  $data =~ s/\r//;
  my $socname;
  my @data_arr = split " ", $data;
  if(@data_arr[0] eq "!social") {
     if(!$#data_arr) {
        syntax($server,$target);
        return; 
        }
     if(@data_arr[1] eq "color") {
        colorlist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "list") {
        soclist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "blist") {
        socblist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "add") {
        if($#data_arr == 1) {
           $server->command("msg $target $r3(USAGE) $rs!social$b4 add$rs <social>$r3 :$rs$r2 Adds a new Social.");
           return; 
           } 
        $socname = @data_arr[2];
        addsoc($server,$target,$socname);
        return; 
        }     
     if(@data_arr[1] eq "del") {
        if($#data_arr == 1) {
           $server->command("msg $target $r3(USAGE) $rs!social$b4 dels$rs <social> $r3:$r2 Deletes a Social.");
           return; 
           }        
        $socname = @data_arr[2];
        delsoc($server,$target,$socname);
        return; 
        }     
     if(@data_arr[1] eq "set") {
        if($#data_arr <= 3) {
           set_syntax($server, $target, $socname);
           return; 
           }
        $socname = @data_arr[2];
        my $set = @data_arr[3];
        my $cutstr = "@data_arr[0] @data_arr[1] @data_arr[2] @data_arr[3] ";
        $data =~ s/$cutstr//;
        setsoc($server,$target,$socname,$set,$data);
        return; 
        }     
     $socname = @data_arr[1];
     print_social($server, $target, $socname);
     return;
     }
  if(@data_arr[0] eq "!soclist") {
     soclist($server,$target);
     return; 
     }
  my $chr="!";
  $socname = @data_arr[0];
  my @socname_arr = split //, $socname;
  if(@socname_arr[0] ne $chr) { return; }
  $socname =~ s/$chr//;
  my ($nick2,$msgsw);
  if(!ifexist_social($socname)) { return; }
  if($#data_arr == 0) {
     $nick2 = "UNSET";
     $msgsw=0;
     }
  if($#data_arr == 1) {
     $nick2 = @data_arr[1];
     $msgsw=0;
     }
  if($#data_arr == 2) {
     $nick2 = @data_arr[1];
     $msgsw=1;
     }  
  my $chan = Irssi::Irc::Server->channel_find($home_chan);
  my $nick_obj = $chan->nick_find($nick2);
  if($nick_obj->{nick} eq "" && $nick2 ne "UNSET") { 
     $server->command("msg $target nickname does not exist.");
     return;
     }
  do_social($server,$target,$socname,$nick,$nick2,$msgsw);
}

sub message_private {
  my($server, $data, $nick, $address) = @_;
  if(!Irssi::settings_get_bool('twsocials_remote')) { return; }
  my $target=$nick;
  $home_chan=$target;
  $data =~ s/\r//;
  my $socname;
  my @data_arr = split " ", $data;
  if(@data_arr[0] eq "!social") {
     if(!$#data_arr) {
        syntax($server,$target);
        return; 
        }
     if(@data_arr[1] eq "color") {
        colorlist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "list") {
        soclist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "blist") {
        socblist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "add") {
        if($#data_arr == 1) {
           $server->command("msg $target $r3(USAGE) $rs!social$b4 add$rs <social>$r3 :$rs$r2 Adds a new Social.");
           return; 
           } 
        $socname = @data_arr[2];
        addsoc($server,$target,$socname);
        return; 
        }     
     if(@data_arr[1] eq "del") {
        if($#data_arr == 1) {
           $server->command("msg $target $r3(USAGE) $rs!social$b4 dels$rs <social> $r3:$r2 Deletes a Social.");
           return; 
           }        
        $socname = @data_arr[2];
        delsoc($server,$target,$socname);
        return; 
        }     
     if(@data_arr[1] eq "set") {
        if($#data_arr <= 3) {
           set_syntax($server, $target, $socname);
           return; 
           }
        $socname = @data_arr[2];
        my $set = @data_arr[3];
        my $cutstr = "@data_arr[0] @data_arr[1] @data_arr[2] @data_arr[3] ";
        $data =~ s/$cutstr//;
        setsoc($server,$target,$socname,$set,$data);
        return; 
        }     
     $socname = @data_arr[1];
     print_social($server, $target, $socname);
     return;
     }
  if(@data_arr[0] eq "!soclist") {
     soclist($server,$target);
     return; 
     }
  my $chr="!";
  $socname = @data_arr[0];
  my @socname_arr = split //, $socname;
  if(@socname_arr[0] ne $chr) { return; }
  $socname =~ s/$chr//;
  my ($nick2,$msgsw);
  if(!ifexist_social($socname)) { return; }
  if($#data_arr == 0) {
     $nick2 = "UNSET";
     $msgsw=0;
     }
  if($#data_arr == 1) {
     $nick2 = @data_arr[1];
     $msgsw=0;
     }
  if($#data_arr == 2) {
     $nick2 = @data_arr[1];
     $msgsw=1;
     }  
  my $nick1 = $nick;
  do_social($server,$target,$socname,$nick1,$nick2,$msgsw);
}

sub on_public {
  my($server, $data, $nick, $address, $target) = @_;
  if(!Irssi::settings_get_bool('twsocials_remote')) { return; }
  if($data !~ /^!/) { return; } 
  $home_chan=$nick;
  $target=Irssi::active_win()->{active}->{name};
  $home_chan=$target;
  $data =~ s/\r//;
  my $socname;
  my @data_arr = split " ", $data;
  if(@data_arr[0] eq "!social") {
     if(!$#data_arr) {
        syntax($server,$target);
        return; 
        }
     if(@data_arr[1] eq "color") {
        colorlist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "list") {
        soclist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "blist") {
        socblist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "add") {
        if($#data_arr == 1) {
           $server->command("msg $target $r3(USAGE) $rs!social$b4 add$rs <social>$r3 :$rs$r2 Adds a new Social.");
           return; 
           }
        $socname = @data_arr[2];
        addsoc($server,$target,$socname);
        return; 
        }     
     if(@data_arr[1] eq "del") {
        if($#data_arr == 1) {
           $server->command("msg $target $r3(USAGE) $rs!social$b4 dels$rs <social> $r3:$r2 Deletes a Social.");
           return; 
           }
        $socname = @data_arr[2];
        delsoc($server,$target,$socname);
        return; 
        }     
     if(@data_arr[1] eq "set") {
        if($#data_arr <= 3) {
           set_syntax($server, $target, $socname);
           return;
           }
        $socname = @data_arr[2];
        my $set = @data_arr[3];
        my $cutstr = "@data_arr[0] @data_arr[1] @data_arr[2] @data_arr[3] ";
        $data =~ s/$cutstr//;
        setsoc($server,$target,$socname,$set,$data);
        return; 
        }     
     $socname = @data_arr[1];
     print_social($server, $target, $socname);
     return;
     }
  if(@data_arr[0] eq "!soclist") {
     soclist($server,$target);
     return; 
     }
  my $chr="!";  
  $socname = @data_arr[0];
  my @socname_arr = split //, $socname;
  if(@socname_arr[0] ne $chr) { return; }
  $socname =~ s/$chr//;
  my ($nick2,$msgsw);
  if(!ifexist_social($socname)) {
     return;
     }
  if($#data_arr == 0) {
     $nick2 = "UNSET";
     $msgsw=0;
     }
  if($#data_arr == 1) {
     $nick2 = @data_arr[1];
     $msgsw=0;
     }
  if($#data_arr == 2) {
     $nick2 = @data_arr[1];
     $msgsw=1;
     }  
  my $nick1 = $server->{nick};
  my $chan = Irssi::Irc::Server->channel_find($home_chan);
  my $nick_obj = $chan->nick_find($nick2);
  if($nick_obj->{nick} eq "" && $nick2 ne "UNSET") { 
     $server->command("msg $target nickname does not exist.");
     return;
     }
  do_social($server,$target,$socname,$nick1,$nick2,$msgsw);
}

sub on_private {
  my($server, $data, $nick, $address, $target) = @_;
  if(!Irssi::settings_get_bool('twsocials_remote')) { return; }
  if($data !~ /^!/) { return; } 
  $home_chan=$nick;
  $target=$nick;
  $data =~ s/\r//;
  my $socname;
  my @data_arr = split " ", $data;
  if(@data_arr[0] eq "!social") {
     if(!$#data_arr) {
        syntax($server,$target);
        return; 
        }
     if(@data_arr[1] eq "color") {
        colorlist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "list") {
        soclist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "blist") {
        socblist($server,$target);
        return; 
        }     
     if(@data_arr[1] eq "add") {
        if($#data_arr == 1) {
           $server->command("msg $target $r3(USAGE) $rs!social$b4 add$rs <social>$r3 :$rs$r2 Adds a new Social.");
           return; 
           }
        $socname = @data_arr[2];
        addsoc($server,$target,$socname);
        return; 
        }     
     if(@data_arr[1] eq "del") {
        if($#data_arr == 1) {
           $server->command("msg $target $r3(USAGE) $rs!social$b4 dels$rs <social> $r3:$r2 Deletes a Social.");
           return; 
           }
        $socname = @data_arr[2];
        delsoc($server,$target,$socname);
        return; 
        }     
     if(@data_arr[1] eq "set") {
        if($#data_arr <= 3) {
           set_syntax($server, $target, $socname);
           return;
           }
        $socname = @data_arr[2];
        my $set = @data_arr[3];
        my $cutstr = "@data_arr[0] @data_arr[1] @data_arr[2] @data_arr[3] ";
        $data =~ s/$cutstr//;
        setsoc($server,$target,$socname,$set,$data);
        return; 
        }     
     $socname = @data_arr[1];
     print_social($server, $target, $socname);
     return;
     }
  if(@data_arr[0] eq "!soclist") {
     soclist($server,$target);
     return; 
     }
  my $chr="!";  
  $socname = @data_arr[0];
  my @socname_arr = split //, $socname;
  if(@socname_arr[0] ne $chr) { return; }
  $socname =~ s/$chr//;
  my ($msgsw,$nick2);
  if(!ifexist_social($socname)) {
     return;
     }
  if($#data_arr == 0) {
     $nick2 = "UNSET";
     $msgsw=0;
     }
  if($#data_arr == 1) {
     $nick2 = @data_arr[1];
     $msgsw=0;
     }
  if($#data_arr == 2) {
     $nick2 = @data_arr[1];
     $msgsw=1;
     }  
  my $nick1 = $server->{nick};
  $target = $nick;
  do_social($server,$target,$socname,$nick1,$nick2,$msgsw);
}

sub addsoc {
   my ($server,$target,$socname) = @_;
   if(ifexist_social($socname)) {
      $server->command("msg $target r3social: $rs$socname already exist.");
      return;
      }
   #write_social($socname,$fpriv,$fself,$fnobody,$fpublic,$fyou,$fthem) 
   write_social($socname,"0","UNSET","UNSET","UNSET","UNSET","UNSET");
   irssicmd_socials($socname);
   $server->command("msg $target $r2 done.");   
   return;
}

sub irssi_addsoc {
   my ($data, $server, $witem) = @_;
   my @data_arr = split / /, $data;
   if(@data_arr[0] eq "") { 
      irssi_syntax();
      return;
      }
   my $socname = @data_arr[0];
   if(ifexist_social($socname)) {
      print "$rs$socname already exist.";
      return;
      }
   write_social($socname,"0","UNSET","UNSET","UNSET","UNSET","UNSET");
   irssicmd_socials($socname);
   print "$r2 done.";
   return;
}

sub delsoc {
   my ($server,$target,$socname) = @_;
   if(!ifexist_social($socname)) {
      $server->command("msg $target $r3 DELETE $socname: $rs$socname social does not exist.");
      return;
      }
   my $filename ="$path/$socname.txt";
   unlink($filename);
   irssicmd_socials($socname);
   $server->command("msg $target $r2 done.");   
   return;
}

sub irssi_delsoc {
   my ($data, $server, $witem) = @_;
   my @data_arr = split / /, $data;
   if(@data_arr[0] eq "") { 
      irssi_syntax();
      return;
      }
   my $socname = @data_arr[0];
   if(!ifexist_social($socname)) {
      print "$r3 DELETE $socname: $rs$socname social does not exist.";
      return;
      }
   my $filename ="$path/$socname.txt";
   unlink($filename);
   irssicmd_socials($socname);
   print "$r2 done.";
   return;
}

sub setsoc {
   my ($server,$target,$socname,$set,$data) = @_;
   my @sets = ("priv","nobody","public","self","them","you");
   if(!ifexist_social($socname)) {
      $server->command("msg $target $r3 SET social: $rs$socname does not exist.");
      return;
      }
   $set = "\L$set";
   my $found=0;
   foreach(@sets) { if($set eq $_) { $found=1; } }
   if(!$found) {
      $server->command("msg $target $r3 social:$rs invalid field name.");
      return;
      }  
   my $filename = "$path/$socname.txt";
   my $cx=0;
   my ($fpriv, $fnobody, $fpublic, $fself, $fthem, $fyou);
   open(FILE,"<", $filename) or do {
      print "File $filename not found.";
      return;
      };
   while (<FILE>) {
      chomp;
      $fpriv = $_ if($cx == 0);
      $fnobody = $_ if($cx == 1);
      $fpublic = $_ if($cx == 2);
      $fself = $_ if($cx == 3);
      $fthem = $_ if($cx == 4);
      $fyou = $_ if($cx == 5);
      $cx++;
      }
   close FILE;
   $fpriv   = $data if($set eq "priv");
   $fnobody = $data if($set eq "nobody");
   $fpublic = $data if($set eq "public");
   $fself   = $data if($set eq "self");
   $fthem   = $data if($set eq "them");
   $fyou    = $data if($set eq "you");
   write_social($socname,$fpriv,$fself,$fnobody,$fpublic,$fyou,$fthem);
   $server->command("msg $target $r2 done.");   
   irssicmd_socials($socname);
   return;   
}

sub irssi_setsoc {
   my ($data, $server, $witem) = @_;
   my @data_arr = split / /, $data;
   if($#data_arr <=1) { 
      irssi_set_syntax();
      return;
      }
   my $cutstr = "/";
   my $socname = @data_arr[0];
   my $set = @data_arr[1];
   $cutstr = "$socname $set ";
   $data =~ s/$cutstr//g;
   my @sets = ("priv","nobody","public","self","them","you");
   if(!ifexist_social($socname)) {
      print "$r3 SET social: $rs$socname does not exist.";
      return;
      }
   $set = "\L$set";
   my $found=0;
   foreach(@sets) { if($set eq $_) { $found=1; } }
   if(!$found) {
      print "$r3 social:$rs invalid field name.";
      return;
      }  
   my $filename = "$path/$socname.txt";
   my $cx=0;
   my ($fpriv, $fnobody, $fpublic, $fself, $fthem, $fyou);
   open(FILE,"<", $filename) or do {
      print "File $filename not found.";
      return;
      };
   while (<FILE>) {
      chomp;
      $fpriv = $_ if($cx == 0);
      $fnobody = $_ if($cx == 1);
      $fpublic = $_ if($cx == 2);
      $fself = $_ if($cx == 3);
      $fthem = $_ if($cx == 4);
      $fyou = $_ if($cx == 5);
      $cx++;
      }
   close FILE;
   $fpriv   = $data if($set eq "priv");
   $fnobody = $data if($set eq "nobody");
   $fpublic = $data if($set eq "public");
   $fself   = $data if($set eq "self");
   $fthem   = $data if($set eq "them");
   $fyou    = $data if($set eq "you");
   write_social($socname,$fpriv,$fself,$fnobody,$fpublic,$fyou,$fthem);
   print "$r2 done.";
   irssicmd_socials($socname);
   return;   
}

sub syntax {
   my ($server,$target) = @_;
   $server->command("msg $target $r3(USAGE) $rs!social             $r3 :$r2 Prints this screen.");
   $server->command("msg $target         !social <social>   $r3  :$r2 Displays the social msgs");
   $server->command("msg $target         !social$b4 add $rs<social>$r3 :$r2 Adds a new Social.");
   $server->command("msg $target         !social$b4 del $rs<social>$r3 :$r2 Dels a Social.");
   $server->command("msg $target         !social$b4 set $rs<social>$r3 :$r2 Sets The social msg per line.");
   $server->command("msg $target         !social$b4 list    $r3     :$r2 A list of socials.");
   $server->command("msg $target         !social$b4 blist   $r3     :$r2 A list of socials in a box.");
   $server->command("msg $target         !social$b4 color   $r3     :$r2 A list of color codes.");
   $server->command("msg $target         !soclist           $r3  :$r2 Prints a list of socials.");
   $server->command("msg $target         !<social>          $r3  :$r2 does the Social.");
}

sub irssi_syntax {
   my ($server,$target) = @_;
   print "$r3(USAGE) $rs!social             $r3 :$r2 Prints this screen.";
   print "        !social <social>   $r3  :$r2 Displays the social msgs";
   print "        !social$b4 add $rs<social>$r3 :$r2 Adds a new Social.";
   print "        !social$b4 del $rs<social>$r3 :$r2 Dels a Social.";
   print "        !social$b4 set $rs<social>$r3 :$r2 Sets The social msg per line.";
   print "        !social$b4 list    $r3     :$r2 A list of socials.";
   print "        !social$b4 blist   $r3     :$r2 A list of socials in a box.";
   print "        !social$b4 color   $r3     :$r2 A list of color codes.";
   print "        !soclist           $r3  :$r2 Prints a list of socials.";
   print "        !<social>          $r3  :$r2 does the Social.";
}

sub colorlist {
   my ($server,$target) = @_;
   my $title = "$bc($bt Color List $bc)";
   my $spc = ' 'x50;
   my $text = "";
   my $tmp = "";
   my $cx=0;
   my $bar = "------------------------------------------------------------------";
   $bar = ".".substr($bar,0,int(($maxsize-13)/2)).$title.substr($bar,0,int(($maxsize-13)/2)).".";
   $server->command("msg $target $bc$bar$rs");

   my ($text,$blah);
   foreach (@colname)  {
   my $col = substr("@mirc_color_name[$cx] = @colname[$cx]$spc",0,20);
      $tmp = $text.$col;
      if(strsize($tmp) >= $maxsize) {
         $text.=' 'x50;
         $blah =~ s/\003//;
         $blah = @mirc_color_arr[$cx];
         $text = substr(" $text",0,$maxsize);
         $text = "$bc|$rs$text$bc|$rs";
         $server->command("msg $target $text");
         $text="";
         }
      $text=$text.$col;
      $cx++;
      }
   $bar = "-------------------------------------------------------------------------------------------";
   $bar = "`".substr($bar,0,$maxsize)."\'";
   $server->command("msg $target $bc$bar$rs");
   return;
}

sub irssi_colorlist {
   my ($server,$target) = @_;
   my $spc = ' 'x50;
   my $title = "$bc($bt Color List $bc)";
   my $bar = "------------------------------------------------------------------";
   $bar = ".".substr($bar,0,int(($maxsize-13)/2)).$title.substr($bar,0,int(($maxsize-13)/2)).".";
   print "$bc$bar$rs";
   my $cx=0;
   my ($text,$blah);
   foreach (@colname)  {
   my $col = substr("@mirc_color_name[$cx] = @colname[$cx]$spc",0,20);
      my $tmp = $text.$col;
      if(strsize($tmp) >= $maxsize) {
         $text.=' 'x50;
         $blah =~ s/\003//;
         $blah = @mirc_color_arr[$cx];
         $text = substr(" $text",0,$maxsize);
         $text = "$bc|$rs$text$bc|$rs";
         print $text;
         $text="";
         }
      $text=$text.$col;
      $cx++;
      }
   $bar = "-------------------------------------------------------------------------------------------";
   $bar = "`".substr($bar,0,$maxsize)."\'";
   print "$bc$bar$rs";
   return;
}

sub set_syntax {
   my ($server,$target) = @_;
   $server->command("msg $target $r3(USAGE) $rs!social$b4 set$rs <social>$b4 nobody $rs<msg>: Sets the message when no nickname is set.");
   $server->command("msg $target        !social$b4 set $rs<social>$b4 public $rs<msg> : Sets the message for the channel");
   $server->command("msg $target        !social$b4 set $rs<social>$b4 self   $rs<msg> : Sets the message when you social yourself.");
   $server->command("msg $target        !social$b4 set $rs<social>$b4 you    $rs<msg> : Sets message that will be messaged to you.");
   $server->command("msg $target        !social$b4 set $rs<social>$b4 them   $rs<msg> : Sets The social message that will be sent to them.");
   return;
}

sub irssi_set_syntax {
   my ($server,$target) = @_;
   print "$r3(USAGE)";
   print "!social$b4 set$rs <social>$b4 nobody $rs<msg>: Sets the message when no nickname is set.";
   print "!social$b4 set $rs<social>$b4 public $rs<msg>: Sets the message for the channel";
   print "!social$b4 set $rs<social>$b4 self   $rs<msg>: Sets the message when you social yourself.";
   print "!social$b4 set $rs<social>$b4 you    $rs<msg>: Sets message that will be messaged to you.";
   print "!social$b4 set $rs<social>$b4 them   $rs<msg>: Sets The social message that will be sent to them.";
   return;
}

sub soclist{
   my ($server,$target) = @_;
   my $text="";
   my $cutstr=".txt";
   my @array;
   opendir(DIR,$path) or return 0;
   while (defined(my $file = readdir(DIR))) {
      if($file =~ m".txt") { 
         my $tmp=$file;
         $tmp =~ s/$cutstr//;
         push(@array,$tmp); 
         }
      }
   closedir(DIR);
   @array = sort(@array);
   foreach(@array) { $text.=" $_"; }
   $server->command("msg $target $text");
   return;
}

sub socblist {
   my ($server,$target) = @_;
   my @array;
   my $text="";
   opendir(DIR,$path) or return 0;
   my $title = "$bc($bt Social List $bc)";
   my $bar = "------------------------------------------------------------------";
   $bar = ".".substr($bar,0,int(($maxsize-15)/2)).$title.substr($bar,0,int(($maxsize-15)/2)+1).".";
   $server->command("msg $target $bc$bar$rs");
   my $spc = "                                ";
   my $cutstr=".txt";
   opendir(DIR,$path) or return 0;
   while (defined(my $file = readdir(DIR))) {
      if($file =~ m".txt") { 
         my $tmp=$file;
         $tmp =~ s/$cutstr//;
         push(@array,$tmp); 
         }
      }
   closedir(DIR);
   @array = sort(@array);
   foreach(@array) {
     my $name;
     my $socname=$_;
     $socname =~ s/$cutstr//;
     if(!get_social_str($socname,"priv")) { 
        $name = substr(" $socname$spc",0,10); 
        }
     else { 
        $name = substr("*$socname$spc",0,10); 
        }
     my $tmp = $text.$name;
     if(strsize($tmp) >= $maxsize) {
         $text.="                                                                           ";
         $text = substr(" $text",0,($maxsize));
         $text = "$bc|$rs$text$bc|$rs";
         $server->command("msg $target $text");
         $text="";
         }
      $text=$text.$name;
      }
   $text.="                                                                           ";
   $text = substr(" $text",0,($maxsize));
   $text = "$bc|$rs$text$bc|$rs";
   $server->command("msg $target $text");
   $bar = "-------------------------------------------------------------------------------------------";
   $bar = "`".substr($bar,0,$maxsize)."\'";
   $server->command("msg $target $bc$bar$rs");
   return;
}

sub irssi_socblist {
   my ($data, $server, $witem) = @_;
   my @array;
   my $text="";
   opendir(DIR,$path) or return 0;
   my $title = "$bc($bt Social List $bc)";
   my $bar = "------------------------------------------------------------------";
   $bar = ".".substr($bar,0,int(($maxsize-15)/2)).$title.substr($bar,0,int(($maxsize-15)/2)+1).".";
   print "$bc$bar$rs";
   my $spc = "                                ";
   my $cutstr=".txt";
   opendir(DIR,$path) or return 0;
   while (defined(my $file = readdir(DIR))) {
      if($file =~ m".txt") { 
         my $tmp=$file;
         $tmp =~ s/$cutstr//;
         push(@array,$tmp); 
         }
      }
   closedir(DIR);
   @array = sort(@array);
   foreach(@array) {
     my $name;
     my $socname=$_;
     $socname =~ s/$cutstr//;
     if(!get_social_str($socname,"priv")) { 
        $name = substr(" $socname$spc",0,10); 
        }
     else { 
        $name = substr("*$socname$spc",0,10); 
        }
     my $tmp = $text.$name;
     if(strsize($tmp) >= $maxsize) {
         $text.="                                                                           ";
         $text = substr(" $text",0,($maxsize));
         $text = "$bc|$rs$text$bc|$rs";
         print "$text";
         $text="";
         }
      $text=$text.$name;
      }
   $text.="                                                                           ";
   $text = substr(" $text",0,($maxsize));
   $text = "$bc|$rs$text$bc|$rs";
   print "$text";
   $bar = "-------------------------------------------------------------------------------------------";
   $bar = "`".substr($bar,0,$maxsize)."\'";
   print "$bc$bar$rs";
   return;
}

sub do_social {
   my ($server,$target,$socname,$name1,$name2,$msgsw) = @_;
   my $text;
   if($name1 eq $name2) {
      $text = get_social_str($socname,"self");
      $text= social_parse($name1,$name2,$text);
      $server->command("msg $target $text");
      return;
      }
   if($name2 eq "UNSET") {
      $text = get_social_str($socname,"nobody");
      $text= social_parse($name1,$name2,$text);
      $server->command("msg $target $text");
      return;
      }
   if(get_social_str("priv")) {
      $text = get_social_str($socname,"public");
      $text= social_parse($name1,$name2,$text);
      $server->command("msg $target $text");
      if($msgsw) {
         $text = get_social_str($socname,"you");
         $text= social_parse($name1,$name2,$text);
         $server->command("msg $name1 $text");
         $text = get_social_str($socname,"them");
         $text= social_parse($name1,$name2,$text);
         $server->command("msg $name2 $text");
         }
      }
   else {
      $text = get_social_str($socname,"you");
      $text= social_parse($name1,$name2,$text);
      $server->command("msg $name1 $text");
      $text = get_social_str($socname,"them");
      $text= social_parse($name1,$name2,$text);
      $server->command("msg $name2 $text");
      }
   return;
}

sub print_social {
   my ($server,$target,$socname) = @_;
   my $text="";
   my $filename = "$path/$socname.txt";
   my $cx=0;
   my ($fpriv, $fnobody, $fpublic, $fself, $fthem, $fyou);
   open(FILE,"<", $filename) or do {
      $server->command("msg $target $socname does not exist.");   
      return;
      };
   while (<FILE>) {
      chomp;
      $fpriv = $_ if($cx == 0);
      $fnobody = $_ if($cx == 1);
      $fpublic = $_ if($cx == 2);
      $fself = $_ if($cx == 3);
      $fthem = $_ if($cx == 4);
      $fyou = $_ if($cx == 5);
      $cx++;
      }
   close FILE;
   $server->command("msg $target $r3    Name:$r2 $socname");
   $server->command("msg $target $r3 Private:$r2 $fpriv");
   $server->command("msg $target $r3  Nobody:$r2 ".colsocial($fnobody));
   $server->command("msg $target $r3  Public:$r2 ".colsocial($fpublic));
   $server->command("msg $target $r3    Self:$r2 ".colsocial($fself));
   $server->command("msg $target $r3    Them:$r2 ".colsocial($fthem));
   $server->command("msg $target $r3     You:$r2 ".colsocial($fyou));
   return;
}

sub irssi_print_social {
   my ($data, $server, $item) = @_;
   my @data_arr = split / /, $data;
   my $cutstr = "/";
   if (@data_arr[0] =~ m/^[(set)|(blist)|(add)|(list)|(del)|(color)]/i && !ifexist_social(@data_arr[0])) {
    Irssi::command_runsub ('social', $data, $server, $item);
    return;
    }
   my $socname = @data_arr[0];
   my $text="";
   my $filename = "$path/$socname.txt";
   my $cx=0;
   my ($fpriv, $fnobody, $fpublic, $fself, $fthem, $fyou);
   open(FILE,"<", $filename) or do {
      print "$socname does not exist."; 
      return;
      };
   while (<FILE>) {
      chomp;
      $fpriv = $_ if($cx == 0);
      $fnobody = $_ if($cx == 1);
      $fpublic = $_ if($cx == 2);
      $fself = $_ if($cx == 3);
      $fthem = $_ if($cx == 4);
      $fyou = $_ if($cx == 5);
      $cx++;
      }
   close FILE;
   print"$r3    Name:$r2 $socname";
   print"$r3 Private:$r2 $fpriv";
   print"$r3  Nobody:$r2 ".colsocial($fnobody);
   print"$r3  Public:$r2 ".colsocial($fpublic);
   print"$r3    Self:$r2 ".colsocial($fself);
   print"$r3    Them:$r2 ".colsocial($fthem);
   print"$r3     You:$r2 ".colsocial($fyou);
   return;
}

sub colsocial {
    my ($str) = @_;
    my $name1 = "$r2 name1$rs";
    my $name2 = "$r2 name2$rs";
    return $str;
}

sub color_parse {
    my ($str) = @_;
    my $cx=0;
    foreach(@mirc_color_name) { 
       my $old = @mirc_color_name[$cx];
       my $new = @mirc_color_arr[$cx];
       $str =~ s/$old/$new/g;
       $cx++;
       }
    return $str;
}

sub social_parse {
   my ($name1,$name2,$str) = @_;
   $name1 = "$r2$name1$rs";
   $name2 = "$r2$name2$rs";
   $str =~ s/name1/$name1/g;
   $str =~ s/name2/$name2/g;
   return $str;
}

sub get_social_str {
   my ($social,$colum) = @_;
   my $filename = "$path/$social.txt";
   my $cx=0;
   my ($fpriv, $fnobody, $fpublic, $fself, $fthem, $fyou);
   open(FILE,"<", $filename);
   while (<FILE>) {
      chomp;
      $fpriv = color_parse($_) if($cx == 0);
      $fnobody = color_parse($_) if($cx == 1);
      $fpublic = color_parse($_) if($cx == 2);
      $fself = color_parse($_) if($cx == 3);
      $fthem = color_parse($_) if($cx == 4);
      $fyou = color_parse($_) if($cx == 5);
      $cx++;
   }
   close FILE;
   return $fpriv if($colum eq "priv");
   return $fself if($colum eq "self");
   return $fnobody if($colum eq "nobody");
   return $fpublic if($colum eq "public");
   return $fyou if($colum eq "you");
   return $fthem if($colum eq "them");
   return "UNSET";
}

sub ifexist_social {
   my ($socname) = @_;
   my $cutstr= ".txt";
   my $filename = "$path/$socname.txt";
   opendir(DIR,$path) or return 0;
   while (defined(my $file = readdir(DIR))) {
      if($file =~ m".txt") { 
         my $tmp=$file;
         $tmp =~ s/$cutstr//;
         return 1 if($socname eq $tmp);
         }
      }
   return 0;
}

sub strsize {
   my ($word) = @_;
   my @word_arr = split //, $word;
   return $#word_arr+1;
}

sub write_social {
   my ($socname,$fpriv,$fself,$fnobody,$fpublic,$fyou,$fthem) = @_;
   my $filename = "$path/$socname.txt";
   open(FILE,">", $filename);
   print FILE "$fpriv\n";
   print FILE "$fnobody\n";
   print FILE "$fpublic\n";
   print FILE "$fself\n";
   print FILE "$fthem\n";
   print FILE "$fyou\n";
   close FILE;
   return;
}

sub irssicmd_reset {
   for my $cmd (Irssi::commands()) {
      if($cmd->{category} eq "Social Commands") {
         my $tmp=$cmd->{cmd};
         Irssi::command_unbind($tmp,'on_cmd');
      }
   }
}

sub irssicmd_socials {
   my ($socname) = @_;
   irssicmd_reset();
   my $cutstr= ".txt";
   my $filename = "$path/$socname.txt";
   opendir(DIR,$path) or return 0;
   while (defined(my $file = readdir(DIR))) {
      if($file =~ m".txt") { 
         my $tmp=$file;
         $tmp =~ s/$cutstr//;
         Irssi::command_bind($tmp,'on_cmd','Social Commands');
         }
      }
}

sub on_cmd {
   my ($data, $server, $witem) = @_;
   my @data_arr = split / /, $lastcmd;
   my $cutstr = "/";
   my $socname = @data_arr[0];
   $socname =~ s/$cutstr//;
   my $target=Irssi::active_win()->{active}->{name};
   $home_chan=$target;
   my $nick = "TechWizard";
   my ($msgsw, $nick2);
   if($#data_arr == 0) {
      $nick2 = "UNSET";
      $msgsw=0;
      }
   if($#data_arr == 1) {
      $nick2 = @data_arr[1];
      $msgsw=0;
      }
   if($#data_arr == 2) {
      $nick2 = @data_arr[1];
      $msgsw=1;
      }  
   if($home_chan =~ /^#/) {
      my $chan = Irssi::Irc::Server->channel_find($home_chan);
      my $nick_obj = $chan->nick_find($nick2);
      if($nick_obj->{nick} eq "" && $nick2 ne "UNSET") { 
         $server->command("msg $target nickname does not exist.");
         return;
         }
      }
   do_social($server,$target,$socname,$nick,$nick2,$msgsw);
}

sub cmd_sig {
   my($args) = @_;
   irssicmd_socials();
   $lastcmd=$args;
}

sub check_dir {
    my $sw=1;
    opendir(DIR,$path) or $sw=0;
    closedir(DIR);
    return $sw;
}

sub init_socpath {
   if(check_dir()) { return; }
   my @socnam_arr = ("beer","bslap","chains","cut","drp","fart","french","halo",
                  "hug","hump","kiss","smacks","smooch","spank","stab","staple",
                  "strip","trout","whips","yawn"
   );
   my @socline_arr = (
               "0\nWho wants Beer!?!?!?\nname1 throws name2 a fresh cold beer out of the fridge.\nname1 opens up a nice cold beer, and drinks it.\nname1 tosses you a nice cold beer, better catch it!!\nyou just tossed name2 a nice cold beer.\n",
               "0\nLook OUT!!!! name1 is ready to Bitch slap someone!!!!\nname1 Bitch slaps name2 Violently, OUWWW that gotta hurt!\nname1 Bitch Slaps themself hard, Are they Crazy or what???\nyou gotten Bitch Slapped by name1, can you call 911?.\nyou violently bitch slap name2.\n",
               "0\nname1 looks around swinging the chains around, who shall be my victim?\nname1 chains name2 up, Ohh... Boy, name2 is gonna get it...\nname1 chain themself up, and swallowed the keys.\nname1 chained you up, aren't you wondering what they will do next?\nyou just chained up name2, whats next? torchure?\n",
               "0\nname1 wants to cut something......\nname1 cut name2 arms and legs off with blood on your face\nname1 cut something on them off\nyou cut everything off of their body\nyou cut name2 arms and legs off and blood flies everywhere\n",
               "0\nname1 goes out and buys a box of ~R1Dr.Pepper~RS.\nname1 tosses a ~R1Dr.Pepper~RS can to name2, If you waste it, You're Dead.\nname1 grabs a ~R1Dr.Pepper~RS, pops it open and gulps it down... aaahhhh.....\nname1 tosses you a can of ~R1Dr.Pepper~RS.\nyou gave name2 a can of ~R1Dr.Pepper~RS.\n",
               "0\nname1 farts, Roam roam!!!! Can ya hear it?\nname1 farts towards name2!! QUICK Wear a Gas Mask!!!!\nname1 farts up a storm and kills themself.\nname1 farts towards you, EWWWWW!!! can ya smell it????\nyou farted towards name2! you B*stard!\n",
               "0\nname1 need to be french\nname1 french name2 until name2 cant breathe\nname1 want to be french\nname1 french them until name1 cant breathe\nyou french name2 with all you got\n",
               "0\nname1 looks around seeing whoes innocent.\nname1 does their best best to look innocent.\nname1 looks and the mirror and finds a gold circle.\nblah\n",
               "0\nname1 needs a hug.\nname1 hugs name2 tightly.\nname1 hugs themself tightly.\nname1 hugs you tightly.\nyou hugs name2 tightly.\n",
               "0\nname1 wants to be hump........\nname1 hump name2 until name1 drop\nname1 hump themself\nname1 hump them hard and passionately\nyou hump name2 with all you got\n",
               "0\nname1 needs a kiss.\nname1 kisses name2 passionately.\nname1 kisses themself passionately.\nname1 kisses them passionately.\nyou kisses name2 passionately.\n",
               "0\nname1 smacks his monkey slowly.\nname1 smacks name2 for being an idiot, What were they thinking???\nname1 smacks and smacks until his face burns red.\nname1 smacks you for being an idiot.\nyou smacked name2, that damn idiot, what were they thinking???\n",
               "0\nname1 smooches everyone in the channel.\nname1 smooches name2. AWW aint that cute.. NOT!!!\nname1 tries to smooch themself, but can't. Anyone got a mirror????\nname1 smooches you very passionately.\nyou have smooched name2 on the lips.\n",
               "0\nname1 looks for a paddle to spank someone's ass with.\nname1 spanks name2 ass for being naughty.....\nname1 is trying to spank their own ass, does somebody have a paddle?\nyou felt something on your ass, you turned around a look, did name1 spank you?\nhow did feel spanking name2's ass.\n",
               "0\nLook OUT!!!! name1 is ready to Stab someone with a knife!!!!\nname1 Stabs name2 Violently, I  hope they got life insurance\nname1 tries to Stab themself with a knife, 911, SUICIDE!!!\nname1 slaps ya with their dirty trout, are you going to let them get away with that???\nyou slapped name2 with your trout, I hope ya cleaned it first.\n",
               "0\nname1 grabs a staple gun and reloads the gun.\nname1 staples name2 to the wall, now they can't run, MUahahaha....\nname1 tries to staple themself to the wall, OUWWWW!!\nyou got stapled to the wall by name1.\nyou have stapled name2 to the wall.\n",
               "0\nname1 is waiting for someone to strip down, any volunteers?\nname1 strips name2 down one clothes after another.\nname1 watches themself in a mirror while stripping down.\nname1 is removing ya clothes.\nyou are removing name2's clothes, you better hope that camera is ready.\n",
               "0\nname1 is juggling the trout while looking for their victim.\nname1 slaps name2 with their dirty trout, *SPLAT*!!!\nname1 slaps himself with a dead trout, EWWWWWWW\nname1 slaps you with a dead trout, EWWWWWWW!!!\nyou slapped name2 with a dead trout, EWWWWWWW!!!\n",
               "0\nname1 is looking for a whip to torture someone.......RUN............\nname1 whips name2 until name1 sees blood.....\nname1 whips themself without mercy\nname1 whips them violently\nyou whips name2 with everything you have\n",
               "0\nname1 yawns and stretches.\nname1 yawns at name2, mann.. You're boring.\nname1 yawns and stretches and then falls over, WHOOPS!!\nname1 yawns at you, they are very bored.\nyou yawned at name2, how rude....\n",
   );
   my $cx=0;
   print "Mkdir $path.";
   mkdir($path);
   print "Inserting socials into $path.";
   foreach my $socname (@socnam_arr) {
      my $filename = "$path/$socname.txt";
      open(FILE,">", $filename);
      print FILE @socline_arr[$cx];
      close FILE;
      $cx++;
   }
}

Irssi::command_bind('social','irssi_print_social','tech_addon');
Irssi::command_bind('social set','irssi_setsoc','tech_addon');
Irssi::command_bind('social color','irssi_colorlist','tech_addon');
Irssi::command_bind('social reset','irssicmd_reset','tech_addon');
Irssi::command_bind('social add','irssi_addsoc','tech_addon');
Irssi::command_bind('social del','irssi_delsoc','tech_addon');
Irssi::command_bind('social list','irssi_socblist','tech_addon');
Irssi::command_bind('soclist','irssi_socblist','tech_addon');
Irssi::command_bind('soccolor','irssi_socblist','tech_addon');

Irssi::signal_add_first('send command', 'cmd_sig');
Irssi::signal_add_last('message public', 'message_public');
Irssi::signal_add_last('message private', 'message_private');
Irssi::signal_add_last("message own_public", "on_public");
Irssi::signal_add_last("message own_private", "on_private");
Irssi::settings_add_bool('tech_addon', 'twsocials_instruct', 1);
Irssi::settings_add_bool('tech_addon', 'twsocials_remote', 0);
irssicmd_socials();

if(Irssi::settings_get_bool('twsocials_instruct')) {
   print $instrut;
   }