~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to utilities/diatheke/tcl/biblebot-diatheke.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Marsden, Jonathan Marsden, Dmitrijs Ledkovs, Closed Bugs
  • Date: 2009-05-30 11:55:55 UTC
  • mfrom: (1.3.1 upstream) (6.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090530115555-r427zsn3amivdpfu
Tags: 1.6.0+dfsg-1
[ Jonathan Marsden ]
* New upstream release. (Closes: #507960) (LP: #320558)
* debian/patches/02_libver.diff:
  - Bump SONAME to 8 -- SWORD 1.6 is not backward compatible with 1.5.11.
* debian/patches/series:
  - Remove 10_diatheke.diff -- included in upstream source.
* debian/patches/:
  - Remove several old unused .diff files.
  - Add 11_regex_only_when_needed.diff to conditionally include regex lib.
  - Add 12_fix_compiler_warnings.diff to remove all compiler warnings.
  - Add 13_fix_osis2mod_compression_default.diff from upstream svn.
  - Add 14_closing_section_not_chapter.diff from upstream svn.
* debian/libsword7.*: 
  - Rename to libsword8.*
  - Change libsword7 to libsword8 within files.
* debian/rules: 
  - SONAME bump to 8.
  - Set library version check to >= 1.6
* debian/control:
  - Change libsword7 to libsword8.
  - Add libsword7 to Conflicts.
  - Fix case of sword to SWORD in package descriptions.
  - Bump Standards-Version to 3.8.1 (no changes needed).
  - Fix section for libsword-dbg to avoid lintian warning.
* debian/rules:
  - Add DFSG get-orig-source target.
* debian/copyright:
  - Fix various mistakes in initial attempt to document copyrights.

[ Dmitrijs Ledkovs ]
* debian/rules: Added utils.mk to use missing-files target and call it on
  each build.
* debian/libsword-dev.install: Added libsword.la, previously missing.
* debian/libsword7.install: Added missing libicu translit files.
* debian/control:
  - Updated all uses of SWORD version to 1.6
  - Added libsword-dbg package
* debian/watch: Fixed a small mistake which was resulting in extra "."
  in final version name.
* debian/rules: simplified manpage processing.
* debian/libsword8.lintian-overrides: added override for module
  installation directory.
* debian/copyright: Updated with information about everyfile.
  Closes: #513448 LP: #322638
* debian/diatheke.examples: moved examples here from the diatheke.install
* debian/rules:
  - enabled shell script based testsuite
  - added commented out cppunit testsuite
* debian/patches/40_missing_includes.diff: 
  - added several missing stdio.h includes to prevent FTBFS of testsuite.

[ Closed Bugs ]
* FTBFS on intrepid (LP: #305172)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Diatheke/Tcl 3.0 by Chris Little <chrislit@gotjesus.org>
 
2
# Based on code schema of <cking@acy.digex.net>
 
3
 
 
4
# *
 
5
# * Copyright 1999-2009 CrossWire Bible Society (http://www.crosswire.org)
 
6
# *     CrossWire Bible Society
 
7
# *     P. O. Box 2528
 
8
# *     Tempe, AZ  85280-2528
 
9
# *
 
10
# * This program is free software; you can redistribute it and/or modify it
 
11
# * under the terms of the GNU General Public License as published by the
 
12
# * Free Software Foundation version 2.
 
13
# *
 
14
# * This program is distributed in the hope that it will be useful, but
 
15
# * WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
# * General Public License for more details.
 
18
# *
 
19
 
 
20
 
 
21
# This script is intended for use with libraries and modules from
 
22
# the SWORD Project, available at http://www.crosswire.org/
 
23
#
 
24
# To install Diatheke/Tcl, install an eggdrop IRC bot, copy the
 
25
# Diatheke/Tcl .tcl file to your eggdrop scripts directory, and
 
26
# add a line to the end of your bot startup script to load the
 
27
# Diatheke/Tcl script.  This script has been tested with eggdrop 1.3.23
 
28
# but should function fine in later versions.
 
29
#
 
30
# This is script assumes you have every single SWORD module installed
 
31
# that was available at the time of release.  Since you probably do not,
 
32
# remove all modules listed in the pub_books function that you do not
 
33
# have installed to hide them from end-users.
 
34
#
 
35
# The !history command only works if you have LOGGING turned on in
 
36
# diatheke (the command line C program).  This command is commented out
 
37
# of the help function and must be uncommented to make it show up for
 
38
# end-users.
 
39
#
 
40
# When you get the script loaded, type !biblehelp in a channel where
 
41
# the bot is present and it will give you a full list of commands.
 
42
# More commands will appear to you depending upon which mode the bot is
 
43
# in and whether you are an op on the bot or voiced in the channel.
 
44
 
 
45
set diaver 4.0
 
46
 
 
47
#modify this to reflect actual location of diatheke and dict binaries
 
48
set diatheke "/usr/bin/diatheke"
 
49
set dict "/usr/bin/dict"
 
50
 
 
51
proc publookupverse {vlookup} {
 
52
    global botnick chan bibver diatheke
 
53
 
 
54
    set arg "-b"
 
55
    set n [string first "@" $vlookup]
 
56
    if {$n > -1 && $n < 2} {
 
57
        append arg n
 
58
    }
 
59
 
 
60
    set n [string first "#" $vlookup]
 
61
    if {$n > -1 && $n < 2} {
 
62
        append arg f
 
63
    }
 
64
    set vlookup [string trimleft $vlookup "#"]
 
65
    set vlookup [string trimleft $vlookup "@"]
 
66
    set vlookup [string trimleft $vlookup "#"]
 
67
 
 
68
    catch {exec $diatheke -f plaintext -o $arg -b $bibver -k "$vlookup" >& /tmp/fooout.$botnick}
 
69
    catch {set foofile [open /tmp/fooout.$botnick]}
 
70
    while {[gets $foofile fooverse] >= 0} {
 
71
        set len [string length $fooverse]
 
72
        set i 0
 
73
        set j 255
 
74
        while {$j < $len} {
 
75
            if {[regexp ">" $fooverse]} {
 
76
                while {[string index $fooverse $j] != ">" && [string index $fooverse $j] != "\n"} {set j [expr $j - 1]}
 
77
            } else {
 
78
                while {[string index $fooverse $j] != " " && [string index $fooverse $j] != "\n"} {set j [expr $j - 1]}
 
79
            }
 
80
            set foo2 [string range $fooverse $i $j]
 
81
            set foo2 [string trim $foo2]
 
82
            regsub -all -nocase {(<FI>|<CM>|<FB>)} $foo2 {} foo2
 
83
            regsub -all {<RF>} $foo2 {(footnote: } foo2
 
84
            regsub -all {<Rf>} $foo2 {)} foo2
 
85
            putmsg $chan "$foo2"
 
86
            set i [expr $j + 1]
 
87
            set j [expr $j + 256]
 
88
            if {$j > $len} {set j $len}
 
89
        }
 
90
        set foo2 [string range $fooverse $i end]
 
91
        set foo2 [string trim $foo2]
 
92
        regsub -all -nocase {(<FI>|<CM>|<FB>)} $foo2 {} foo2
 
93
        regsub -all {<RF>} $foo2 {(footnote: } foo2
 
94
        regsub -all {<Rf>} $foo2 {)} foo2
 
95
        putmsg $chan "$foo2"
 
96
    }
 
97
    
 
98
    catch {close $foofile}    
 
99
    exec rm /tmp/fooout.$botnick
 
100
    return 1
 
101
}
 
102
 
 
103
 
 
104
proc pub_lookup {nick uhost hand channel arg} {
 
105
    global von chan bibver
 
106
    set chan $channel
 
107
    if {$von==0} {
 
108
        putmsg $nick "Verse display is currently off."
 
109
        return 0
 
110
    }
 
111
    if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} {
 
112
        putmsg $nick "Only ops can display verses at this time."
 
113
        return 0
 
114
    }
 
115
        
 
116
    publookupverse $arg
 
117
 
 
118
}
 
119
 
 
120
bind pub - !kjv setver_kjv
 
121
bind pub - !english setver_kjv
 
122
 
 
123
proc setver_kjv {nick uhost hand channel arg} {
 
124
    global botnick chan bibver
 
125
    set bibver KJV
 
126
    pub_lookup $nick $uhost $hand $channel $arg
 
127
}
 
128
 
 
129
 
 
130
bind pub - !niv setver_niv
 
131
 
 
132
proc setver_niv {nick uhost hand channel arg} {
 
133
    global botnick chan bibver
 
134
    set bibver NIV
 
135
    pub_lookup $nick $uhost $hand $channel $arg
 
136
}
 
137
 
 
138
bind pub - !dr setver_dr
 
139
bind pub - !douayrheims setver_dr
 
140
bind pub - !dre setver_dr
 
141
 
 
142
proc setver_dr {nick uhost hand channel arg} {
 
143
    global botnick chan bibver
 
144
    set bibver DR
 
145
    pub_lookup $nick $uhost $hand $channel $arg
 
146
}
 
147
 
 
148
bind pub - !nas setver_nasb
 
149
bind pub - !nasb setver_nasb
 
150
 
 
151
proc setver_nasb {nick uhost hand channel arg} {
 
152
    global botnick chan bibver
 
153
    set bibver NASB
 
154
    pub_lookup $nick $uhost $hand $channel $arg
 
155
}
 
156
 
 
157
bind pub - !hnv setver_hnv
 
158
 
 
159
proc setver_hnv {nick uhost hand channel arg} {
 
160
    global botnick chan bibver
 
161
    set bibver HNV
 
162
    pub_lookup $nick $uhost $hand $channel $arg
 
163
}
 
164
 
 
165
bind pub - !web setver_web
 
166
 
 
167
proc setver_web {nick uhost hand channel arg} {
 
168
    global botnick chan bibver
 
169
    set bibver WEB
 
170
    pub_lookup $nick $uhost $hand $channel $arg
 
171
}
 
172
 
 
173
bind pub - !akjv setver_akjv
 
174
 
 
175
proc setver_akjv {nick uhost hand channel arg} {
 
176
    global botnick chan bibver
 
177
    set bibver AKJV
 
178
    pub_lookup $nick $uhost $hand $channel $arg
 
179
}
 
180
 
 
181
bind pub - !bbe setver_bbe
 
182
 
 
183
proc setver_bbe {nick uhost hand channel arg} {
 
184
    global botnick chan bibver
 
185
    set bibver BBE
 
186
    pub_lookup $nick $uhost $hand $channel $arg
 
187
}
 
188
 
 
189
bind pub - !webster setver_webster
 
190
 
 
191
proc setver_webster {nick uhost hand channel arg} {
 
192
    global botnick chan bibver
 
193
    set bibver Websters
 
194
    pub_lookup $nick $uhost $hand $channel $arg
 
195
}
 
196
 
 
197
bind pub - !jbc setver_jbc
 
198
 
 
199
proc setver_jbc {nick uhost hand channel arg} {
 
200
    global botnick chan bibver
 
201
    set bibver ORTHJBC
 
202
    pub_lookup $nick $uhost $hand $channel $arg
 
203
}
 
204
 
 
205
bind pub - !rva setver_rva
 
206
bind pub - !spanish setver_rva
 
207
 
 
208
proc setver_rva {nick uhost hand channel arg} {
 
209
    global botnick chan bibver
 
210
    set bibver SpaRVA
 
211
    pub_lookup $nick $uhost $hand $channel $arg
 
212
}
 
213
 
 
214
bind pub - !lsg setver_lsg
 
215
bind pub - !french setver_lsg
 
216
 
 
217
proc setver_lsg {nick uhost hand channel arg} {
 
218
    global botnick chan bibver
 
219
    set bibver FreLSG
 
220
    pub_lookup $nick $uhost $hand $channel $arg
 
221
}
 
222
 
 
223
bind pub - !bis setver_bis
 
224
bind pub - !indonesian setver_bis
 
225
 
 
226
proc setver_bis {nick uhost hand channel arg} {
 
227
    global botnick chan bibver
 
228
    set bibver IndBIS
 
229
    pub_lookup $nick $uhost $hand $channel $arg
 
230
}
 
231
 
 
232
bind pub - !tb setver_tb
 
233
 
 
234
proc setver_tb {nick uhost hand channel arg} {
 
235
    global botnick chan bibver
 
236
    set bibver IndTB
 
237
    pub_lookup $nick $uhost $hand $channel $arg
 
238
}
 
239
 
 
240
bind pub - !sve setver_sve
 
241
bind pub - !swedish setver_sve
 
242
 
 
243
proc setver_sve {nick uhost hand channel arg} {
 
244
    global botnick chan bibver
 
245
    set bibver SweSve
 
246
    pub_lookup $nick $uhost $hand $channel $arg
 
247
}
 
248
 
 
249
bind pub - !vnt setver_vnt
 
250
 
 
251
proc setver_vnt {nick uhost hand channel arg} {
 
252
    global botnick chan bibver
 
253
    set bibver SpaVNT
 
254
    pub_lookup $nick $uhost $hand $channel $arg
 
255
}
 
256
 
 
257
bind pub - !asv setver_asv
 
258
 
 
259
proc setver_asv {nick uhost hand channel arg} {
 
260
    global botnick chan bibver
 
261
    set bibver ASV
 
262
    pub_lookup $nick $uhost $hand $channel $arg
 
263
}
 
264
 
 
265
bind pub - !rsv setver_rsv
 
266
 
 
267
proc setver_rsv {nick uhost hand channel arg} {
 
268
    global botnick chan bibver
 
269
    set bibver RSV
 
270
    pub_lookup $nick $uhost $hand $channel $arg
 
271
}
 
272
 
 
273
bind pub - !alt setver_alt
 
274
 
 
275
proc setver_alt {nick uhost hand channel arg} {
 
276
    global botnick chan bibver
 
277
    set bibver ALT
 
278
    pub_lookup $nick $uhost $hand $channel $arg
 
279
}
 
280
 
 
281
bind pub - !dby setver_dby
 
282
bind pub - !darby setver_dby
 
283
 
 
284
proc setver_dby {nick uhost hand channel arg} {
 
285
    global botnick chan bibver
 
286
    set bibver Darby
 
287
    pub_lookup $nick $uhost $hand $channel $arg
 
288
}
 
289
 
 
290
bind pub - !pr setver_pr
 
291
bind pub - !finnish setver_pr
 
292
 
 
293
proc setver_pr {nick uhost hand channel arg} {
 
294
    global botnick chan bibver
 
295
    set bibver FinPR
 
296
    pub_lookup $nick $uhost $hand $channel $arg
 
297
}
 
298
 
 
299
bind pub - !lsg setver_lsg
 
300
bind pub - !french setver_lsg
 
301
 
 
302
proc setver_lsg {nick uhost hand channel arg} {
 
303
    global botnick chan bibver
 
304
    set bibver FreLSG
 
305
    pub_lookup $nick $uhost $hand $channel $arg
 
306
}
 
307
 
 
308
bind pub - !lut setver_lut
 
309
bind pub - !luther setver_lut
 
310
bind pub - !german setver_lut
 
311
 
 
312
proc setver_lut {nick uhost hand channel arg} {
 
313
    global botnick chan bibver
 
314
    set bibver GerLut
 
315
    pub_lookup $nick $uhost $hand $channel $arg
 
316
}
 
317
 
 
318
bind pub - !sch setver_sch
 
319
 
 
320
proc setver_sch {nick uhost hand channel arg} {
 
321
    global botnick chan bibver
 
322
    set bibver GerSch
 
323
    pub_lookup $nick $uhost $hand $channel $arg
 
324
}
 
325
 
 
326
 
 
327
bind pub - !kar setver_kar
 
328
bind pub - !hungarian setver_kar
 
329
 
 
330
proc setver_kar {nick uhost hand channel arg} {
 
331
    global botnick chan bibver
 
332
    set bibver HunKar
 
333
    pub_lookup $nick $uhost $hand $channel $arg
 
334
}
 
335
 
 
336
bind pub - !nrv setver_nrv
 
337
bind pub - !italian setver_nrv
 
338
 
 
339
proc setver_nrv {nick uhost hand channel arg} {
 
340
    global botnick chan bibver
 
341
    set bibver ItaNRV
 
342
    pub_lookup $nick $uhost $hand $channel $arg
 
343
}
 
344
 
 
345
bind pub - !jps setver_jps
 
346
 
 
347
proc setver_jps {nick uhost hand channel arg} {
 
348
    global botnick chan bibver
 
349
    set bibver JPS
 
350
    pub_lookup $nick $uhost $hand $channel $arg
 
351
}
 
352
 
 
353
bind pub - !brp setver_brp
 
354
bind pub - !portuguese setver_brp
 
355
 
 
356
proc setver_brp {nick uhost hand channel arg} {
 
357
    global botnick chan bibver
 
358
    set bibver PorBRP
 
359
    pub_lookup $nick $uhost $hand $channel $arg
 
360
}
 
361
 
 
362
bind pub - !sev setver_sev
 
363
 
 
364
proc setver_sev {nick uhost hand channel arg} {
 
365
    global botnick chan bibver
 
366
    set bibver SpaSEV
 
367
    pub_lookup $nick $uhost $hand $channel $arg
 
368
}
 
369
 
 
370
bind pub - !swahili setver_swahili
 
371
 
 
372
proc setver_swahili {nick uhost hand channel arg} {
 
373
    global botnick chan bibver
 
374
    set bibver Swahili
 
375
    pub_lookup $nick $uhost $hand $channel $arg
 
376
}
 
377
 
 
378
bind pub - !wey setver_wey
 
379
bind pub - !weymouth setver_wey
 
380
 
 
381
proc setver_wey {nick uhost hand channel arg} {
 
382
    global botnick chan bibver
 
383
    set bibver Weymouth
 
384
    pub_lookup $nick $uhost $hand $channel $arg
 
385
}
 
386
 
 
387
bind pub - !ylt setver_ylt
 
388
 
 
389
proc setver_ylt {nick uhost hand channel arg} {
 
390
    global botnick chan bibver
 
391
    set bibver YLT
 
392
    pub_lookup $nick $uhost $hand $channel $arg
 
393
}
 
394
 
 
395
bind pub - !alb setver_alb
 
396
bind pub - !albanian setver_alb
 
397
 
 
398
proc setver_alb {nick uhost hand channel arg} {
 
399
    global botnick chan bibver
 
400
    set bibver Alb
 
401
    pub_lookup $nick $uhost $hand $channel $arg
 
402
}
 
403
 
 
404
bind pub - !gnpu setver_gnpu
 
405
bind pub - !chinese setver_gnpu
 
406
 
 
407
proc setver_gnpu {nick uhost hand channel arg} {
 
408
    global botnick chan bibver
 
409
    set bibver ChiGNPU
 
410
    pub_lookup $nick $uhost $hand $channel $arg
 
411
}
 
412
 
 
413
bind pub - !dan setver_dan
 
414
bind pub - !danish setver_dan
 
415
 
 
416
proc setver_dan {nick uhost hand channel arg} {
 
417
    global botnick chan bibver
 
418
    set bibver Dan
 
419
    pub_lookup $nick $uhost $hand $channel $arg
 
420
}
 
421
 
 
422
bind pub - !lei setver_lei
 
423
bind pub - !dutch setver_lei
 
424
 
 
425
proc setver_lei {nick uhost hand channel arg} {
 
426
    global botnick chan bibver
 
427
    set bibver DutLEI
 
428
    pub_lookup $nick $uhost $hand $channel $arg
 
429
}
 
430
 
 
431
bind pub - !lu setver_lu
 
432
 
 
433
proc setver_lu {nick uhost hand channel arg} {
 
434
    global botnick chan bibver
 
435
    set bibver DutLU
 
436
    pub_lookup $nick $uhost $hand $channel $arg
 
437
}
 
438
 
 
439
bind pub - !svv setver_svv
 
440
 
 
441
proc setver_svv {nick uhost hand channel arg} {
 
442
    global botnick chan bibver
 
443
    set bibver DutSVV
 
444
    pub_lookup $nick $uhost $hand $channel $arg
 
445
}
 
446
 
 
447
bind pub - !shr setver_shr
 
448
bind pub - !equadoran setver_shr
 
449
 
 
450
proc setver_shr {nick uhost hand channel arg} {
 
451
    global botnick chan bibver
 
452
    set bibver EquShr
 
453
    pub_lookup $nick $uhost $hand $channel $arg
 
454
}
 
455
 
 
456
bind pub - !crl setver_crl
 
457
bind pub - !creole setver_crl
 
458
 
 
459
proc setver_crl {nick uhost hand channel arg} {
 
460
    global botnick chan bibver
 
461
    set bibver FreCrl
 
462
    pub_lookup $nick $uhost $hand $channel $arg
 
463
}
 
464
 
 
465
bind pub - !fredrb setver_fredrb
 
466
 
 
467
proc setver_fredrb {nick uhost hand channel arg} {
 
468
    global botnick chan bibver
 
469
    set bibver FreDrb
 
470
    pub_lookup $nick $uhost $hand $channel $arg
 
471
}
 
472
 
 
473
bind pub - !ben setver_ben
 
474
 
 
475
proc setver_ben {nick uhost hand channel arg} {
 
476
    global botnick chan bibver
 
477
    set bibver GerBen
 
478
    pub_lookup $nick $uhost $hand $channel $arg
 
479
}
 
480
 
 
481
bind pub - !elb setver_elb
 
482
 
 
483
proc setver_elb {nick uhost hand channel arg} {
 
484
    global botnick chan bibver
 
485
    set bibver GerElb
 
486
    pub_lookup $nick $uhost $hand $channel $arg
 
487
}
 
488
 
 
489
bind pub - !kj21 setver_kj21
 
490
 
 
491
proc setver_kj21 {nick uhost hand channel arg} {
 
492
    global botnick chan bibver
 
493
    set bibver KJ21
 
494
    pub_lookup $nick $uhost $hand $channel $arg
 
495
}
 
496
 
 
497
bind pub - !litv setver_litv
 
498
 
 
499
proc setver_litv {nick uhost hand channel arg} {
 
500
    global botnick chan bibver
 
501
    set bibver LITV
 
502
    pub_lookup $nick $uhost $hand $channel $arg
 
503
}
 
504
 
 
505
bind pub - !lo setver_lo
 
506
 
 
507
proc setver_lo {nick uhost hand channel arg} {
 
508
    global botnick chan bibver
 
509
    set bibver LO
 
510
    pub_lookup $nick $uhost $hand $channel $arg
 
511
}
 
512
 
 
513
bind pub - !maori setver_maori
 
514
 
 
515
proc setver_maori {nick uhost hand channel arg} {
 
516
    global botnick chan bibver
 
517
    set bibver Maori
 
518
    pub_lookup $nick $uhost $hand $channel $arg
 
519
}
 
520
 
 
521
bind pub - !mkjv setver_mkjv
 
522
 
 
523
proc setver_mkjv {nick uhost hand channel arg} {
 
524
    global botnick chan bibver
 
525
    set bibver MKJV
 
526
    pub_lookup $nick $uhost $hand $channel $arg
 
527
}
 
528
 
 
529
bind pub - !nkj setver_nkjv
 
530
bind pub - !nkjv setver_nkjv
 
531
 
 
532
proc setver_nkjv {nick uhost hand channel arg} {
 
533
    global botnick chan bibver
 
534
    set bibver NKJV
 
535
    pub_lookup $nick $uhost $hand $channel $arg
 
536
}
 
537
 
 
538
bind pub - !ceb setver_ceb
 
539
bind pub - !filipino setver_ceb
 
540
 
 
541
proc setver_ceb {nick uhost hand channel arg} {
 
542
    global botnick chan bibver
 
543
    set bibver PhiCeb
 
544
    pub_lookup $nick $uhost $hand $channel $arg
 
545
}
 
546
 
 
547
bind pub - !rwebster setver_rwebster
 
548
 
 
549
proc setver_rwebster {nick uhost hand channel arg} {
 
550
    global botnick chan bibver
 
551
    set bibver RWebster
 
552
    pub_lookup $nick $uhost $hand $channel $arg
 
553
}
 
554
 
 
555
bind pub - !rv setver_rv
 
556
 
 
557
proc setver_rv {nick uhost hand channel arg} {
 
558
    global botnick chan bibver
 
559
    set bibver SpaRV
 
560
    pub_lookup $nick $uhost $hand $channel $arg
 
561
}
 
562
 
 
563
bind pub - !turkish setver_turkish
 
564
 
 
565
proc setver_turkish {nick uhost hand channel arg} {
 
566
    global botnick chan bibver
 
567
    set bibver Turkish
 
568
    pub_lookup $nick $uhost $hand $channel $arg
 
569
}
 
570
 
 
571
bind pub - !uma setver_uma
 
572
 
 
573
proc setver_uma {nick uhost hand channel arg} {
 
574
    global botnick chan bibver
 
575
    set bibver Uma
 
576
    pub_lookup $nick $uhost $hand $channel $arg
 
577
}
 
578
 
 
579
bind pub - !vulgate setver_vulgate
 
580
bind pub - !vulg setver_vulgate
 
581
bind pub - !latin setver_vulgate
 
582
 
 
583
proc setver_vulgate {nick uhost hand channel arg} {
 
584
    global botnick chan bibver
 
585
    set bibver Vulgate
 
586
    pub_lookup $nick $uhost $hand $channel $arg
 
587
}
 
588
 
 
589
bind pub - !nasb95 setver_nasb95
 
590
bind pub - !nas95 setver_nasb95
 
591
bind pub - !nau setver_nasb95
 
592
 
 
593
proc setver_nasb95 {nick uhost hand channel arg} {
 
594
    global botnick chan bibver
 
595
    set bibver NASB95
 
596
    pub_lookup $nick $uhost $hand $channel $arg
 
597
}
 
598
 
 
599
bind pub - !nivbr setver_nivbr
 
600
bind pub - !nib setver_nivbr
 
601
 
 
602
proc setver_nivbr {nick uhost hand channel arg} {
 
603
    global botnick chan bibver
 
604
    set bibver NIVBr
 
605
    pub_lookup $nick $uhost $hand $channel $arg
 
606
}
 
607
 
 
608
bind pub - !nlt setver_nlt
 
609
 
 
610
proc setver_nlt {nick uhost hand channel arg} {
 
611
    global botnick chan bibver
 
612
    set bibver NLT
 
613
    pub_lookup $nick $uhost $hand $channel $arg
 
614
}
 
615
 
 
616
bind pub - !nrsv setver_nrsv
 
617
 
 
618
proc setver_nrsv {nick uhost hand channel arg} {
 
619
    global botnick chan bibver
 
620
    set bibver NRSV
 
621
    pub_lookup $nick $uhost $hand $channel $arg
 
622
}
 
623
 
 
624
bind pub - !neg setver_neg
 
625
 
 
626
proc setver_neg {nick uhost hand channel arg} {
 
627
    global botnick chan bibver
 
628
    set bibver FreNEG
 
629
    pub_lookup $nick $uhost $hand $channel $arg
 
630
}
 
631
 
 
632
bind pub - !lnd setver_lnd
 
633
 
 
634
proc setver_lnd {nick uhost hand channel arg} {
 
635
    global botnick chan bibver
 
636
    set bibver ItaLND
 
637
    pub_lookup $nick $uhost $hand $channel $arg
 
638
}
 
639
 
 
640
bind pub - !mel setver_mel
 
641
bind pub - !melanesian setver_mel
 
642
 
 
643
proc setver_mel {nick uhost hand channel arg} {
 
644
    global botnick chan bibver
 
645
    set bibver Mel
 
646
    pub_lookup $nick $uhost $hand $channel $arg
 
647
}
 
648
 
 
649
bind pub - !norsk setver_norsk
 
650
 
 
651
proc setver_norsk {nick uhost hand channel arg} {
 
652
    global botnick chan bibver
 
653
    set bibver Norsk
 
654
    pub_lookup $nick $uhost $hand $channel $arg
 
655
}
 
656
 
 
657
bind pub - !cor setver_cor
 
658
 
 
659
proc setver_cor {nick uhost hand channel arg} {
 
660
    global botnick chan bibver
 
661
    set bibver RomCor
 
662
    pub_lookup $nick $uhost $hand $channel $arg
 
663
}
 
664
 
 
665
bind pub - !lba setver_lba
 
666
 
 
667
proc setver_lba {nick uhost hand channel arg} {
 
668
    global botnick chan bibver
 
669
    set bibver SpaLBA
 
670
    pub_lookup $nick $uhost $hand $channel $arg
 
671
}
 
672
 
 
673
bind pub - !byz setver_byz
 
674
 
 
675
proc setver_byz {nick uhost hand channel arg} {
 
676
    global botnick chan bibver
 
677
    set bibver ByzX
 
678
    pub_lookup $nick $uhost $hand $channel $arg
 
679
}
 
680
 
 
681
bind pub - !lxx setver_lxx
 
682
 
 
683
proc setver_lxx {nick uhost hand channel arg} {
 
684
    global botnick chan bibver
 
685
    set bibver LXXX
 
686
    pub_lookup $nick $uhost $hand $channel $arg
 
687
}
 
688
 
 
689
bind pub - !na26 setver_na26
 
690
bind pub - !greek setver_na26
 
691
 
 
692
proc setver_na26 {nick uhost hand channel arg} {
 
693
    global botnick chan bibver
 
694
    set bibver NA26X
 
695
    pub_lookup $nick $uhost $hand $channel $arg
 
696
}
 
697
 
 
698
bind pub - !scrivner setver_scrivner
 
699
 
 
700
proc setver_scrivner {nick uhost hand channel arg} {
 
701
    global botnick chan bibver
 
702
    set bibver ScrivnerX
 
703
    pub_lookup $nick $uhost $hand $channel $arg
 
704
}
 
705
 
 
706
bind pub - !stephanus setver_stephanus
 
707
 
 
708
proc setver_stephanus {nick uhost hand channel arg} {
 
709
    global botnick chan bibver
 
710
    set bibver StephanusX
 
711
    pub_lookup $nick $uhost $hand $channel $arg
 
712
}
 
713
 
 
714
bind pub - !tischendorf setver_tisch
 
715
bind pub - !tisch setver_tisch
 
716
 
 
717
proc setver_tisch {nick uhost hand channel arg} {
 
718
    global botnick chan bibver
 
719
    set bibver TischX
 
720
    pub_lookup $nick $uhost $hand $channel $arg
 
721
}
 
722
 
 
723
bind pub - !wh setver_wh
 
724
 
 
725
proc setver_wh {nick uhost hand channel arg} {
 
726
    global botnick chan bibver
 
727
    set bibver WHX
 
728
    pub_lookup $nick $uhost $hand $channel $arg
 
729
}
 
730
 
 
731
bind pub - !whnu setver_whnu
 
732
 
 
733
proc setver_whnu {nick uhost hand channel arg} {
 
734
    global botnick chan bibver
 
735
    set bibver WHNUX
 
736
    pub_lookup $nick $uhost $hand $channel $arg
 
737
}
 
738
 
 
739
bind pub - !grkbyz setver_grkbyz
 
740
 
 
741
proc setver_grkbyz {nick uhost hand channel arg} {
 
742
    global botnick chan bibver
 
743
    set bibver Byz
 
744
    pub_lookup $nick $uhost $hand $channel $arg
 
745
}
 
746
 
 
747
bind pub - !grklxx setver_grklxx
 
748
 
 
749
proc setver_grklxx {nick uhost hand channel arg} {
 
750
    global botnick chan bibver
 
751
    set bibver LXX
 
752
    pub_lookup $nick $uhost $hand $channel $arg
 
753
}
 
754
 
 
755
bind pub - !grkna26 setver_grkna26
 
756
bind pub - !grkgreek setver_na26
 
757
 
 
758
proc setver_grkna26 {nick uhost hand channel arg} {
 
759
    global botnick chan bibver
 
760
    set bibver NA26
 
761
    pub_lookup $nick $uhost $hand $channel $arg
 
762
}
 
763
 
 
764
bind pub - !grkscrivner setver_grkscrivner
 
765
 
 
766
proc setver_grkscrivner {nick uhost hand channel arg} {
 
767
    global botnick chan bibver
 
768
    set bibver Scrivner
 
769
    pub_lookup $nick $uhost $hand $channel $arg
 
770
}
 
771
 
 
772
bind pub - !grkstephanus setver_grkstephanus
 
773
 
 
774
proc setver_grkstephanus {nick uhost hand channel arg} {
 
775
    global botnick chan bibver
 
776
    set bibver Stephanus
 
777
    pub_lookup $nick $uhost $hand $channel $arg
 
778
}
 
779
 
 
780
bind pub - !grktischendorf setver_grktisch
 
781
bind pub - !grktisch setver_grktisch
 
782
 
 
783
proc setver_grktisch {nick uhost hand channel arg} {
 
784
    global botnick chan bibver
 
785
    set bibver Tisch
 
786
    pub_lookup $nick $uhost $hand $channel $arg
 
787
}
 
788
 
 
789
bind pub - !grkwh setver_grkwh
 
790
 
 
791
proc setver_grkwh {nick uhost hand channel arg} {
 
792
    global botnick chan bibver
 
793
    set bibver WH
 
794
    pub_lookup $nick $uhost $hand $channel $arg
 
795
}
 
796
 
 
797
bind pub - !grkwhnu setver_grkwhnu
 
798
 
 
799
proc setver_grkwhnu {nick uhost hand channel arg} {
 
800
    global botnick chan bibver
 
801
    set bibver WHNU
 
802
    pub_lookup $nick $uhost $hand $channel $arg
 
803
}
 
804
 
 
805
bind pub - !bhs setver_bhs
 
806
bind pub - !hebrew setver_bhs
 
807
 
 
808
proc setver_bhs {nick uhost hand channel arg} {
 
809
    global botnick chan bibver
 
810
    set bibver BHS
 
811
    pub_lookup $nick $uhost $hand $channel $arg
 
812
}
 
813
 
 
814
bind pub - !rst setver_rst
 
815
 
 
816
proc setver_rst {nick uhost hand channel arg} {
 
817
    global botnick chan bibver
 
818
    set bibver RST
 
819
    pub_lookup $nick $uhost $hand $channel $arg
 
820
}
 
821
 
 
822
bind pub - !ukrainian setver_ukrainian
 
823
 
 
824
proc setver_ukrainian {nick uhost hand channel arg} {
 
825
    global botnick chan bibver
 
826
    set bibver Ukrainian
 
827
    pub_lookup $nick $uhost $hand $channel $arg
 
828
}
 
829
 
 
830
bind pub - !arabic setver_arabic
 
831
 
 
832
proc setver_arabic {nick uhost hand channel arg} {
 
833
    global botnick chan bibver
 
834
    set bibver Arabic
 
835
    pub_lookup $nick $uhost $hand $channel $arg
 
836
}
 
837
 
 
838
bind pub - !n27u4 setver_n27u4
 
839
bind pub - !nu setver_n27u4
 
840
bind pub - !bgreek setver_n27u4
 
841
 
 
842
proc setver_n27u4 {nick uhost hand channel arg} {
 
843
    global botnick chan bibver
 
844
    set bibver N27U4
 
845
    pub_lookup $nick $uhost $hand $channel $arg
 
846
}
 
847
 
 
848
bind pub - !umgreek setver_ukgreek
 
849
 
 
850
proc setver_umgreek {nick uhost hand channel arg} {
 
851
    global botnick chan bibver
 
852
    set bibver UMGreek
 
853
    pub_lookup $nick $uhost $hand $channel $arg
 
854
}
 
855
 
 
856
bind pub - !viet setver_viet
 
857
bind pub - !vietnamese setver_viet
 
858
 
 
859
proc setver_viet {nick uhost hand channel arg} {
 
860
    global botnick chan bibver
 
861
    set bibver Viet
 
862
    pub_lookup $nick $uhost $hand $channel $arg
 
863
}
 
864
 
 
865
 
 
866
# ----------------------------------------------------------------------
 
867
 
 
868
proc pubsearchword {vlookup} {
 
869
    global botnick chan bibver diatheke
 
870
    catch {exec $diatheke -s $bibver "$vlookup" >& /tmp/fooout.$botnick}
 
871
    catch {set foofile [open /tmp/fooout.$botnick]}
 
872
 
 
873
    while {[gets $foofile fooverse] >= 0} {
 
874
        set len [string length $fooverse]
 
875
        set i 0
 
876
        set j 72
 
877
        while {$j < $len} {
 
878
            while {[string index $fooverse $j] != ";" && [string index $fooverse $j] != ")" && [string index $fooverse $j] != "\n"} {set j [expr $j + 1]}
 
879
            set foo2 [string range $fooverse $i $j]
 
880
            set foo2 [string trim $foo2]
 
881
            putmsg $chan "$foo2"
 
882
            set i [expr $j + 1]
 
883
            set j [expr $j + 73]
 
884
            if {$j > $len} {set j $len}
 
885
        }
 
886
        set foo2 [string range $fooverse $i end]
 
887
        set foo2 [string trim $foo2]
 
888
        putmsg $chan "$foo2"
 
889
    }
 
890
    catch {close $foofile}
 
891
    
 
892
    putmsg $chan "$fooverse"
 
893
    exec rm /tmp/fooout.$botnick
 
894
    return 1
 
895
}
 
896
 
 
897
 
 
898
proc pub_lookups {nick uhost hand channel arg} {
 
899
    global von chan bibver
 
900
    set chan $channel
 
901
    if {$von==0} {
 
902
        putmsg $nick "Verse display is currently off."
 
903
        return 0
 
904
    }
 
905
    if {($von==3)  && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $chan])} {
 
906
        putmsg $nick "Sorry, only ops and voiced users can do searches right now."
 
907
        return 0
 
908
    }
 
909
    if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} {
 
910
        putmsg $nick "Sorry, only ops can do searches right now."
 
911
        return 0
 
912
    }
 
913
    
 
914
    pubsearchword $arg
 
915
}
 
916
 
 
917
bind pub - !skjv setver_kjvs
 
918
bind pub - !senglish setver_kjvs
 
919
 
 
920
proc setver_kjvs {nick uhost hand channel arg} {
 
921
    global botnick chan bibver
 
922
    set bibver KJV
 
923
    pub_lookups $nick $uhost $hand $channel $arg
 
924
}
 
925
 
 
926
 
 
927
bind pub - !sniv setver_nivs
 
928
 
 
929
proc setver_nivs {nick uhost hand channel arg} {
 
930
    global botnick chan bibver
 
931
    set bibver NIV
 
932
    pub_lookups $nick $uhost $hand $channel $arg
 
933
}
 
934
 
 
935
bind pub - !sdr setver_drs
 
936
bind pub - !sdouayrheims setver_drs
 
937
bind pub - !sdre setver_drs
 
938
 
 
939
proc setver_drs {nick uhost hand channel arg} {
 
940
    global botnick chan bibver
 
941
    set bibver DR
 
942
    pub_lookups $nick $uhost $hand $channel $arg
 
943
}
 
944
 
 
945
bind pub - !snas setver_nasbs
 
946
bind pub - !snasb setver_nasbs
 
947
 
 
948
proc setver_nasbs {nick uhost hand channel arg} {
 
949
    global botnick chan bibver
 
950
    set bibver NASB
 
951
    pub_lookups $nick $uhost $hand $channel $arg
 
952
}
 
953
 
 
954
bind pub - !shnv setver_hnvs
 
955
 
 
956
proc setver_hnvs {nick uhost hand channel arg} {
 
957
    global botnick chan bibver
 
958
    set bibver HNV
 
959
    pub_lookups $nick $uhost $hand $channel $arg
 
960
}
 
961
 
 
962
bind pub - !sweb setver_webs
 
963
 
 
964
proc setver_webs {nick uhost hand channel arg} {
 
965
    global botnick chan bibver
 
966
    set bibver WEB
 
967
    pub_lookups $nick $uhost $hand $channel $arg
 
968
}
 
969
 
 
970
bind pub - !sbbe setver_bbes
 
971
 
 
972
proc setver_bbes {nick uhost hand channel arg} {
 
973
    global botnick chan bibver
 
974
    set bibver BBE
 
975
    pub_lookups $nick $uhost $hand $channel $arg
 
976
}
 
977
 
 
978
bind pub - !swebster setver_websters
 
979
 
 
980
proc setver_websters {nick uhost hand channel arg} {
 
981
    global botnick chan bibver
 
982
    set bibver Websters
 
983
    pub_lookups $nick $uhost $hand $channel $arg
 
984
}
 
985
 
 
986
bind pub - !sjbc setver_jbcs
 
987
 
 
988
proc setver_jbcs {nick uhost hand channel arg} {
 
989
    global botnick chan bibver
 
990
    set bibver ORTHJBC
 
991
    pub_lookups $nick $uhost $hand $channel $arg
 
992
}
 
993
 
 
994
bind pub - !srva setver_rvas
 
995
bind pub - !sspanish setver_rvas
 
996
 
 
997
proc setver_rvas {nick uhost hand channel arg} {
 
998
    global botnick chan bibver
 
999
    set bibver SpaRVA
 
1000
    pub_lookups $nick $uhost $hand $channel $arg
 
1001
}
 
1002
 
 
1003
bind pub - !sbis setver_biss
 
1004
bind pub - !sindonesian setver_biss
 
1005
 
 
1006
proc setver_biss {nick uhost hand channel arg} {
 
1007
    global botnick chan bibver
 
1008
    set bibver IndBIS
 
1009
    pub_lookups $nick $uhost $hand $channel $arg
 
1010
}
 
1011
 
 
1012
bind pub - !stb setver_tbs
 
1013
 
 
1014
proc setver_tbs {nick uhost hand channel arg} {
 
1015
    global botnick chan bibver
 
1016
    set bibver IndTB
 
1017
    pub_lookups $nick $uhost $hand $channel $arg
 
1018
}
 
1019
 
 
1020
bind pub - !ssve setver_sves
 
1021
bind pub - !sswedish setver_sves
 
1022
 
 
1023
proc setver_sves {nick uhost hand channel arg} {
 
1024
    global botnick chan bibver
 
1025
    set bibver SweSve
 
1026
    pub_lookups $nick $uhost $hand $channel $arg
 
1027
}
 
1028
 
 
1029
bind pub - !svnt setver_vnts
 
1030
 
 
1031
proc setver_vnts {nick uhost hand channel arg} {
 
1032
    global botnick chan bibver
 
1033
    set bibver SpaVNT
 
1034
    pub_lookups $nick $uhost $hand $channel $arg
 
1035
}
 
1036
 
 
1037
bind pub - !sasv setver_asvs
 
1038
 
 
1039
proc setver_asvs {nick uhost hand channel arg} {
 
1040
    global botnick chan bibver
 
1041
    set bibver ASV
 
1042
    pub_lookups $nick $uhost $hand $channel $arg
 
1043
}
 
1044
 
 
1045
bind pub - !srsv setver_rsvs
 
1046
 
 
1047
proc setver_rsvs {nick uhost hand channel arg} {
 
1048
    global botnick chan bibver
 
1049
    set bibver RSV
 
1050
    pub_lookups $nick $uhost $hand $channel $arg
 
1051
}
 
1052
 
 
1053
bind pub - !salt setver_alts
 
1054
 
 
1055
proc setver_alts {nick uhost hand channel arg} {
 
1056
    global botnick chan bibver
 
1057
    set bibver ALT
 
1058
    pub_lookups $nick $uhost $hand $channel $arg
 
1059
}
 
1060
 
 
1061
bind pub - !sdby setver_dbys
 
1062
bind pub - !sdarby setver_dbys
 
1063
 
 
1064
proc setver_dbys {nick uhost hand channel arg} {
 
1065
    global botnick chan bibver
 
1066
    set bibver Darby
 
1067
    pub_lookups $nick $uhost $hand $channel $arg
 
1068
}
 
1069
 
 
1070
bind pub - !spr setver_prs
 
1071
bind pub - !sfinnish setver_prs
 
1072
 
 
1073
proc setver_prs {nick uhost hand channel arg} {
 
1074
    global botnick chan bibver
 
1075
    set bibver FinPR
 
1076
    pub_lookups $nick $uhost $hand $channel $arg
 
1077
}
 
1078
 
 
1079
bind pub - !slsg setver_lsgs
 
1080
bind pub - !sfrench setver_lsgs
 
1081
 
 
1082
proc setver_lsgs {nick uhost hand channel arg} {
 
1083
    global botnick chan bibver
 
1084
    set bibver FreLSG
 
1085
    pub_lookups $nick $uhost $hand $channel $arg
 
1086
}
 
1087
 
 
1088
bind pub - !slut setver_luts
 
1089
bind pub - !sluther setver_luts
 
1090
bind pub - !sgerman setver_luts
 
1091
 
 
1092
proc setver_luts {nick uhost hand channel arg} {
 
1093
    global botnick chan bibver
 
1094
    set bibver GerLut
 
1095
    pub_lookups $nick $uhost $hand $channel $arg
 
1096
}
 
1097
 
 
1098
bind pub - !ssch setver_schs
 
1099
 
 
1100
proc setver_schs {nick uhost hand channel arg} {
 
1101
    global botnick chan bibver
 
1102
    set bibver GerSch
 
1103
    pub_lookups $nick $uhost $hand $channel $arg
 
1104
}
 
1105
 
 
1106
 
 
1107
bind pub - !skar setver_kars
 
1108
bind pub - !shungarian setver_kars
 
1109
 
 
1110
proc setver_kars {nick uhost hand channel arg} {
 
1111
    global botnick chan bibver
 
1112
    set bibver HunKar
 
1113
    pub_lookups $nick $uhost $hand $channel $arg
 
1114
}
 
1115
 
 
1116
bind pub - !snrv setver_nrvs
 
1117
bind pub - !sitalian setver_nrvs
 
1118
 
 
1119
proc setver_nrvs {nick uhost hand channel arg} {
 
1120
    global botnick chan bibver
 
1121
    set bibver ItaNRV
 
1122
    pub_lookups $nick $uhost $hand $channel $arg
 
1123
}
 
1124
 
 
1125
bind pub - !sjps setver_jpss
 
1126
 
 
1127
proc setver_jpss {nick uhost hand channel arg} {
 
1128
    global botnick chan bibver
 
1129
    set bibver JPS
 
1130
    pub_lookups $nick $uhost $hand $channel $arg
 
1131
}
 
1132
 
 
1133
bind pub - !sbrp setver_brps
 
1134
bind pub - !sportuguese setver_brps
 
1135
 
 
1136
proc setver_brps {nick uhost hand channel arg} {
 
1137
    global botnick chan bibver
 
1138
    set bibver PorBRP
 
1139
    pub_lookups $nick $uhost $hand $channel $arg
 
1140
}
 
1141
 
 
1142
bind pub - !ssev setver_sevs
 
1143
 
 
1144
proc setver_sevs {nick uhost hand channel arg} {
 
1145
    global botnick chan bibver
 
1146
    set bibver SpaSEV
 
1147
    pub_lookups $nick $uhost $hand $channel $arg
 
1148
}
 
1149
 
 
1150
bind pub - !sswahili setver_swahilis
 
1151
 
 
1152
proc setver_swahilis {nick uhost hand channel arg} {
 
1153
    global botnick chan bibver
 
1154
    set bibver Swahili
 
1155
    pub_lookups $nick $uhost $hand $channel $arg
 
1156
}
 
1157
 
 
1158
bind pub - !swey setver_weys
 
1159
bind pub - !sweymouth setver_weys
 
1160
 
 
1161
proc setver_weys {nick uhost hand channel arg} {
 
1162
    global botnick chan bibver
 
1163
    set bibver Weymouth
 
1164
    pub_lookups $nick $uhost $hand $channel $arg
 
1165
}
 
1166
 
 
1167
bind pub - !sylt setver_ylts
 
1168
 
 
1169
proc setver_ylts {nick uhost hand channel arg} {
 
1170
    global botnick chan bibver
 
1171
    set bibver YLT
 
1172
    pub_lookups $nick $uhost $hand $channel $arg
 
1173
}
 
1174
 
 
1175
bind pub - !salb setver_albs
 
1176
bind pub - !salbanian setver_albs
 
1177
 
 
1178
proc setver_albs {nick uhost hand channel arg} {
 
1179
    global botnick chan bibver
 
1180
    set bibver ALB
 
1181
    pub_lookups $nick $uhost $hand $channel $arg
 
1182
}
 
1183
 
 
1184
bind pub - !sgnpu setver_gnpus
 
1185
bind pub - !schinese setver_gnpus
 
1186
 
 
1187
proc setver_gnpus {nick uhost hand channel arg} {
 
1188
    global botnick chan bibver
 
1189
    set bibver ChiGNPU
 
1190
    pub_lookups $nick $uhost $hand $channel $arg
 
1191
}
 
1192
 
 
1193
bind pub - !sdan setver_dans
 
1194
bind pub - !sdanish setver_dans
 
1195
 
 
1196
proc setver_dans {nick uhost hand channel arg} {
 
1197
    global botnick chan bibver
 
1198
    set bibver Dan
 
1199
    pub_lookups $nick $uhost $hand $channel $arg
 
1200
}
 
1201
 
 
1202
bind pub - !slei setver_leis
 
1203
bind pub - !sdutch setver_leis
 
1204
 
 
1205
proc setver_leis {nick uhost hand channel arg} {
 
1206
    global botnick chan bibver
 
1207
    set bibver DutLEI
 
1208
    pub_lookups $nick $uhost $hand $channel $arg
 
1209
}
 
1210
 
 
1211
bind pub - !slu setver_lus
 
1212
 
 
1213
proc setver_lus {nick uhost hand channel arg} {
 
1214
    global botnick chan bibver
 
1215
    set bibver DutLU
 
1216
    pub_lookups $nick $uhost $hand $channel $arg
 
1217
}
 
1218
 
 
1219
bind pub - !ssvv setver_svvs
 
1220
 
 
1221
proc setver_svvs {nick uhost hand channel arg} {
 
1222
    global botnick chan bibver
 
1223
    set bibver DutSVV
 
1224
    pub_lookups $nick $uhost $hand $channel $arg
 
1225
}
 
1226
 
 
1227
bind pub - !sshr setver_shrs
 
1228
bind pub - !sequadoran setver_shrs
 
1229
 
 
1230
proc setver_shrs {nick uhost hand channel arg} {
 
1231
    global botnick chan bibver
 
1232
    set bibver EquShr
 
1233
    pub_lookups $nick $uhost $hand $channel $arg
 
1234
}
 
1235
 
 
1236
bind pub - !scrl setver_crls
 
1237
bind pub - !screole setver_crls
 
1238
 
 
1239
proc setver_crls {nick uhost hand channel arg} {
 
1240
    global botnick chan bibver
 
1241
    set bibver FreCrl
 
1242
    pub_lookups $nick $uhost $hand $channel $arg
 
1243
}
 
1244
 
 
1245
bind pub - !sfredrb setver_fredrbs
 
1246
 
 
1247
proc setver_fredrbs {nick uhost hand channel arg} {
 
1248
    global botnick chan bibver
 
1249
    set bibver FreDrb
 
1250
    pub_lookups $nick $uhost $hand $channel $arg
 
1251
}
 
1252
 
 
1253
bind pub - !sben setver_bens
 
1254
 
 
1255
proc setver_bens {nick uhost hand channel arg} {
 
1256
    global botnick chan bibver
 
1257
    set bibver BerBen
 
1258
    pub_lookups $nick $uhost $hand $channel $arg
 
1259
}
 
1260
 
 
1261
bind pub - !selb setver_elbs
 
1262
 
 
1263
proc setver_elbs {nick uhost hand channel arg} {
 
1264
    global botnick chan bibver
 
1265
    set bibver GerElb
 
1266
    pub_lookups $nick $uhost $hand $channel $arg
 
1267
}
 
1268
 
 
1269
bind pub - !skj21 setver_kj21s
 
1270
 
 
1271
proc setver_kj21s {nick uhost hand channel arg} {
 
1272
    global botnick chan bibver
 
1273
    set bibver KJ21
 
1274
    pub_lookups $nick $uhost $hand $channel $arg
 
1275
}
 
1276
 
 
1277
bind pub - !slitv setver_litvs
 
1278
 
 
1279
proc setver_litvs {nick uhost hand channel arg} {
 
1280
    global botnick chan bibver
 
1281
    set bibver LITV
 
1282
    pub_lookups $nick $uhost $hand $channel $arg
 
1283
}
 
1284
 
 
1285
bind pub - !slo setver_los
 
1286
 
 
1287
proc setver_los {nick uhost hand channel arg} {
 
1288
    global botnick chan bibver
 
1289
    set bibver LO
 
1290
    pub_lookups $nick $uhost $hand $channel $arg
 
1291
}
 
1292
 
 
1293
bind pub - !smaori setver_maoris
 
1294
 
 
1295
proc setver_maoris {nick uhost hand channel arg} {
 
1296
    global botnick chan bibver
 
1297
    set bibver Mao
 
1298
    pub_lookups $nick $uhost $hand $channel $arg
 
1299
}
 
1300
 
 
1301
bind pub - !smkjv setver_mkjvs
 
1302
 
 
1303
proc setver_mkjvs {nick uhost hand channel arg} {
 
1304
    global botnick chan bibver
 
1305
    set bibver MKJV
 
1306
    pub_lookups $nick $uhost $hand $channel $arg
 
1307
}
 
1308
 
 
1309
bind pub - !snkjv setver_nkjvs
 
1310
 
 
1311
proc setver_nkjvs {nick uhost hand channel arg} {
 
1312
    global botnick chan bibver
 
1313
    set bibver NKJV
 
1314
    pub_lookups $nick $uhost $hand $channel $arg
 
1315
}
 
1316
 
 
1317
bind pub - !sceb setver_cebs
 
1318
bind pub - !sfilipino setver_cebs
 
1319
 
 
1320
proc setver_cebs {nick uhost hand channel arg} {
 
1321
    global botnick chan bibver
 
1322
    set bibver PhiCeb
 
1323
    pub_lookups $nick $uhost $hand $channel $arg
 
1324
}
 
1325
 
 
1326
bind pub - !srwebster setver_rwebsters
 
1327
 
 
1328
proc setver_rwebsters {nick uhost hand channel arg} {
 
1329
    global botnick chan bibver
 
1330
    set bibver RWebster
 
1331
    pub_lookups $nick $uhost $hand $channel $arg
 
1332
}
 
1333
 
 
1334
bind pub - !srv setver_rvs
 
1335
 
 
1336
proc setver_rvs {nick uhost hand channel arg} {
 
1337
    global botnick chan bibver
 
1338
    set bibver SpaRV
 
1339
    pub_lookups $nick $uhost $hand $channel $arg
 
1340
}
 
1341
 
 
1342
bind pub - !sturkish setver_turkishs
 
1343
 
 
1344
proc setver_turkishs {nick uhost hand channel arg} {
 
1345
    global botnick chan bibver
 
1346
    set bibver Turkish
 
1347
    pub_lookups $nick $uhost $hand $channel $arg
 
1348
}
 
1349
 
 
1350
bind pub - !suma setver_umas
 
1351
 
 
1352
proc setver_umas {nick uhost hand channel arg} {
 
1353
    global botnick chan bibver
 
1354
    set bibver Uma
 
1355
    pub_lookups $nick $uhost $hand $channel $arg
 
1356
}
 
1357
 
 
1358
bind pub - !svulgate setver_vulgates
 
1359
bind pub - !svulg setver_vulgates
 
1360
bind pub - !slatin setver_vulgates
 
1361
 
 
1362
proc setver_vulgates {nick uhost hand channel arg} {
 
1363
    global botnick chan bibver
 
1364
    set bibver Vulgate
 
1365
    pub_lookups $nick $uhost $hand $channel $arg
 
1366
}
 
1367
 
 
1368
bind pub - !snasb95 setver_nasb95s
 
1369
bind pub - !snas95 setver_nasb95s
 
1370
bind pub - !snau setver_nasb95s
 
1371
 
 
1372
proc setver_nasb95s {nick uhost hand channel arg} {
 
1373
    global botnick chan bibver
 
1374
    set bibver NASB95
 
1375
    pub_lookups $nick $uhost $hand $channel $arg
 
1376
}
 
1377
 
 
1378
bind pub - !snivbr setver_nivbrs
 
1379
bind pub - !snib setver_nivbrs
 
1380
 
 
1381
proc setver_nivbrs {nick uhost hand channel arg} {
 
1382
    global botnick chan bibver
 
1383
    set bibver NIVBr
 
1384
    pub_lookups $nick $uhost $hand $channel $arg
 
1385
}
 
1386
 
 
1387
bind pub - !snlt setver_nlts
 
1388
 
 
1389
proc setver_nlts {nick uhost hand channel arg} {
 
1390
    global botnick chan bibver
 
1391
    set bibver NLT
 
1392
    pub_lookups $nick $uhost $hand $channel $arg
 
1393
}
 
1394
 
 
1395
bind pub - !snrsv setver_nrsvs
 
1396
 
 
1397
proc setver_nrsvs {nick uhost hand channel arg} {
 
1398
    global botnick chan bibver
 
1399
    set bibver NRSV
 
1400
    pub_lookups $nick $uhost $hand $channel $arg
 
1401
}
 
1402
 
 
1403
bind pub - !sneg setver_negs
 
1404
 
 
1405
proc setver_negs {nick uhost hand channel arg} {
 
1406
    global botnick chan bibver
 
1407
    set bibver FreNEG
 
1408
    pub_lookups $nick $uhost $hand $channel $arg
 
1409
}
 
1410
 
 
1411
bind pub - !slnd setver_lnds
 
1412
 
 
1413
proc setver_lnds {nick uhost hand channel arg} {
 
1414
    global botnick chan bibver
 
1415
    set bibver ItaLND
 
1416
    pub_lookups $nick $uhost $hand $channel $arg
 
1417
}
 
1418
 
 
1419
bind pub - !smel setver_mels
 
1420
bind pub - !smelanesian setver_mels
 
1421
 
 
1422
proc setver_mels {nick uhost hand channel arg} {
 
1423
    global botnick chan bibver
 
1424
    set bibver Mel
 
1425
    pub_lookups $nick $uhost $hand $channel $arg
 
1426
}
 
1427
 
 
1428
bind pub - !snorsk setver_norsks
 
1429
 
 
1430
proc setver_norsks {nick uhost hand channel arg} {
 
1431
    global botnick chan bibver
 
1432
    set bibver Norsk
 
1433
    pub_lookups $nick $uhost $hand $channel $arg
 
1434
}
 
1435
 
 
1436
bind pub - !scor setver_cors
 
1437
 
 
1438
proc setver_cors {nick uhost hand channel arg} {
 
1439
    global botnick chan bibver
 
1440
    set bibver RomCor
 
1441
    pub_lookups $nick $uhost $hand $channel $arg
 
1442
}
 
1443
 
 
1444
bind pub - !slba setver_lbas
 
1445
 
 
1446
proc setver_lbas {nick uhost hand channel arg} {
 
1447
    global botnick chan bibver
 
1448
    set bibver SpaLBA
 
1449
    pub_lookups $nick $uhost $hand $channel $arg
 
1450
}
 
1451
 
 
1452
bind pub - !sbyz setver_byzs
 
1453
 
 
1454
proc setver_byzs {nick uhost hand channel arg} {
 
1455
    global botnick chan bibver
 
1456
    set bibver ByzX
 
1457
    pub_lookups $nick $uhost $hand $channel $arg
 
1458
}
 
1459
 
 
1460
bind pub - !slxx setver_lxxs
 
1461
 
 
1462
proc setver_lxxs {nick uhost hand channel arg} {
 
1463
    global botnick chan bibver
 
1464
    set bibver LXXX
 
1465
    pub_lookups $nick $uhost $hand $channel $arg
 
1466
}
 
1467
 
 
1468
bind pub - !sna26 setver_na26s
 
1469
bind pub - !sgreek setver_na26s
 
1470
 
 
1471
proc setver_na26s {nick uhost hand channel arg} {
 
1472
    global botnick chan bibver
 
1473
    set bibver NA26X
 
1474
    pub_lookups $nick $uhost $hand $channel $arg
 
1475
}
 
1476
 
 
1477
bind pub - !sscrivner setver_scrivners
 
1478
 
 
1479
proc setver_scrivners {nick uhost hand channel arg} {
 
1480
    global botnick chan bibver
 
1481
    set bibver ScrivnerX
 
1482
    pub_lookups $nick $uhost $hand $channel $arg
 
1483
}
 
1484
 
 
1485
bind pub - !sstephanus setver_stephanuss
 
1486
 
 
1487
proc setver_stephanuss {nick uhost hand channel arg} {
 
1488
    global botnick chan bibver
 
1489
    set bibver StephanusX
 
1490
    pub_lookups $nick $uhost $hand $channel $arg
 
1491
}
 
1492
 
 
1493
bind pub - !stischendorf setver_tischs
 
1494
bind pub - !stisch setver_tischs
 
1495
 
 
1496
proc setver_tischs {nick uhost hand channel arg} {
 
1497
    global botnick chan bibver
 
1498
    set bibver TischX
 
1499
    pub_lookups $nick $uhost $hand $channel $arg
 
1500
}
 
1501
 
 
1502
bind pub - !swh setver_whs
 
1503
 
 
1504
proc setver_whs {nick uhost hand channel arg} {
 
1505
    global botnick chan bibver
 
1506
    set bibver WHX
 
1507
    pub_lookups $nick $uhost $hand $channel $arg
 
1508
}
 
1509
 
 
1510
bind pub - !swhnu setver_whnus
 
1511
 
 
1512
proc setver_whnus {nick uhost hand channel arg} {
 
1513
    global botnick chan bibver
 
1514
    set bibver WHNUX
 
1515
    pub_lookups $nick $uhost $hand $channel $arg
 
1516
}
 
1517
 
 
1518
bind pub - !sgrkbyz setver_grkbyzs
 
1519
 
 
1520
proc setver_grkbyzs {nick uhost hand channel arg} {
 
1521
    global botnick chan bibver
 
1522
    set bibver Byz
 
1523
    pub_lookups $nick $uhost $hand $channel $arg
 
1524
}
 
1525
 
 
1526
bind pub - !sgrklxx setver_grklxxs
 
1527
 
 
1528
proc setver_grklxxs {nick uhost hand channel arg} {
 
1529
    global botnick chan bibver
 
1530
    set bibver LXX
 
1531
    pub_lookups $nick $uhost $hand $channel $arg
 
1532
}
 
1533
 
 
1534
bind pub - !sgrkna26 setver_grkna26s
 
1535
bind pub - !sgrkgreek setver_na26s
 
1536
 
 
1537
proc setver_grkna26s {nick uhost hand channel arg} {
 
1538
    global botnick chan bibver
 
1539
    set bibver NA26
 
1540
    pub_lookups $nick $uhost $hand $channel $arg
 
1541
}
 
1542
 
 
1543
bind pub - !sgrkscrivner setver_grkscrivners
 
1544
 
 
1545
proc setver_grkscrivners {nick uhost hand channel arg} {
 
1546
    global botnick chan bibver
 
1547
    set bibver Scrivner
 
1548
    pub_lookups $nick $uhost $hand $channel $arg
 
1549
}
 
1550
 
 
1551
bind pub - !sgrkstephanus setver_grkstephanuss
 
1552
 
 
1553
proc setver_grkstephanuss {nick uhost hand channel arg} {
 
1554
    global botnick chan bibver
 
1555
    set bibver Stephanus
 
1556
    pub_lookups $nick $uhost $hand $channel $arg
 
1557
}
 
1558
 
 
1559
bind pub - !sgrktischendorf setver_grktischs
 
1560
bind pub - !sgrktisch setver_grktischs
 
1561
 
 
1562
proc setver_grktischs {nick uhost hand channel arg} {
 
1563
    global botnick chan bibver
 
1564
    set bibver Tisch
 
1565
    pub_lookups $nick $uhost $hand $channel $arg
 
1566
}
 
1567
 
 
1568
bind pub - !sgrkwh setver_grkwhs
 
1569
 
 
1570
proc setver_grkwhs {nick uhost hand channel arg} {
 
1571
    global botnick chan bibver
 
1572
    set bibver WH
 
1573
    pub_lookups $nick $uhost $hand $channel $arg
 
1574
}
 
1575
 
 
1576
bind pub - !sgrkwhnu setver_grkwhnus
 
1577
 
 
1578
proc setver_grkwhnus {nick uhost hand channel arg} {
 
1579
    global botnick chan bibver
 
1580
    set bibver WHNU
 
1581
    pub_lookups $nick $uhost $hand $channel $arg
 
1582
}
 
1583
 
 
1584
bind pub - !sbhs setver_bhss
 
1585
bind pub - !shebrew setver_bhss
 
1586
 
 
1587
proc setver_bhss {nick uhost hand channel arg} {
 
1588
    global botnick chan bibver
 
1589
    set bibver BHS
 
1590
    pub_lookups $nick $uhost $hand $channel $arg
 
1591
}
 
1592
 
 
1593
bind pub - !srst setver_rsts
 
1594
 
 
1595
proc setver_rsts {nick uhost hand channel arg} {
 
1596
    global botnick chan bibver
 
1597
    set bibver RST
 
1598
    pub_lookups $nick $uhost $hand $channel $arg
 
1599
}
 
1600
 
 
1601
bind pub - !sukrainian setver_ukrainians
 
1602
 
 
1603
proc setver_ukrainians {nick uhost hand channel arg} {
 
1604
    global botnick chan bibver
 
1605
    set bibver Ukrainian
 
1606
    pub_lookups $nick $uhost $hand $channel $arg
 
1607
}
 
1608
 
 
1609
bind pub - !sarabic setver_arabics
 
1610
 
 
1611
proc setver_arabics {nick uhost hand channel arg} {
 
1612
    global botnick chan bibver
 
1613
    set bibver Arabic
 
1614
    pub_lookups $nick $uhost $hand $channel $arg
 
1615
}
 
1616
 
 
1617
bind pub - !sn27u4 setver_n27u4s
 
1618
bind pub - !snu setver_n27u4s
 
1619
bind pub - !sbgreek setver_n27u4s
 
1620
 
 
1621
proc setver_n27u4s {nick uhost hand channel arg} {
 
1622
    global botnick chan bibver
 
1623
    set bibver N27U4
 
1624
    pub_lookups $nick $uhost $hand $channel $arg
 
1625
}
 
1626
 
 
1627
bind pub - !sumgreek setver_ukgreeks
 
1628
 
 
1629
proc setver_umgreeks {nick uhost hand channel arg} {
 
1630
    global botnick chan bibver
 
1631
    set bibver UMGreek
 
1632
    pub_lookups $nick $uhost $hand $channel $arg
 
1633
}
 
1634
 
 
1635
bind pub - !sviet setver_viets
 
1636
bind pub - !svietnamese setver_viets
 
1637
 
 
1638
proc setver_viets {nick uhost hand channel arg} {
 
1639
    global botnick chan bibver
 
1640
    set bibver Viet
 
1641
    pub_lookups $nick $uhost $hand $channel $arg
 
1642
}
 
1643
 
 
1644
#----------------------------------------------------------------------
 
1645
 
 
1646
 
 
1647
proc publookupdict {vlookup} {
 
1648
    global botnick chan bibver diatheke
 
1649
    catch {exec $diatheke -f plaintext -b $bibver -k "$vlookup" >& /tmp/fooout.$botnick}
 
1650
    catch {set foofile [open /tmp/fooout.$botnick]}
 
1651
 
 
1652
    while {[gets $foofile fooverse] >= 0} {
 
1653
        putmsg $chan "$fooverse"
 
1654
    }
 
1655
    catch {close $foofile}
 
1656
  #  exec rm /tmp/fooout.$botnick
 
1657
    return 1
 
1658
}
 
1659
 
 
1660
 
 
1661
proc pub_lookupd {nick uhost hand channel arg} {
 
1662
    global von chan bibver
 
1663
    set chan $channel
 
1664
    if {$von==0} {
 
1665
        putmsg $nick "Verse display is currently off."
 
1666
        return 0
 
1667
    }
 
1668
    if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $chan])} {
 
1669
        putmsg $nick "Sorry, only ops and voiced users can use dictionaries and indices right now."
 
1670
        return 0
 
1671
    }
 
1672
    if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} {
 
1673
        putmsg $nick "Sorry, only ops can use dictionaries and indices right now."
 
1674
        return 0
 
1675
    }
 
1676
    
 
1677
    publookupdict $arg
 
1678
}
 
1679
 
 
1680
bind pub - !losung setver_losung
 
1681
 
 
1682
proc setver_losung {nick uhost hand channel arg} {
 
1683
    global botnick chan bibver
 
1684
    set bibver losung_en_99
 
1685
    set arg [exec date "+%m.%d"]
 
1686
    pub_lookupd $nick $uhost $hand $channel $arg
 
1687
}
 
1688
 
 
1689
bind pub - !vines setver_vines
 
1690
 
 
1691
proc setver_vines {nick uhost hand channel arg} {
 
1692
    global botnick chan bibver
 
1693
    set bibver Vines
 
1694
    pub_lookupd $nick $uhost $hand $channel $arg
 
1695
}
 
1696
 
 
1697
bind pub - !naves setver_naves
 
1698
 
 
1699
proc setver_naves {nick uhost hand channel arg} {
 
1700
    global botnick chan bibver
 
1701
    set bibver Naves
 
1702
    pub_lookupd $nick $uhost $hand $channel $arg
 
1703
}
 
1704
 
 
1705
bind pub - !eastons setver_eastons
 
1706
 
 
1707
proc setver_eastons {nick uhost hand channel arg} {
 
1708
    global botnick chan bibver
 
1709
    set bibver Eastons
 
1710
    pub_lookupd $nick $uhost $hand $channel $arg
 
1711
}
 
1712
 
 
1713
bind pub - !strheb setver_strheb
 
1714
 
 
1715
proc setver_strheb {nick uhost hand channel arg} {
 
1716
    global botnick chan bibver
 
1717
    set bibver StrongsHebrew
 
1718
    pub_lookupd $nick $uhost $hand $channel $arg
 
1719
}
 
1720
 
 
1721
bind pub - !strgrk setver_strgrk
 
1722
 
 
1723
proc setver_strgrk {nick uhost hand channel arg} {
 
1724
    global botnick chan bibver
 
1725
    set bibver StrongsGreek
 
1726
    pub_lookupd $nick $uhost $hand $channel $arg
 
1727
}
 
1728
 
 
1729
bind pub - !bdb setver_bdb
 
1730
 
 
1731
proc setver_bdb {nick uhost hand channel arg} {
 
1732
    global botnick chan bibver
 
1733
    set bibver BDB
 
1734
    pub_lookupd $nick $uhost $hand $channel $arg
 
1735
}
 
1736
 
 
1737
bind pub - !thayer setver_thayer
 
1738
 
 
1739
proc setver_thayer {nick uhost hand channel arg} {
 
1740
    global botnick chan bibver
 
1741
    set bibver Thayer
 
1742
    pub_lookupd $nick $uhost $hand $channel $arg
 
1743
}
 
1744
 
 
1745
bind pub - !hitch setver_hitch
 
1746
 
 
1747
proc setver_hitch {nick uhost hand channel arg} {
 
1748
    global botnick chan bibver
 
1749
    set bibver Hitch
 
1750
    pub_lookupd $nick $uhost $hand $channel $arg
 
1751
}
 
1752
 
 
1753
bind pub - !isbe setver_isbe
 
1754
 
 
1755
proc setver_isbe {nick uhost hand channel arg} {
 
1756
    global botnick chan bibver
 
1757
    set bibver ISBE
 
1758
    pub_lookupd $nick $uhost $hand $channel $arg
 
1759
}
 
1760
 
 
1761
bind pub - !smiths setver_smiths
 
1762
 
 
1763
proc setver_smiths {nick uhost hand channel arg} {
 
1764
    global botnick chan bibver
 
1765
    set bibver Smiths
 
1766
    pub_lookupd $nick $uhost $hand $channel $arg
 
1767
}
 
1768
 
 
1769
bind pub - !torrey setver_torrey
 
1770
 
 
1771
proc setver_torrey {nick uhost hand channel arg} {
 
1772
    global botnick chan bibver
 
1773
    set bibver Torrey
 
1774
    pub_lookupd $nick $uhost $hand $channel $arg
 
1775
}
 
1776
 
 
1777
#----------------------------------------------------------------------
 
1778
 
 
1779
proc publookupcomm {vlookup} {
 
1780
    global botnick chan bibver diatheke
 
1781
    catch {exec $diatheke -c $bibver "$vlookup" >& /tmp/fooout.$botnick}
 
1782
    catch {set foofile [open /tmp/fooout.$botnick]}
 
1783
    while {[gets $foofile fooverse] >= 0} {
 
1784
        set len [string length $fooverse]
 
1785
        set i 0
 
1786
        set j 72
 
1787
        while {$j < $len} {
 
1788
            while {[string index $fooverse $j] != " " && [string index $fooverse $j] != "\n"} {set j [expr $j + 1]}
 
1789
            set foo2 [string range $fooverse $i $j]
 
1790
            set foo2 [string trim $foo2]
 
1791
            regsub -all -nocase {(<FI>|<CM>|<FB>)} $foo2 {} foo2
 
1792
            regsub -all {<RF>} $foo2 {(footnote: } foo2
 
1793
            regsub -all {<Rf>} $foo2 {)} foo2
 
1794
            putmsg $chan "$foo2"
 
1795
            set i [expr $j + 1]
 
1796
            set j [expr $j + 73]
 
1797
            if {$j > $len} {set j $len}
 
1798
        }
 
1799
        set foo2 [string range $fooverse $i end]
 
1800
        set foo2 [string trim $foo2]
 
1801
        regsub -all -nocase {(<FI>|<CM>|<FB>)} $foo2 {} foo2
 
1802
        regsub -all {<RF>} $foo2 {(footnote: } foo2
 
1803
        regsub -all {<Rf>} $foo2 {)} foo2
 
1804
        putmsg $chan "$foo2"
 
1805
    }
 
1806
    catch {close $foofile}
 
1807
    exec rm /tmp/fooout.$botnick
 
1808
    return 1
 
1809
}
 
1810
 
 
1811
 
 
1812
proc pub_lookupc {nick uhost hand channel arg} {
 
1813
    global von chan bibver
 
1814
    set chan $channel
 
1815
    if {$von==0} {
 
1816
        putmsg $nick "Verse display is currently off."
 
1817
        return 0
 
1818
    }
 
1819
    if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $chan])} {
 
1820
        putmsg $nick "Sorry, only ops and voiced users can use commentaries right now."
 
1821
        return 0
 
1822
    }
 
1823
    if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} {
 
1824
        putmsg $nick "Sorry, only ops can use commentaries right now."
 
1825
        return 0
 
1826
    }
 
1827
 
 
1828
    publookupcomm $arg
 
1829
}
 
1830
 
 
1831
bind pub - !rwp setver_rwp
 
1832
 
 
1833
proc setver_rwp {nick uhost hand channel arg} {
 
1834
    global botnick chan bibver
 
1835
    set bibver RWP
 
1836
    pub_lookupc $nick $uhost $hand $channel $arg
 
1837
}
 
1838
 
 
1839
bind pub - !mhc setver_mhc
 
1840
 
 
1841
proc setver_mhc {nick uhost hand channel arg} {
 
1842
    global botnick chan bibver
 
1843
    set bibver MHC
 
1844
    pub_lookupc $nick $uhost $hand $channel $arg
 
1845
}
 
1846
 
 
1847
bind pub - !dtn setver_dtn
 
1848
 
 
1849
proc setver_dtn {nick uhost hand channel arg} {
 
1850
    global botnick chan bibver
 
1851
    set bibver DTN
 
1852
    pub_lookupc $nick $uhost $hand $channel $arg
 
1853
}
 
1854
 
 
1855
bind pub - !family setver_family
 
1856
 
 
1857
proc setver_family {nick uhost hand channel arg} {
 
1858
    global botnick chan bibver
 
1859
    set bibver Family
 
1860
    pub_lookupc $nick $uhost $hand $channel $arg
 
1861
}
 
1862
 
 
1863
bind pub - !geneva setver_geneva
 
1864
 
 
1865
proc setver_geneva {nick uhost hand channel arg} {
 
1866
    global botnick chan bibver
 
1867
    set bibver Geneva
 
1868
    pub_lookupc $nick $uhost $hand $channel $arg
 
1869
}
 
1870
 
 
1871
bind pub - !gill setver_gill
 
1872
 
 
1873
proc setver_gill {nick uhost hand channel arg} {
 
1874
    global botnick chan bibver
 
1875
    set bibver Gill
 
1876
    pub_lookupc $nick $uhost $hand $channel $arg
 
1877
}
 
1878
 
 
1879
bind pub - !pnt setver_pnt
 
1880
 
 
1881
proc setver_pnt {nick uhost hand channel arg} {
 
1882
    global botnick chan bibver
 
1883
    set bibver PNT
 
1884
    pub_lookupc $nick $uhost $hand $channel $arg
 
1885
}
 
1886
 
 
1887
bind pub - !tfg setver_tfg
 
1888
 
 
1889
proc setver_tfg {nick uhost hand channel arg} {
 
1890
    global botnick chan bibver
 
1891
    set bibver TFG
 
1892
    pub_lookupc $nick $uhost $hand $channel $arg
 
1893
}
 
1894
 
 
1895
bind pub - !tsk setver_tsk
 
1896
 
 
1897
proc setver_tsk {nick uhost hand channel arg} {
 
1898
    global botnick chan bibver
 
1899
    set bibver TSK
 
1900
    pub_lookupc $nick $uhost $hand $channel $arg
 
1901
}
 
1902
 
 
1903
bind pub - !wesley setver_wesley
 
1904
 
 
1905
proc setver_wesley {nick uhost hand channel arg} {
 
1906
    global botnick chan bibver
 
1907
    set bibver Wesley
 
1908
    pub_lookupc $nick $uhost $hand $channel $arg
 
1909
}
 
1910
 
 
1911
#----------------------------------------------------------------------
 
1912
 
 
1913
bind pub - !dict dictlookup
 
1914
 
 
1915
proc dictlookup {nick uhost hand channel arg} {
 
1916
    global botnick von dict
 
1917
    
 
1918
    if {$von==0} {
 
1919
        putmsg $nick "Verse display is currently off."
 
1920
        return 0
 
1921
    }
 
1922
    if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $channel])}  {
 
1923
        putmsg $nick "Sorry, only ops and voiced users can use dictionaries and indices right now."
 
1924
        return 0
 
1925
    }
 
1926
    if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} {
 
1927
        putmsg $nick "Only ops can use dictionaries and indices right now."
 
1928
        return 0
 
1929
    }
 
1930
    
 
1931
    catch {exec $dict "$arg" >& /tmp/fooout.$botnick}
 
1932
    catch {set foofile [open /tmp/fooout.$botnick]}
 
1933
    catch {set fooverse [gets $foofile]}
 
1934
    while {[gets $foofile fooverse] >= 0} {
 
1935
        set fooverse [string trim $fooverse]
 
1936
        putmsg $channel "$fooverse"
 
1937
    }
 
1938
    catch {close $foofile}
 
1939
    exec rm /tmp/fooout.$botnick
 
1940
    return 1
 
1941
}
 
1942
 
 
1943
#----------------------------------------------------------------------
 
1944
 
 
1945
bind pub - !biblehelp pub_help
 
1946
bind msg - biblehelp pub_help
 
1947
 
 
1948
proc pub_help {nick uhost hand channel arg} {
 
1949
    global diaver
 
1950
    global von
 
1951
    putserv "NOTICE $nick :Diatheke/Tcl BibleBot version $diaver"
 
1952
 
 
1953
    if {(($von==0) || ($von==2)) && (![matchattr $hand 3]) && (![matchattr $hand o])} {
 
1954
        putserv "NOTICE $nick :BibleBot displays are currently turned off."
 
1955
        return 1
 
1956
    }
 
1957
 
 
1958
    putserv "NOTICE $nick :Supported commands:"
 
1959
    putserv "NOTICE $nick :Help, using \"!biblehelp\""
 
1960
    putserv "NOTICE $nick :Book list, using \"!books\" (it's long)"
 
1961
# Uncomment the next line if you have turned LOGGING on in diatheke to enable
 
1962
# the history function.
 
1963
#    putserv "NOTICE $nick :See last 5 calls to BibleBot, using \"!history\""
 
1964
    putserv "NOTICE $nick :Check display status, using \"!status\""
 
1965
    putserv "NOTICE $nick :Bible lookups, using \"!<bible version> <book> <chapter>:<verse>\""
 
1966
    putserv "NOTICE $nick :verse ranges can be specified by adding \"-<last verse>\" to this"
 
1967
    putserv "NOTICE $nick :To turn Strong's numbers and/or footnotes on, use @ and/or # respectively before the book name.  For example \"!kjv @#Gen 1:4\" will retrieve Genesis 1:3 with the Strong's numbers and footnotes associated with it."
 
1968
 
 
1969
    if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $channel])}  {
 
1970
        return 1
 
1971
    }
 
1972
 
 
1973
    putserv "NOTICE $nick :Commentary lookups, using \"!<commentary> <book> <chapter>:<verse>\""
 
1974
    putserv "NOTICE $nick :Dictionary/index lookups, using \"!<dictionary> <word or number>\""
 
1975
    putserv "NOTICE $nick :Bible searches, using \"!s<bible version> <word>\""
 
1976
    putserv "NOTICE $nick :Diatheke/Tcl defaults to PHRASE search mode.  To use MULTI-WORD search mode, preface your search with an @.  To use REGEX mode, preface your search with a #.  For example: \"!skjv @Jesus love\" will print a list of all verses in the KJV containing the words Jesus and love."
 
1977
 
 
1978
    if {(![matchattr $hand 3]) && (![matchattr $hand o])}  {
 
1979
        return 1
 
1980
    }
 
1981
 
 
1982
    putserv "NOTICE $nick :To turn verse display off, use \"!verseoff\""
 
1983
    putserv "NOTICE $nick :To turn all displays on for all users, use \"!verseon\""
 
1984
    putserv "NOTICE $nick :To turn all displays on for ops only, use \"!verseon o\""
 
1985
    putserv "NOTICE $nick :To turn verse diaplays on for regular users and all other displays on for ops and voiced users only, use \"!verseon v\" (default)"
 
1986
}
 
1987
 
 
1988
bind pub - !books pub_books
 
1989
bind msg - books pub_books
 
1990
 
 
1991
proc pub_books {nick uhost hand channel arg} {
 
1992
    global von
 
1993
 
 
1994
    if {(($von==0) || ($von==2)) && (![matchattr $hand 3]) && (![matchattr $hand o])} {
 
1995
        putserv "NOTICE $nick :BibleBot displays are currently turned off."
 
1996
        return 1
 
1997
    }
 
1998
 
 
1999
    putserv "NOTICE $nick :English language Bibles (26):"
 
2000
    putserv "NOTICE $nick :Ameican Standard Version (!asv), Analytical Literal Translation (!alt), Bible in Basic English (!bbe), Darby (!dby), Douay-Rheims Bible (!dr), Green's Literal Translation (!litv), Green's Modern King James Version (!mkjv), Hebrew Names Version (!hnv), Jewish Publication Society 1917 (!jps), King James Version (!kjv), The Living Oracles NT (!lo),"
 
2001
    putserv "NOTICE $nick :New American Standard Bible (!nasb), New American Standard Bible, 95 Update (!nasb95), New International Version (!niv), New Internation Version, British Edition (!nivbr), New King James Version (!nkjv), New Living Translation (!nlt), New Revised Standard Version (!nrsv), Orthodox Jewish Brit ChadashaNT only (!jbc),"
 
2002
    putserv "NOTICE $nick :Revised Standard Version (!rsv), Revised 1833 Webster's (!rwebster), World English Bible (!web), Webster's (!webster), Weymouth NT (!wey), Young's Literal Translation (!ylt), 21st Century King James Version (!kj21)"
 
2003
    putserv "NOTICE $nick :Non-English language Bibles (39):"
 
2004
    putserv "NOTICE $nick :Albanian Bible (!alb), Chinese GNPU (!gnpu), Danish Bible (!dan), Dutch Leidse Vertaling (!lei), Dutch Lutherse Vertaling (!lu), Dutch Statemvertaling (!svv), Equadoran Shuar NT (!shr), Filipino Nga Cebuano (!ceb),  Finnish Pyhz Raamattu (!pr), French Louis Segond Version (!lsg), French Haitian Creole Version (!crl), French Darby's Version (!fredrb),"
 
2005
    putserv "NOTICE $nick :French Nouvelle Edition de Geneve (!neg), German Luther Version (!lut), German Schlachter (!sch), German Bengel NT (!ben), German Elberfelder Version (!elb), Hungarian Karoli (!kar), Indonesian Bahasa Indonesia Sehari-hari (!bis), Indonesian Terjemahan Baru (!tb), Italian La Nouva Diodati (!lnd), Italian La Sacra Bibbia Nuova Riveduta (!nrv),"
 
2006
    putserv "NOTICE $nick :Maori Bible (!maori), Melanesian Pidgin Bible (!mel), Norsk Bible (!norsk), Portuguese A Biblia Sagrada Traduzida em Portugues (!brp), Spanish La Biblia de Las Americas (!lba), Spanish Reina-Valera Actualizada (!rva), Spanish Reina-Valera (!rv), Spanish Sagradas Escrituras (!sev), Spanish Valera NT only (!vnt), Swahili NT (!swahili),"
 
2007
    putserv "NOTICE $nick :Swedish 1917 Bible NT only (!sve), Turkish NT (!turkish), Uma NT (!uma)"
 
2008
    putserv "NOTICE $nick :Original Language Bibles (18): (NB, /'s divide transliterated/non-roman versions)"
 
2009
    putserv "NOTICE $nick :1991 Byzantine/Majority Text (!byz/!grkbyz), Nestle-Aland 26th/27th Ed. (!na26/!grkna26), 1894 Scrivner Textus Receptus (!scrivner/!grkscrivner), 1550 Stephanus Textus Receptus (!stephanus/!grkstephanus), Tischendorf' 8th Ed. GNT (!tisch/!grktisch), 1881 Westcott-Hort GNT (!wh/!grkwh), 1881 Westcott-Hort with NA26 alternate readings (!whnu/!grkwhnu)"
 
2010
    putserv "NOTICE $nick: Nestle-Aland 27th Ed./UBS 4th Ed. (!n27u4), Septuagint/LXX (!lxx/!grklxx), Biblia Hebraica Stuttgartensia in Hebrew font (!bhs), Jerome's Latin Vulgate (!vulg)"
 
2011
    putserv "NOTICE $nick :Non-Roman character Bibles (5):"
 
2012
    putserv "NOTICE $nick :Arabic Bible (!arabic), Russian Synodal Translation (!rst), Ukrainian Bible (!ukrainian), Unaccented Modern Greek Bible (!umgreek), Vietnamese Bible (!viet)"
 
2013
 
 
2014
    if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $channel])}  {
 
2015
        return 1
 
2016
    }
 
2017
 
 
2018
    putserv "NOTICE $nick :Dictionaries & Indices (12):"
 
2019
    putserv "NOTICE $nick :Webster's Dictionary (!dict), Vine's Bible Dictionary(!vines), Easton's Bible Dictionary (!eastons), Nave's Topical Bible (!naves), Smith's Bible Dictionary (!smiths), Hitchcock's Bible Names Dictionary (!hitch), International Standard Bible Dictionary (!isbe), Torrey's New Topical Textbook (!torrey), Strong's Hebrew Bible Dictionary (!strheb), Strong's Greek Bible Dictionary (!strgrk), Brown-Driver-Briggs Hebrew Lexicon (!bdb), Thayer's Greek Lexicon (!thayer)"
 
2020
    putserv "NOTICE $nick :Commentaries (10):"
 
2021
    putserv "NOTICE $nick :Darby's Translation Notes (!dtn), Family Bible Notes (!family), Geneva Bible Translation Notes (!geneva), John Gill's Expositor (!gill),  Matthew Henry's Concise (!mhc), The People's New Testament (!pnt), Robertson's Word Pictures (!rwp), The Fourfold Gospel (!tfg), Treasury of Scriptural Knowledge (!tsk), Wesley's Bible Notes (!wesley)"
 
2022
}
 
2023
 
 
2024
#----------------------------------------------------------------------
 
2025
 
 
2026
bind pub - !status pub_status
 
2027
bind msg - status pub_status
 
2028
 
 
2029
proc pub_status {nick uhost hand channel arg} {
 
2030
    global von
 
2031
    
 
2032
    if {$von==0} {
 
2033
        putserv "NOTICE $nick :All BibleBot displays are currently off."
 
2034
    } elseif {$von==1} {
 
2035
        putserv "NOTICE $nick :All BibleBot displays are currently on."
 
2036
    } elseif {$von==2} {
 
2037
        putserv "NOTICE $nick :All BibleBot displays are currently on for ops only."
 
2038
    } else {
 
2039
        putserv "NOTICE $nick :Verse displays are currently on for all users, but other BibleBot displays are currently restricted to ops and voiced users."
 
2040
    }
 
2041
    return 1
 
2042
}
 
2043
 
 
2044
 
 
2045
bind pub - !history pub_hist
 
2046
bind msg - history pub_hist
 
2047
 
 
2048
proc pub_hist {nick uhost hand channel arg} {
 
2049
    global botnick
 
2050
    catch {exec tail -n 5 /var/log/diatheke.log >& /tmp/fooout.$botnick}
 
2051
    catch {set foofile [open /tmp/fooout.$botnick]}
 
2052
    catch {set fooverse [gets $foofile]}
 
2053
    putserv "NOTICE $nick :Last 5 calls to Diatheke/Tcl BibleBot"
 
2054
    putserv "NOTICE $nick :$fooverse"
 
2055
    while {[gets $foofile fooverse] >= 0} {
 
2056
        putserv "NOTICE $nick :$fooverse"
 
2057
    }
 
2058
    catch {close $foofile}
 
2059
    exec rm /tmp/fooout.$botnick
 
2060
    return 1
 
2061
}
 
2062
 
 
2063
#---------------------------------------------------------------------
 
2064
 
 
2065
proc pub_verseon {nick uhost hand channel arg} {
 
2066
    global von
 
2067
    if {![matchattr $hand 3] && ![matchattr $hand o]} {
 
2068
        return 0
 
2069
    } elseif {$arg=="v"} {
 
2070
        set von 3
 
2071
#       putserv "NOTICE $nick :Long Text Display is now on for voiced only!"
 
2072
    } elseif {$arg=="o"} {
 
2073
        set von 2
 
2074
#       putserv "NOTICE $nick :Verse Display is now on for ops only!"
 
2075
    } else {
 
2076
        set von 1
 
2077
#       putserv "NOTICE $nick :All Display is now on!"
 
2078
    }
 
2079
    pub_status $nick $uhost $hand $channel $arg
 
2080
    return 1
 
2081
}
 
2082
bind pub - !verseon pub_verseon
 
2083
bind msg - verseon pub_verseon
 
2084
 
 
2085
proc pub_verseoff {nick uhost hand channel arg} {
 
2086
    global von
 
2087
    
 
2088
    if {![matchattr $hand 3] && ![matchattr $hand o]} {
 
2089
        return 0
 
2090
    }
 
2091
    set von 0
 
2092
#    putserv "NOTICE $nick :Verse Display is now off!"
 
2093
    pub_status $nick $uhost $hand $channel $arg
 
2094
    return 1
 
2095
}
 
2096
bind pub - !verseoff pub_verseoff
 
2097
bind msg - verseoff pub_verseoff
 
2098
 
 
2099
proc dcc_verseoff {hand idx arg} {
 
2100
    global von
 
2101
    global whovoff
 
2102
    if {![matchattr $hand 3] && ![matchattr $hand o]} {
 
2103
        return 0
 
2104
    }
 
2105
    set von 0
 
2106
    set whovoff $hand
 
2107
    return 1
 
2108
}
 
2109
bind dcc - verseoff dcc_verseoff
 
2110
 
 
2111
proc dcc_verseon {hand idx arg} {
 
2112
    global von
 
2113
    if {![matchattr $hand 3] && ![matchattr $hand o]} {
 
2114
        return 0
 
2115
    }
 
2116
    elseif {$arg=="v"} {
 
2117
        set von 3
 
2118
    }
 
2119
    elseif {$arg=="o"} {
 
2120
        set von 2
 
2121
    } else {
 
2122
        set von 1
 
2123
    }
 
2124
    return 1
 
2125
}
 
2126
bind dcc - verseon dcc_verseon
 
2127
 
 
2128
#sets default von mode
 
2129
set von 1
 
2130
 
 
2131
 
 
2132
 
 
2133
 
 
2134
 
 
2135
 
 
2136
 
 
2137
 
 
2138
 
 
2139
 
 
2140
 
 
2141
 
 
2142
 
 
2143
 
 
2144