-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsbClient.mrc
More file actions
1259 lines (1220 loc) · 49.8 KB
/
sbClient.mrc
File metadata and controls
1259 lines (1220 loc) · 49.8 KB
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
;
; 2.23.1
; mostly style changes, usage of $qt()
; added sbClientdll alias & used it for all dll calls.
; changed :dialog:sbClient_options:sclick:61: to no longer need $numtok() call.
; fixed? several errors in :dialog:sbClient_search:sclick:1: unsure if logic used matches what was intended.
; rewrote sbClient.Online to be shorter, no longer returns 0 or 1, but 0 or > 0, other code changed to reflect this.
; rewrote sbclient.GetFileName to correctly return the filename upto first ext.
; changed :load: to check for connected status before trying to ctcp.
; changed :filercvd:*SearchBot*results*for*: to use $remove instead of $replace
; changed sbclient.FindHeaders loop to abit leaner ;)
; changed sbclient.FindResults to use a simpler method of getting the line.
; changed sbClient.error to use /noop
; changed sbClient.ColorNicks
; changed sbClient.LS.Loadresults
; 2.23.2
; changed sbClient.ColorNicks to take another arg $2 that is either 1 or 0 (or $null) & tells the alias that the line must start with a ! before being coloured.
; 2.23.3
; fixed :dialog:sbClient_search:sclick:1: I got the logic wrong in the previous fix.
; 2.23.4
; changed sbClient.SearchDone to show text in titlebar instead of using $input
; 2.23.5
; changed sbclient.GetFileName to use a regex
; added fixes for some tabs issues
; 2.23.6
; removed tabs fixes.
; 2.23.7
; changed sbClient.LS.Loadresults to correctly filter tabs
; changed sbClient.LS.Loadresults to take 2 args a window name & a filename
; changed load old results code to use new sbClient.LS.Loadresults
; 2.23.8
; rewrote Copy line(s) to clipboard: menu item for @sbClient.* windows
; fixed issue with lines that used to contain $chr(9) not being copied to clipboard.
; 2.23.9
; added KEYDOWN:@sbClient.*:*: event press ctrl-z in a list window to copy the whole line or ctrl-c to copy the filename part.
; added a key check to the copy to clipboard menutitem, now is ctrl is pressed when the item is selected the whole line is copied instead of just the filename.
; 2.23.10
; fixed sbclient.GetFileName not returning unknown ext's
; 2.23.11
; added a workaround to KEYDOWN event for bugs in pre 7.11 mIRC.
; 2.23.12
; added sbClient.LoadOldResults alias & changed menu items to use it.
; reworked the logic of :dialog:sbClient_search:sclick:1: again, should be finally fixed now.
; 2.23.13
; changed search done code to stop shifting focus to dialog.
; changed search done code to open results window minimized if the search dialog has lost focus
; fixed multi-line copy to clipboard issue.
; 2.23.14
; changed qt alias to give the same output as the built in qt alias in all conditions.
; changed sbclient.GetFileName to match any ext without needing a known list.
; 2.23.15
; changed sbclient.GetFileName to match the whole filesname upto the last ext.
; 2.23.16
; removed some commented code.
; 2.23.17
; added sbClient.remove alias
; added sbClient.rename alias
; added sbClient.loadbuf alias
; 2.23.18
; added update for titlebar after 'Remove Offline Nicks' menu item is used.
; 2.23.19
; added image file types to file types filter.
; 2.23.20
; added a workaround for a search dll bug that causes searches like: "miss mary is scary" to fail when they shouldn't. This only affects local searches.
; 2.23.21
; fixed clipboard multiline-copy missing a crlf
; 2.23.22
; Improved bugfix applied in 2.23.20
; 2.23.23
; Removed workaround for v1.8.3 dll bugs, using new v2+ dll instead.
; Updated sbClient.dll to v2.0.2
; 2.23.24
; fixed clipboard multiline-copy missing a crlf
; 2.23.25
; Updated sbClient.dll to v2.0.4.18
; 2.23.26
; Updated sbClient.dll to v2.0.4.19
; 2.23.27
; added sbClient.mkdir alias to provide error protected mkdir
; fixed bugs in file recieved event due to file name changes in latest searchbots
; changed `remove offline nicks` filter in search results window to also remove all non-nick lines
; 2.23.28
; added $comchar support & compatibility code
; 2.23.29
; changed file recieved code to handle Seek... & Search... filenames
; added 'Sort Results' menu item.
; 2.23.30
; changed dialogs to use option map, should improve the look on high dpi screens.
; 2.24
; added sbClient.Display alias to make changing how messages are displayed easier.
; replaced some /halt calls with /returns
; added more key shortcuts for @sbClient.* windows. r = request file, ctrl-r = request file & delete from window, ctrl-z = search within window
; added Internal, AutoGet, vPowerGet default request methods to options.
; added an internal autoget method, allowing you to queue up & d/l files (this is a minimal autoget & doesnt have all the features of AutoGet etc..)
; 2.25
; fixed error messages sometimes freezing when called within events.
; 2.25.1
; added the ability to request files by the hash value if supplied (only with internal request queue)
; 2.25.2
; added support for another hash style (sigh)
; 2.25.3
; fixed queue title not updating
; made sbClient.SendToInternal alias global to allow its use by other scripts.
; 2.25.4
; fixed sbClient.requestfile not parsing nick correctly.
; 2.25.5
; added another hash type to sbclient.GetFileHash
; changed sbclient.GetFilename to return the part after the trigger if no file ext found.
; changed filercvd event to handle servers that send a file named differently to what they have listed.
; 2.25.6
; fixed bug in ctrl-c code which missed the trigger.
; 2.26
; added basic compatibility with WhereIs bot
; added advanced options to dialog (atm this only allows setting the regex pattern)
; 2.26.1
; changes made to WhereIs bot accounted for.
; 2.26.2
; added sbClient.GetAllNetChannels & sbClient.GetAllChannels, & replaced existing loops with calls to this.
; changed some /scon calls to use -t1 to only send the message if connected.
; reworked the logic when starting a local search when one is already underway.
; rewrote the update check code to work with github
;
alias sbClient.version return 2.26.2
; Ook: added shortcut for dll
alias sbClientdll return $dll($scriptdirsbClient.dll,$1,$2-)
; $1- = text to display
alias -l sbClient.Display echo -s 1,9<<sbClient>> $1-
dialog sbClient_options {
title sbClient v $+ $sbClient.version
size -1 -1 240 202
option map notheme
tab "General", 1, 1 3 236 173
tab "SearchBot", 6
tab "Advanced", 7
button "Close", 11, 20 183 70 12, ok
button "Search dialog", 16, 148 183 70 12
box "Channels", 21, 2 22 230 140, tab 6
check "Store search result .txt files", 26, 5 164 200 8, tab 6
list 31, 6 40 174 45, tab 6 vsbar size
button "Add", 36, 183 40 45 45, tab 6
text "Current channels:", 41, 6 30 100 8, tab 6
text "SearchBot channels:", 46, 6 87 100 8, tab 6
list 51, 6 96 174 45, tab 6 vsbar size
button "Remove", 56, 183 96 45 45, tab 6
button "Request search triggers", 61, 6 146 182 13, tab 6 flat
check "No max results limit for local searches (not recommended)", 66, 10 24 200 8, tab 1
check "Check for a new sbClient version on mIRC start", 71, 10 35 167 8, tab 1
button "Check now", 76, 177 35 54 10, tab 1 flat multi
check "Enable Version response", 110, 10 55 100 11, tab 1
box "Default Request Method", 99, 8 71 180 25, tab 1
radio "Internal", 100, 13 81 50 11, tab 1 group
radio "Autoget", 101, 64 81 50 11, tab 1
radio "vPowerGet.NET", 102, 114 81 70 11, tab 1
box "sbClient", 81, 8 100 182 40, tab 1
text "Here will be some kind of intro text as soon as I figure out what it will be", 86, 15 110 120 40, tab 1 multi
link %sbClient.WebSite, 91, 68 150 150 8, tab 1
check "Group @find results", 96, 10 46 81 8, tab 1
check "Enable Advanced Options", 700, 10 24 100 12, tab 7
text "Search Results Regex", 701, 10 36 100 12, tab 7 disable
edit %sbClient.ResultsFileRegex, 702, 10 48 200 12, tab 7 autohs disable
text "Search Terms Regex", 703, 10 60 100 12, tab 7 disable
edit %sbClient.ResultsTermsRegex, 704, 10 72 200 12, tab 7 autohs disable
}
on *:dialog:sbClient_options:init:0: {
sbClient.CheckVars
if (%sbClient.storetxt == 1) did -c sbClient_options 26
if (%sbClient.groupfind == 1) did -c sbClient_options 96
didtok sbClient_options 31 44 $sbClient.GetAllChannels
didtok sbClient_options 51 44 %sbClient.channels
if (%sbClient.nomax == 1) did -c sbClient_options 66
if (%sbClient.checkver == 1) did -c sbClient_options 71
if (%sbClient.defreqmethod isnum 100-102) did -c sbClient_options $v1
else did -c sbClient_options 100
if (%sbClient.versionresponse) did -c $dname 110
; version check only works on v7.56+
if ($version < 7.56) did -b $dname 71,76
}
on *:dialog:sbClient_options:sclick:700: {
did $iif($did(700).state,-e,-b) sbClient_options 701-704
}
on *:dialog:sbClient_options:sclick:36: {
if (!$did(31).seltext) return
if ($istok(%sbClient.channels,$did(31).seltext,44)) return
set %sbClient.channels $addtok(%sbClient.channels,$did(31).seltext,44)
did -r sbClient_options 51
didtok sbClient_options 51 44 %sbClient.channels
sbClient.GetTrigger $did(31).seltext
}
on *:dialog:sbClient_options:sclick:56: {
if (!$did(51).seltext) return
set %sbClient.channels $remtok(%sbClient.channels,$did(51).seltext,44)
did -r sbClient_options 51
didtok sbClient_options 51 44 %sbClient.channels
}
on *:dialog:sbClient_options:sclick:91: url -an %sbClient.WebSite
on *:dialog:sbClient_options:sclick:76: sbClient.update
on *:dialog:sbClient_options:sclick:96: set %sbClient.groupfind $did(96).state
on *:dialog:sbClient_options:sclick:110: set %sbClient.versionresponse $did(110).state
on *:dialog:sbClient_options:close:*: {
set %sbClient.storetxt $did(26).state
set %sbClient.nomax $did(66).state
set %sbClient.checkver $did(71).state
set %sbClient.groupfind $did(96).state
set %sbClient.versionresponse $did(110).state
if ($did(101).state) set %sbClient.defreqmethod 101
elseif ($did(102).state) set %sbClient.defreqmethod 102
else set %sbClient.defreqmethod 100
if ($did(700).state) {
; only save if advanced options enabled.
set %sbClient.ResultsFileRegex $did(702).text
set %sbClient.ResultsTermsRegex $did(704).text
}
sbClient.CheckVars
}
on *:dialog:sbClient_options:sclick:61: {
var %cnter = 1
while ($gettok(%sbClient.channels,%cnter,44) != $null) {
sbClient.GetTrigger $v1
inc %cnter
}
}
on *:dialog:sbClient_options:sclick:16: {
set %sbClient.storetxt $did(26).state
set %sbClient.nomax $did(66).state
set %sbClient.checkver $did(71).state
dialog -x sbClient_options sbClient_options
dialog -am sbClient_search sbClient_search
}
on *:dialog:sbClient_options:sclick:100,101,102: set %sbClient.defreqmethod $did
alias sbClient.GetTrigger {
scon $sbClient.GetNetworkID($1)
sbClient.Display Requesting SearchBot trigger from $sbClient.GetChannel($1) (network $gettok($1,2,64) $+ ).
msg $sbClient.GetChannel($1) @SearchBot-trigger
set $+(%,sbClient.,$1,.requested) 1
}
alias sbClient.GetChannel return $gettok($1,1,64)
alias sbClient.GetNetworkID {
var %net = $gettok($1,2,64), %cnter = 1
while (%cnter <= $scon(0)) {
if ($scon(%cnter).$network == %net) return %cnter
inc %cnter
}
}
alias sbClient.GetAllNetChannels {
var %i = 1, %c = $1
while ($chan(%i) != $null) {
var %c = $addtok(%c,$+($v1,@,$network),44)
inc %i
}
return %c
}
alias sbClient.GetAllChannels {
var %c
scon -a var % $+ c = $!sbClient.GetAllNetChannels(%c)
return %c
}
ctcp *:TRIGGER:?: {
if ($($+(%,sbClient.,$3,@,$2,.requested),2) == 1) {
set $+(%,sbClient.,$3,@,$2,.trigger) $4
unset $+(%,sbClient.,$3,@,$2,.requested)
sbClient.Display Received SearchBot trigger from $3 (network $2 $+ ): $4
}
}
ctcp *:VERSION:?: {
if (!%sbClient.versionresponse) return
if ($network != DejaToons) .ctcpreply $nick VERSION 1,9<<sbClient>> version $sbClient.version by DukeLupus.1,15 Get it from 12,15 $+ %sbClient.WebSite (Modified by Ook)
}
dialog sbClient_search {
title "sbClient search dialog"
size -1 -1 240 110
option map notheme
edit "", 5, 6 6 230 12
button "Search!", 1, 5 21 230 10, flat default
check "Local search in folder:", 10, 12 35 200 8
text "Not selected", 6, 60 47 170 8
button "Select folder", 15, 12 47 45 9, flat
check "Online SearchBot search in channel:", 11, 12 61 130 8
combo 20, 142 61 95 35, drop
check "Use separate windows for each search", 16, 12 73 140 8
check "@find search in channel:", 25, 12 86 97 8
combo 21, 112 86 101 35, drop
}
on *:dialog:sbClient_search:init:0: {
if (%sbClient.ListFolder) did -o sbClient_search 6 1 %sbClient.ListFolder
didtok sbClient_search 20 44 %sbClient.channels
did -c sbClient_search 20 %sbClient.last1
if (%sbClient.Separate) did -c sbClient_search 16
did -f sbClient_search 5
if (%sbClient.menu.local) did -c sbClient_search 10
if (%sbClient.menu.channel) did -c sbClient_search 11
if (%sbClient.find.channel) did -c sbClient_search 25
didtok sbClient_search 21 44 $sbClient.GetAllChannels
did -c sbClient_search 21 %sbClient.last2
}
on *:dialog:sbClient_search:close:0: {
set %sbClient.last1 $did(20).sel
set %sbClient.last2 $did(21).sel
}
on *:dialog:sbClient_search:sclick:15: {
; if not set alrdy then set to default.
if (%sbClient.ListFolder == $null) set %sbClient.ListFolder $mircdirLists
; use previous folder as start location.
set %sbClient.ListFolder $sdir(%sbClient.ListFolder, Select list folder)
if (%sbClient.ListFolder == $null) did -o sbClient_search 6 1 Not selected
else did -o sbClient_search 6 1 %sbClient.ListFolder
}
on *:dialog:sbClient_search:sclick:16: set %sbClient.Separate $did(16).state
on *:dialog:sbClient_search:sclick:10: set %sbClient.menu.local $did(10).state
on *:dialog:sbClient_search:sclick:11: set %sbClient.menu.channel $did(11).state
on *:dialog:sbClient_search:sclick:25: set %sbClient.find.channel $did(25).state
on *:dialog:sbClient_search:sclick:1: {
if ((!$did(10).state) && (!$did(25).state) && (!$did(11).state)) { sbClient.error You really should choose at least one search method. | return }
if ($did(5).text == $null) { sbClient.error No search string! | return }
var %sstring = $sbClient.FixString($did(5).text)
if (%sstring == $null) { sbClient.error I don't like your search string! | return }
if ($did(10).state) {
; do local search
if (%sbClient.searching == 1) {
if ($input(Local search seems to be already active. Do you want to stop active local search and start your current search?,yqd,Local search is active) != $true) return
sbClientdll Stop 1
set %sbClient.searching 0
if ($did(11).state) goto chansearch
}
if (!%sbClient.ListFolder) {
sbClient.error No list folder!
if ($did(11).state) goto chansearch
return
}
if ($findfile(%sbClient.ListFolder,*.txt,0,1) == 0) {
sbClient.error There are no lists in the selected folder!
if ($did(11).state) goto chansearch
return
}
sbClient.DoLocalSearch %sstring
}
:chansearch
if ($did(25).state) {
.set -u600 %sbclient.searchactive 1
.set -u600 %DLF.searchactive 1
scon -t1 $sbClient.GetNetworkID($did(21).seltext) msg $sbClient.GetChannel($did(21).seltext) @find %sstring
}
if ($did(11).state) {
if (!$did(20).seltext) { sbClient.error No channel selected! | return }
var %schan = $did(20).seltext
if ($sbClient.Check(%schan,%sstring) == 0) return
set %sbClient.SearchChannel %schan
sbClient.DoSearch %schan %sstring
}
did -r sbClient_search 5
dialog -t sbClient_search Now searching for $+(",%sstring,".)
}
alias sbClient.error timer 1 0 noop $input($1-,ohd,sbClient error)
alias sbClient.FixString return $replace($1-,$chr(34),$null,$chr(39), $chr(32),$chr(42),$chr(32),$chr(63),$chr(32),$chr(32) $+ $chr(32),$chr(32))
alias sbClient.DoLocalSearch {
set %sbClient.string $1-
var %folder = $+(%sbClient.ListFolder,*.txt)
if (%sbClient.nomax == 1) var %maxresults = 10000000
else var %maxresults = 3000
set %sbClient.searching 1
if ($sbClient.remove($mircdirsbClient.ls.results.txt)) {
sbClientdll SetOutputName $mircdirsbClient.ls.results.txt
sbClientdll SetListFolder %folder
sbClientdll SetSearchString %sbClient.string
sbClientdll SetMaxReplies %maxresults
sbClientdll SetReturnAlias sbClient.SearchDone
sbClientdll Search 1
}
else sbClient.error Unable to remove $qt($mircdirsbClient.ls.results.txt)
}
alias sbClient.SearchDone {
set %sbClient.searching 0
if ($1 == 0) {
if ($dialog(sbClient_search) != $null) dialog -t sbClient_search No results for $qt(%sbClient.string)
else dialog -am sbClient_search sbClient_search
return
}
if (%sbClient.Separate) var %window = $+(@sbClient.local.,$gettok(%sbClient.string,1,32))
else var %window = @sbClient.local
if (!$window(%window)) {
if ($dialog(sbClient_search).active) window -ek0lmwz %window Arial 12
else window -ek0lmwzn %window Arial 12
}
else clear %window
titlebar %window -|- sbClient local search results for $qt(%sbClient.string) -|- $findfile(%sbClient.ListFolder,*.txt,0,1) lists searched -|- $1 results -|- rclick for options - r = request file - ctrl-r = req & delete - ctrl-z = find -|-
sbClient.LS.Loadresults %window $2-
if ($dialog(sbClient_search) != $null) dialog -t sbClient_search Search for $qt(%sbClient.string) Complete.
}
; Ook: changed to handle $chr(9) (tab) issues in some mIRC's
;alias sbClient.LS.Loadresults {
; ; Ook: %file not used?
; ;var %file = $qt($1-)
; loadbuf -r %sbClient.window $qt($mircdirsbClient.ls.results.txt)
; sbClient.ColorNicks %sbClient.window
; .remove $qt($mircdirsbClient.ls.results.txt)
;}
; $1 = @window, $2- = filename
alias sbClient.LS.Loadresults {
set %sbClient.window $1
var %file = $qt($2-)
if (!$isfile(%file)) return
clear %sbClient.window
filter -fk %file sbClient.window.filter !*
sbClient.ColorNicks %sbClient.window
if (sbClient.ls.results.txt == $nopath(%file)) {
if (!$sbClient.remove(%file)) sbClient.error Unable to remove %file
}
; this line sorts results by nick
;window -bs %sbClient.window
}
alias -l sbClient.window.filter {
; if using !* filter then its never going to be $null even after removing $chr(9)
aline %sbClient.window $replace($1-,$chr(9),$chr(32))
}
; $1 = @win, ($2 = only !lines, 0 or 1)
alias sbClient.ColorNicks {
var %cnter = 1, %tot = $line($1,0)
while (%cnter <= %tot) {
if ($line($1,%cnter) != $null) {
set -ln %l $v1
if ((!$2) || ($left(%l,1) == !)) {
if ($sbClient.Online(%l)) cline 3 $1 %cnter
else cline 4 $1 %cnter
}
}
inc %cnter
}
}
alias sbClient.Online {
tokenize 32 $1
var %nick = $remove($1,-new)
if ($left(%nick,1) == !) %nick = $right(%nick,-1)
if (%nick == $null) return 0
var %c = 0
scon -at1 inc % $+ c $!comchan( %nick ,0)
return %c
}
on *:input:@sbClient.local*,@sbClient.OldResults: {
; needs to be /halt
if ($left($1-,1) == $comchar) halt
if (%sbClient.searching == 1) {
if ($input(Local search seems to be already active. Do you want to stop active search and start your current search?,yqd,Local search is active) == $true) { sbClient.Cleanup }
else halt
}
var %sstring = $sbClient.FixString($1-)
; Ook: should be == $null to allow search for 0 ?
if (!%sstring) {
sbClient.error I don't like your search string!
halt
}
sbClient.DoLocalSearch %sstring
}
; $1 = window
alias -l sbClient.SendToAutoGet {
if (!$window($1)) return
var %lines = $sline($1,0)
if (!%lines) return
var %path = $nofile($script(AutoGet.mrc))
.fopen MTlisttowaiting $+(",%path,AGwaiting.ini")
if ($fopen(MTlisttowaiting).err) return
.fseek -l MTlisttowaiting $lines($+(",%path,AGwaiting.ini"))
if ($fopen(MTlisttowaiting).err) return
var %i = 1, %j = 0
while (%i <= %lines) {
var %temp = $MTlisttowaiting($sline($1,%i))
inc %j $gettok(%temp,1,32)
if ($sbClient.Online($sline($1,%i))) cline 10 $1 $sline($1,%i).ln
else cline 6 $1 $sline($1,%i).ln
inc %i
}
.fclose MTlisttowaiting
if (%MTautorequest == 1) MTkickstart $gettok(%temp,2,32)
MTwhosinque
if ($dialog(Autoget)) updatewaitinglist
if (%MTecho) echo -s %MTlogo Added %j File(s) To Waiting List From sbClient
}
; $1 = window
alias -l sbClient.SendTovPowerGet {
if (!$window($1)) return
var %lines = $sline($1,0)
if (!%lines) return
var %cnter = 1
while (%cnter <= %lines) {
if ($com(vPG.NET,AddFiles,1,bstr,$sline($1,%cnter)) == 0) echo -s vPG.NET: AddFiles failed
if ($sbClient.Online($sline($1,%cnter))) cline 10 $1 $sline($1,%cnter).ln
else cline 6 $1 $sline($1,%cnter).ln
inc %cnter
}
}
; $1 = window
alias sbClient.SendToInternal {
if (!$window($1)) return
if (!$sline($1,0)) return
var %cnter = 1
while ($sline($1,%cnter) != $null) {
var %l = $v1, %ln = $sline($1,%cnter).ln
if ($sbClient.Online(%l)) cline 10 $1 %ln
else cline 6 $1 %ln
sbClient.queuerequest $1 %ln
inc %cnter
}
if (@sbClient* iswm $1) titlebar $1 -|- $line($1,0) lines -|- rclick for options - r = request file - ctrl-r = req & delete - ctrl-z = find -|- $sline($1,0) line(s) sent to queue -|-
}
; $1 = window
alias -l sbClient.SendToDefault {
if (%sbClient.defreqmethod == 101) sbClient.SendToAutoGet $1
elseif (%sbClient.defreqmethod == 102) sbClient.SendTovPowerGet $1
else sbClient.SendToInternal $1
}
menu @sbClient.OldResults,@sbClient.@find.results,@sbClient.combined {
Check online status: sbClient.ColorNicks $active 1
}
menu @sbClient.* {
Remove off-line nicks: {
; Ook: local var, can't use sbClient.ColorNicks here.
var %cnter = 1
while (%cnter <= $line($active,0)) {
var %line = $line($active,%cnter)
if ($asc(%line) != 33) {
dline $active %cnter
continue
}
if (!$sbClient.Online(%line)) {
dline $active %cnter
continue
}
else cline 3 $active %cnter
inc %cnter
}
titlebar $active -|- sbClient local search results for $qt(%sbClient.string) -|- $findfile(%sbClient.ListFolder,*.txt,0,1) lists searched -|- $line($active,0) results -|- rclick for options - r = request file - ctrl-r = req & delete - ctrl-z = find -|-
}
Remove File Types: {
window -h @sbClient.tmp
var %types = $input(Enter a $chr(124) seperated list of filetypes to remove,euywm,Remove File Types,(si)?pdf|epub|mobi|azw3?|docx?|txt|tif|cbr|rtf|fb2,epub|mobi|azw3?,(si)?pdf|epub|mobi|azw3?|docx?|txt|tif|cbr|rtf|fb2,epub|mobi|azw3?,docx?|txt|rtf,tif|cbr|pdf,html?,jpe?g|png|gif|tiff?)
if (%types == $null) return
filter -wwxzg $menu @sbClient.tmp /(?:\.(?: $+ %types $+ )\s|[\(\[] $+ %types $+ [\)\]])/i
filter -wwzc @sbClient.tmp $menu *
window -c @sbClient.tmp
titlebar $active -|- sbClient local search results for $qt(%sbClient.string) -|- $findfile(%sbClient.ListFolder,*.txt,0,1) lists searched -|- $line($active,0) results -|- rclick for options - r = request file - ctrl-r = req & delete - ctrl-z = find -|-
}
-
Copy line(s) to clipboard: {
var %t = $sline($active,0), %cnter = 1
if (!%t) return
clipboard
while ($sline($active,%cnter) != $null) {
var %l = $v1
if ($sbClient.Online(%l)) cline 10 $active $sline($active,%cnter).ln
else cline 6 $active $sline($active,%cnter).ln
if (%t == 2) clipboard -an $+($crlf,$iif($mouse.key & 2,%l,$sbClient.GetFileName(%l)))
elseif (%t > 1) clipboard -an $iif($mouse.key & 2,%l,$sbClient.GetFileName(%l))
else clipboard -n $iif($mouse.key & 2,%l,$sbClient.GetFileName(%l))
inc %cnter
}
titlebar $active -|- $line($active,0) lines -|- rclick for options - r = request file - ctrl-r = req & delete - ctrl-z = find -|- $sline($active,0) line(s) copied to clipboard -|-
}
Sort Results: window -bs $menu
Send line(s) to RequestQueue: sbClient.SendToInternal $active
$iif(!$script(AutoGet.mrc), $style(2)) Send to AutoGet 7: sbClient.SendToAutoGet $active
$iif(!$script(vPowerGet.net.mrc), $style(2)) Send to vPowerGet.NET: sbClient.SendTovPowerGet $active
-
Request Queue
.(Re)Start Queue: sbClient.StartQueue
.Stop Queue: sbClient.StopQueue
.Clear Queue: sbClient.ClearQueue
.Show Queue: if ($sbClient.window.queue) window -a @sbClientQueue
-
Combine all sbClient result windows: {
var %c = 1, %win
while ($window(@sbClient.*,%c) != $null) {
if ($v1 != @sbClient.combined) var %win = $addtok(%win,$v1,44)
inc %c
}
if (!$window(@sbClient.combined)) window -slk0wnz @sbClient.combined Arial 12
var %v = 1
while ($gettok(%win,%v,44) != $null) {
var %b = 1, %w = $v1
while (%b <= $line(%w,0)) {
var %line = $line(%w,%b)
if ($left(%line,1) == !) aline -n @sbClient.combined %line
inc %b
}
window -c $gettok(%win,%v,44)
inc %v
}
window -bs @sbClient.combined
sbClient.ColorNicks @sbClient.combined 1
}
-
Save search results: {
var %file = $+(",$sfile($mircdir, Save search results,Save),.txt")
if (!%file) return
.savebuf $active $replace(%file,.txt.txt",.txt")
}
Load saved results: sbClient.LoadOldResults $active
-
Start new search: dialog -am sbClient_search sbClient_search
sbClient options: dialog -am sbClient_options sbClient_options
-
Close: window -c $active
-
}
menu @sbClientQueue {
$iif(!$sline($menu,0),$style(2)) Remove File: {
var %cnt = $sline($menu,0)
if (!%cnt) return
while (%cnt > 0) {
dline -l $menu $sline($menu,%cnt).ln
dec %cnt
}
window -b @sbClientQueue
}
-
(Re)Start Queue: sbClient.StartQueue
Stop Queue: sbClient.StopQueue
Clear Queue: sbClient.ClearQueue
}
; $1 = @window
alias -l sbClient.LoadOldResults {
var %file = $sfile($mircdir,Load search results,Load)
if (%file == $null) return
if ($1 != @sbClient.OldResults) renwin $1 @sbClient.OldResults
if (!$window(@sbClient.OldResults)) window -ek0lmwz @sbClient.OldResults Arial 12
if (!$isfile(%file)) {
titlebar @sbClient.OldResults [ERROR] Invalid file: $qt(%file)
return
}
sbClient.LS.Loadresults @sbClient.OldResults %file
titlebar @sbClient.OldResults -|- File $qt($nopath(%file)) loaded. -|- $line(@sbClient.OldResults,0) lines -|- rclick for options - r = request file - ctrl-r = req & delete - ctrl-z = find -|-
}
;!trigger filename
;!trigger %hash% filename
;!trigger hash | filename
;!trigger hash - filename (no ext)
;!trigger filename ::HASH:: hash
alias sbclient.GetFileHash {
;!trigger filename ::HASH:: hash
var %r = /::HASH::\s([a-f\d]+)/i
if ($regex($replace($1-,$chr(160),$chr(32)),%r)) return $regml(1)
;!trigger %hash% filename
var %r = /^\S+?\s(\x25[a-f\d]+\x25)\s/i
if ($regex($replace($1-,$chr(160),$chr(32)),%r)) return $regml(1)
;!trigger hash22chars - filename (no ext)
var %r = /^\S+?\s([a-z\d+\/]{22})\s/i
if ($regex($replace($1-,$chr(160),$chr(32)),%r)) return $regml(1)
;;!trigger hash | filename ( this type doesnt respond to hash alone )
;var %r = /^\S+?\s([a-f\d]{12})\s\x7c\s/i
;if ($regex($replace($1-,$chr(160),$chr(32)),%r)) return $regml(1)
;!trigger filename
return
}
;!trigger filename
;!trigger %hash% filename
;!trigger hash | filename
;!trigger hash22chars - filename (no ext) (use hash instead of filename)
;!trigger filename ::HASH:: hash
alias sbclient.GetFileName {
var %r = /^\S+?\s(?:\x25[a-f\d]+\x25\s|[a-f\d]{12}\s\x7c\s)?(.*\.[a-z][a-z\d]{1,4})(?:\s|$)/i
tokenize 32 $replace($1-,$chr(160),$chr(32))
if ($regex($1-,%r)) return $regml(1)
; didn't get extension :(
return $2-
}
menu menubar,channel {
sbClient
.Search dialog (F4): {
if ($dialog(sbClient_search) == $null) dialog -am sbClient_search sbClient_search
else dialog -v sbClient_search
}
.Request Queue
..Show Queue: if ($sbClient.window.queue) window -a @sbClientQueue
..Stop Queue: sbClient.StopQueue
.sbClient options: dialog -am sbClient_options sbClient_options
.-
.Load saved results: sbClient.LoadOldResults @sbClient.OldResults
.-
}
menu menubar {
sbClient
.-
.Unload sbClient {
if ($?!="Do you really want to unload sbClient?" == $true) unload -rs $script
}
}
on *:unload: {
sbClient.Display Unloading...
sbClient.Display Closing sbClient windows
close -@sbClient.*
sbClient.CloseQueue
sbClient.Display Removing variables...
unset %sbClient.*
sbClient.Display sbClient removed. Note that sbClient files were not deleted.
}
alias -l sbClient.CheckVars {
if (!$var(%sbClient.storetxt,0)) set %sbClient.storetxt 1
if (!$var(%sbClient.checkver,0)) set %sbClient.checkver 1
if (!$var(%sbClient.versionresponse,0)) set %sbClient.versionresponse 1
if (!$var(%sbClient.defreqmethod,0)) set %sbClient.defreqmethod 100
if (!$var(%sbClient.ResultsFileRegex,0)) set %sbClient.ResultsFileRegex /^Se(?:arch|ek)\w+?[_\s]results[_\s]for[_\s]/i
if (!$var(%sbClient.ResultsTermsRegex,0)) set %sbClient.ResultsTermsRegex /^(Se(?:arch|ek)\w+?)[_\s]results[_\s]for[_\s](.*)$/i
if (!$var(%sbClient.WebSite,0)) set %sbClient.WebSite https://github.com/mIRC-scripts/sbClient
if (!$var(%sbClient.CheckWebSite,0)) set %sbClient.CheckWebSite https://raw.githubusercontent.com/mIRC-scripts/sbClient/refs/heads/master/sbClient.ver
}
on *:load: {
if ($script != $script(1)) .load -rs1 $qt($script)
sbClient.Display Loading sbClient v $+ $sbClient.version by DukeLupus (Modified by Ook)
sbClient.Display Check 12www.dukelupus.com1,9 for help and updates.
if ($version < 7.55) sbClient.Display mIRC v7.55+ is recommended.
sbClient.Display Checking sbClient.dll
if (!$isfile($scriptdirsbClient.dll)) {
sbClient.Display sbClient.dll not found in script folder. Loading stopped.
unload -rs $script
}
else sbClient.Display sbClient.dll version $sbClientdll(GetDllVersion, nothing) by Ook found.
sbClient.Display Checking mUnzip.dll
if ($version < 7.55) {
if (!$isfile($scriptdirmUnzip.dll)) {
sbClient.Display mUnzip.dll not found in script folder. Loading stopped.
unload -rs $script
}
else sbClient.Display mUnzip.dll found: $replace($dll($scriptdirmUnzip.dll, DLLInfo, .),S_OK,$null, $chr(32) $+ $chr(32), $chr(32))
}
else sbClient.Display mIRC $+(v,$version) found, mUnzip.dll not required.
sbClient.Display Initializing variables...
sbClient.CheckVars
sbClient.Display All done, sbClient successfully loaded
.timer 1 0 dialog -am sbClient_options sbClient_options
}
alias sbClient.Check {
if (!$server) { sbClient.error mIRC is not connected! | return 0 }
if ($len($2-) < 3) { sbClient.error Search string is too short - minimum search string length is three letters (excluding wildcards) | return 0 }
scon $sbClient.GetNetworkID($1)
if (!$chan($sbClient.GetChannel($1))) { sbClient.error You are not on selected channel! | return 0 }
if (!$($+(%,sbClient.,$1,.trigger),2)) { sbClient.error No trigger from $1 received! | return 0) }
return 1
}
alias sbClient.DoSearch {
if (!$($+(%,sbClient.,$1,.trigger),2)) halt
scon -t1 $sbClient.GetNetworkID($1) msg $sbClient.GetChannel($1) $($+(%,sbClient.,$1,.trigger),2) $2-
}
on *:filercvd:*results?for*: {
var %resultdir = $+($mircdir,SearchBot results), %fn = $nopath($filename)
sbClient.CheckVars
; try to determine if its a valid results file & not something else.
if (!$regex(%fn,%sbClient.ResultsFileRegex)) return
if (!$isdir(%resultdir)) {
if (!$sbClient.mkdir(%resultdir)) { sbClient.error Unable to make folder: %resultdir | halt }
}
var %r = $regsubex(%fn,%sbClient.ResultsTermsRegex,$+(\1_results_for_,$chr(1),$replace(\2,_,$chr(32),.txt.zip,.txt,.zip,.txt)))
if ($right(%fn,4) == .zip) {
if ($version < 7.55) {
if (OK !isin $dll($scriptdirmUnzip.dll,Unzip,-oM *.txt $qt($filename) $qt(%resultdir))) { sbClient.error Unzipping of the results failed! | halt }
}
else {
if (!$zip($filename,eo,%resultdir)) { sbClient.error Unzipping of the results failed! | halt }
}
if (!$sbClient.remove($filename)) { sbClient.error Unable to remove archive: $filename | halt }
;var %rfile = $+(",%resultdir,\,$gettok(%r,1,1),$gettok(%r,2,1),")
var %rfile = $+(",$findfile(%resultdir,$+($gettok(%r,1,1),$replace($gettok(%r,2,1),_,?,$chr(32),?)),1),")
}
else {
var %rfile = $+(",%resultdir,%fn,")
if (!$sbClient.rename($filename,%rfile)) { sbClient.error Unable to move file: $filename | halt }
}
var %a = $replace($gettok(%r,2,1),.txt,$null,.zip,$null,$chr(32),.)
if (%sbClient.Separate) var %window = @sbClient.results. $+ %a
else var %window = @sbClient.results
window -ek0lmwz %window Arial 12
if (!$sbClient.loadbuf(-r %window %rfile)) { sbClient.error Unable to load %rfile | window -c %window | halt }
sbClient.ColorNicks %window
; this line sorts window contents by nick
;window -bs %window
set %sbClient.string $right($left($gettok(%r,2,1),-4),-1)
titlebar %window -|- SearchBot results for $qt(%sbClient.string) -|- Current channel is %sbClient.SearchChannel -|- rclick for options - r = request file - ctrl-r = req & delete - ctrl-z = find -|-
if (%sbClient.storetxt) {
var %filename = $+(",$mircdirSearchBot results\,$gettok(%r,2,1),")
var %filename = $replace(%filename,.txt,$+(.,$asctime(yyyy-mm-dd-HH-mm-ss),.txt))
if ($isfile(%filename)) var %filename = $replace(%filename,.txt,$+(.,$ticks,.txt))
if (!$sbClient.rename(%rfile,%filename)) sbClient.error Unable to rename %rfile to %filename
}
elseif (!$sbClient.remove(%rfile)) sbClient.error Unable to remove %rfile
return
:error
if (*unable to open file*Search*_results* iswm $error) {
echo 4 -sa [ERROR] Unable to open search results, possible file access restrictions.
echo 4 -sa [ERROR] Try & manually open the file, if this fails (access denied) look at the security details for the file.
}
}
; $1- = filename
alias sbClient.MakeReg {
var %f = $replace($1-,\Q,\\Q,\E,\\E), %r = /^, %c = 1
while ($gettok(%f,%c,32)) {
var %r = %r $+ (?=.*\Q $+ $v1 $+ \E)
inc %c
}
var %r = %r $+ /iu
return %r
}
; no args, only used in *:filercvd:*: event
alias -l sbClient.IsValidFile return $regex(%sbClient.RequestedFile,$sbClient.MakeReg($file($filename).name $file($filename).ext))
on *:filercvd:*: {
; check if we requested a file.
if (!%sbClient.RequestedFile) return
; check if it was this file.
;if ($replace($nopath($filename),_,*) !iswm %sbClient.RequestedFile) return
if (!$sbClient.IsValidFile) return
; clear setting
sbClient.StopQueue
; get next file
sbClient.StartQueue
}
on *:getfail:*: {
; check if we requested a file.
if (!%sbClient.RequestedTrigger) return
if (!%sbClient.RequestedFile) return
; check if it was this file.
if ($replace($nopath($filename),_,*) !iswm %sbClient.RequestedFile) return
; put file at the end of the list.
aline -l @sbClientQueue %sbClient.RequestedTrigger %sbClient.RequestedFile
window -b @sbClientQueue
; clear setting
sbClient.StopQueue
; get next file
sbClient.StartQueue
}
on *:input:@sbClient.results*: {
if ($left($1-,1) == $comchar) halt
var %sstring = $sbclient.FixString($1-)
if ($sbClient.Check(%sbClient.SearchChannel,%sstring) == 0) halt
sbClient.DoSearch %sbClient.SearchChannel %sstring
}
on *:start: {
; compatibility stuff...
.disable #sbclient_nonoop
.disable #sbclient_noqt
.disable #sbclient_nocomchar
if ($version < 6.17) {
if (!$isalias(noop)) .enable #sbclient_nonoop
if (!$isalias(qt)) .enable #sbclient_noqt
}
if ($version < 7.46) {
if (!$isalias(comchar)) .enable #sbclient_nocomchar
}
; v7.56 required for $urlget()
if ($version < 7.56) set %sbClient.checkver 0
;
sbClient.CheckVars
sbClient.Cleanup
if ($script(1) != $script) .reload -rs1 $script
if (%sbClient.checkver == 1) sbClient.update
}
#sbclient_nonoop off
alias noop
#sbclient_nonoop end
#sbclient_noqt off
; gives the same results as the real qt alias
alias qt {
var %l = ", %r = "
if ($left($1,1) == ") var %l
if ($right($1-,1) == ") var %r
return $+(%l,$1-,%r)
}
#sbclient_noqt end
#sbclient_nocomchar off
alias comchar return $readini($mircini,text,commandchar)
#sbclient_nocomchar end
on *:exit: sbClient.Cleanup
alias sbClient.Cleanup {
if (%sbClient.searching == 1) {
sbClientdll Stop 1
set %sbClient.searching 0
}
var %f = $mircdirsbClient.ls.results.txt
if ($isfile(%f)) {
if (!$sbClient.remove(%f)) sbClient.error Unable to remove %f
}
}
alias sbClient.update.finished {
if ($urlget($1).state != ok) return
var %b = $urlget($1).target
if (!$bvar(%b,0)) return
breplace %b 10 32 13 32
var %t = $bvar(%b,1,100).text
if (($gettok(%t,1,59) == sbClient) && ($gettok(%t,2,59) != $sbClient.version)) {
sbClient.Display You should update sbClient. You are using version $sbClient.version $+ , but version $gettok(%t,2,59) is available from sbClient website at 12 $+ %sbClient.WebSite
}
elseif (($gettok(%t,1,59) == sbClient) && ($gettok(%t,2,59) == $sbClient.version)) {
if ($dialog(sbClient_options)) sbClient.Display You have current version of sbClient
}
}
alias sbClient.update {
if (!$server) return
noop $urlget(%sbClient.CheckWebSite,bge,&sbClientUpdate,sbClient.update.finished)
}
alias F4 { dialog -am sbClient_search sbClient_search }
on *:input:#: {
if (($1 == @find) || ($1 == @locator)) set -u600 %sbclient.searchactive 1
}
on ^*:open:?: {
if ((%sbclient.searchactive == 1) && (%sbClient.groupfind == 1)) {
sbclient.CheckPrivText $network $nick $strip($1-)
}
}
on ^*:text:*:?: {
if ((%sbclient.searchactive == 1) && (%sbClient.groupfind == 1)) {
sbclient.CheckPrivText $network $nick $strip($1-)
}
}
on ^*:notice:*:?: {
if ((%sbclient.searchactive == 1) && (%sbClient.groupfind == 1)) {
sbclient.CheckPrivText $network $nick $strip($1-)
}
}
alias sbclient.CheckPrivText {
var %net = $1, %nick = $2, %text = $3-
if (*Search Result*OmeNServE* iswm %text) sbclient.FindHeaders $1-
if (*OmeN*Search Result*ServE* iswm %text) sbclient.FindHeaders $1-
if (*Matches for*Copy and paste in channel* iswm %text) sbclient.FindHeaders $1-
if (*Total*files found* iswm %text) sbclient.FindHeaders $1-
if (*Search Results*QwIRC* iswm %text) sbclient.FindHeaders $1-
if (*Search Result*Too many files*Type* iswm %text) sbclient.FindHeaders $1-
if (*@Find Results*SysReset* iswm %text) sbclient.FindHeaders $1-
if (*End of @Find* iswm %text) sbclient.FindHeaders $1-
if (*I have*for*in listfile*type* iswm %text) sbclient.FindHeaders $1-
if (*SoftServe*Search result* iswm %text) sbclient.FindHeaders $1-
if (*Tengo*coincidencia* para* iswm %text) sbclient.FindHeaders $1-
if (*I have*match*for*Copy and Paste* iswm %text) sbclient.FindHeaders $1-
if (*Too many results*@* iswm %text) sbclient.FindHeaders $1-
if (*Tengo*resultado*slots* iswm %text) sbclient.FindHeaders $1-
if (*I have*matches for*You might want to get my list by typing* iswm %text) sbclient.FindHeaders $1-
if (*Résultat De Recherche*OmeNServE* iswm %text) sbclient.FindHeaders $1-
if (*Resultados De Busqueda*OmenServe* iswm %text) sbclient.FindHeaders $1-
if (*Total de*fichier*Trouvé* iswm %text) sbclient.FindHeaders $1-
if (*Fichier* Correspondant pour*Copie* iswm %text) sbclient.FindHeaders $1-
if (*Search Result*Matches For*Copy And Paste* iswm %text) sbclient.FindHeaders $1-
if (*Resultados de la búsqueda*DragonServe* iswm %text) sbclient.FindHeaders $1-
if (*Results for your search*DragonServe* iswm %text) sbclient.FindHeaders $1-
if (*«SoftServe»* iswm %text) sbclient.FindHeaders $1-
if (*search for*returned*results on list* iswm %text) sbclient.FindHeaders $1-
if (*List trigger:*Slots*Next Send*CPS in use*CPS Record* iswm %text) sbclient.FindHeaders $1-
if (*Searched*files and found*matching*To get a file, copy !* iswm %text) sbclient.FindHeaders $1-
if (*Note*Hey look at what i found!* iswm %text) sbclient.FindHeaders $1-
if (*Note*MP3-MP3* iswm %text) sbclient.FindHeaders $1-
if (*Search Result*Matches For*Get My List Of*Files By Typing @* iswm %text) sbclient.FindHeaders $1-
if (*Resultado Da Busca*Arquivos*Pegue A Minha Lista De*@* iswm %text) sbclient.FindHeaders $1-
if (*J'ai Trop de Résultats Correspondants*@* iswm %text) sbclient.FindHeaders $1-
if (*I have found*files that match your search* iswm %text) sbclient.FindHeaders $1-
if (*Search Results*Found*matches for*Type @*to download my list* iswm %text) sbclient.FindHeaders $1-
tokenize 32 %text
if ((*Omen* iswm $1) && (! isin $2)) sbclient.FindResults %nick %text
if ($left($1,1) == !) sbclient.FindResults %nick %text
if (($1 == $chr(58)) && ($left($2,1) == !)) sbclient.FindResults %nick %text
}
alias sbclient.FindHeaders {
var %net = $1, %nick = $2, %text = $3-, %cnter = 1
while ($gettok(%text,%cnter,32) != $null) {
var %tok = $v1
if ((%tok isnum) && (!%fndfiles)) var %fndfiles = %tok
elseif (($left(%tok,1) == @) && ($len(%tok) > 1)) var %trigger = %tok
inc %cnter
}
if ((!%fndfiles) || (!%trigger)) { halt }
if (!$window(@find.ServerData)) window -slk1wnz -t5,15,25,35,45 @find.ServerData Arial 12
aline -n @find.ServerData $+(%net,$chr(9),%nick,$chr(9),%fndfiles,$chr(9),%trigger)
titlebar @find.ServerData -=- Network -=- Nick -=- Number of matches -=- List trigger -=- rclick for options -=-
halt
}
alias sbclient.FindResults {
if (!$window(@sbClient.@find.results)) window -slk0wnz @sbClient.@find.results Arial 12
var %line = $+(!,$gettok($2-,2,33))
aline -n @sbClient.@find.results %line
window -b @sbClient.@find.results
titlebar @sbClient.@find.results -=- $line(@sbClient.@find.results,0) results so far -=- rclick for options - r = request file - ctrl-r = req & delete - ctrl-z = find
halt
}
menu @find.ServerData {
Copy trigger to clipboard: {
if (!$sline($active,0)) halt
.clipboard
.clipboard $gettok($sline(@find.ServerData,1),4,9)