Project

General

Profile

Scripting » History » Version 167

Per Amundsen, 08/02/2013 02:12 AM

1 167 Per Amundsen
h1. Scripting changes as of 1.9.1
2 39 Per Amundsen
3 166 Per Amundsen
h1. Implemented mIRC events so far:
4 1 Per Amundsen
5 166 Per Amundsen
<pre>
6
raw <numeric>:<matchtext>:<commands>
7 1 Per Amundsen
8 166 Per Amundsen
ctcp <level>:<matchtext>:<*|#|?>:<commands>
9 38 Per Amundsen
10 166 Per Amundsen
on 1:sockopen:name:commands
11 1 Per Amundsen
12 166 Per Amundsen
on 1:sockread:name:commands
13 1 Per Amundsen
14 166 Per Amundsen
on 1:socklisten:name:commands
15 1 Per Amundsen
16 166 Per Amundsen
on 1:sockclose:name:commands
17 149 Per Amundsen
18 1 Per Amundsen
on *:SIGNAL:name:command
19 167 Per Amundsen
20
on <level>:LOGON:*:<commands>
21 1 Per Amundsen
22 166 Per Amundsen
on <level>:DNS:<commands>
23 149 Per Amundsen
24 166 Per Amundsen
on <level>:CTCPREPLY:<matchtext>:<commands>
25 1 Per Amundsen
26 166 Per Amundsen
on <level>:OPEN|CLOSE:<?|@|=|!|*>:<matchtext>:<commands>
27 149 Per Amundsen
28 166 Per Amundsen
on <level>:ACTIVE:<*#?=!@>:<commands>
29 1 Per Amundsen
30 166 Per Amundsen
on <level>:HOTLINK:<matchtext>:<*#?=!@>:<commands>
31 1 Per Amundsen
32 166 Per Amundsen
on <level>:INVITE:<#[,#]>:<commands>
33 1 Per Amundsen
34 166 Per Amundsen
on <level>:TABCOMP:<*#?=!@>:<commands>
35 1 Per Amundsen
36 166 Per Amundsen
on <level>:WALLOPS:<matchtext>:<commands>
37 1 Per Amundsen
38 166 Per Amundsen
on <level>:ERROR:<matchtext>:<commands>
39 1 Per Amundsen
40 166 Per Amundsen
on <level>:RAWMODE:#:<commands>
41 1 Per Amundsen
42 166 Per Amundsen
on <level>:DEHELP:<#[,#]>:<commands>
43 1 Per Amundsen
44 166 Per Amundsen
on <level>:HELP:<#[,#]>:<commands>
45 1 Per Amundsen
46 166 Per Amundsen
on <level>:DEVOICE:<#[,#]>:<commands>
47 1 Per Amundsen
48 166 Per Amundsen
on <level>:VOICE:<#[,#]>:<commands>
49 1 Per Amundsen
50 166 Per Amundsen
on <level>:DEOP:<#[,#]>:<commands>
51 1 Per Amundsen
52 166 Per Amundsen
on <level>:OP:<#[,#]>:<commands>
53 1 Per Amundsen
54 166 Per Amundsen
on <level>:INPUT:<*#?=!@>:<commands>
55 1 Per Amundsen
56 166 Per Amundsen
on <level>:UNBAN:<#[,#]>:<commands>
57 1 Per Amundsen
58 166 Per Amundsen
on <level>:BAN:<#[,#]>:<commands>
59 149 Per Amundsen
60 166 Per Amundsen
on <level>:CHAT:<matchtext>:<commands>
61 1 Per Amundsen
62 166 Per Amundsen
on <level>:KICK:<#[,#]>:<commands>
63 1 Per Amundsen
64 166 Per Amundsen
on <level>:NOTIFY:<commands>
65 1 Per Amundsen
66 166 Per Amundsen
on <level>:UNNOTIFY:<commands>
67 1 Per Amundsen
68 166 Per Amundsen
on <level>:NICK:<commands>
69 1 Per Amundsen
70 166 Per Amundsen
on <level>:QUIT:<commands>
71 1 Per Amundsen
72 166 Per Amundsen
on <level>:LOAD:<commands>
73 1 Per Amundsen
74 166 Per Amundsen
on <level>:UNLOAD:<commands>'
75 1 Per Amundsen
76 166 Per Amundsen
on <level>:START:<commands>
77 1 Per Amundsen
78 166 Per Amundsen
on <level>:EXIT:<commands>
79 1 Per Amundsen
80 166 Per Amundsen
on <level>:DNS:<commands>
81 1 Per Amundsen
82 166 Per Amundsen
on <level>:CONNECTFAIL:<commands>
83 1 Per Amundsen
84 166 Per Amundsen
on <level>:CONNECT:<commands>
85 1 Per Amundsen
86 166 Per Amundsen
on <level>:DISCONNECT:<commands>
87 1 Per Amundsen
88 166 Per Amundsen
on <level>:TOPIC:<#[,#]>:<commands>
89 1 Per Amundsen
90 166 Per Amundsen
on <level>:USERMODE:<commands>
91 1 Per Amundsen
92 166 Per Amundsen
on <level>:MODE:<#[,#]>:<commands>
93 1 Per Amundsen
94 166 Per Amundsen
on <level>:PART:<#[,#]>:<commands>
95 1 Per Amundsen
96 166 Per Amundsen
on <level>:JOIN:<#[,#]>:<commands>
97 1 Per Amundsen
98 166 Per Amundsen
on <level>:SNOTICE:<matchtext>:<commands>
99 1 Per Amundsen
100 166 Per Amundsen
on <level>:NOTICE:<matchtext>:<*><?><#[,#]>:<commands>
101 1 Per Amundsen
102 166 Per Amundsen
on <level>:ACTION:<matchtext>:<*><?><#[,#]>:<commands>
103 1 Per Amundsen
104 166 Per Amundsen
on <level>:TEXT:<matchtext>:<*><?><#[,#]>:<commands>
105 1 Per Amundsen
106 166 Per Amundsen
This event is added as a replacement for OnSongChanged
107
on <level>:SONG:<commands>
108
109 1 Per Amundsen
</pre>
110
111 166 Per Amundsen
Supported prefixes so far are ^ to enable halt events (hide default text output from the event), ! to ignore events made by you, @ to only trigger if you have channel op, $ to indicate the wildcard text is a regular expression.
112 1 Per Amundsen
113 166 Per Amundsen
User access will come later. 
114 1 Per Amundsen
115 166 Per Amundsen
h1. Functions added so far
116
117 1 Per Amundsen
<pre>
118 166 Per Amundsen
$abs()
119
$acos()
120
$address()
121
$addtok()
122
$addtokcs()
123
$and()
124
$asc()
125
$asctime()
126
$asin()
127
$atan()
128
$audio()
129
$base()
130
$bfind()
131
$bindip()
132
$bitoff()
133
$biton()
134
$bvar()
135
$bytes()
136
$calc()
137
$cb()
138
$ceil()
139
$chan()
140
$char()
141
$chat()
142
$chr()
143
$color()
144
$colour()
145
$comchan()
146
$cos()
147
$count()
148
$countcs()
149
$crc()
150
$ctime()
151
$datediff()
152
$datematch()
153
$decode()
154
$decrypt()
155
$deltok()
156
$dialog()
157
$did()
158
$didreg()
159
$didtok()
160
$didwm()
161
$disk()
162
$diskmenu()
163
$dns()
164
$duration()
165
$editbox()
166
$encode()
167
$encodingmenu()
168
$encrypt()
169
$eval()
170
$exists()
171
$fdate()
172
$fgetc()
173
$file()
174
$fileexists()
175
$fileloop()
176
$filerandom()
177
$finddir()
178
$findfile()
179
$findtok()
180
$findtokcs()
181
$fline()
182
$floop()
183
$floor()
184
$fopen()
185
$formatdate()
186
$frand()
187
$fread()
188
$freadc()
189
$freadchar()
190
$getdir()
191
$getdot()
192
$gettok()
193
$gfx()
194
$gfxram()
195
$group()
196
$height()
197
$hfind()
198
$hget()
199
$host()
200
$ial()
201
$ialchan()
202
$ibl()
203
$ident()
204
$iel()
205
$ignore()
206
$iil()
207
$inellipse()
208
$ini()
209
$inpoly()
210
$input()
211
$inrect()
212
$insert()
213
$instok()
214
$int()
215
$invitemenu()
216
$isalias()
217
$isbit()
218
$isdir()
219
$isfile()
220
$isid()
221
$islower()
222
$istok()
223
$istokcs()
224
$istype()
225
$isupper()
226
$left()
227
$len()
228
$line()
229
$lines()
230
$log()
231
$longfn()
232
$longip()
233
$lower()
234
$mask()
235
$matchtok()
236
$matchtokcs()
237
$md5()
238
$mid()
239
$mkfn()
240
$mklogfn()
241
$mknickfn()
242
$mp3()
243
$msfile()
244
$nick()
245
$nofile()
246
$nopath()
247
$noqt()
248
$not()
249
$notify()
250
$numtok()
251
$or()
252
$ord()
253
$pic()
254
$portfree()
255
$pos()
256
$poscs()
257
$prop()
258
$puttok()
259
$qt()
260
$query()
261
$r()
262
$rand()
263
$read()
264
$readini()
265
$regex()
266
$regmatch()
267
$regml()
268
$regreplace()
269
$regsub()
270
$regsubex()
271
$remove()
272
$removecs()
273
$remtok()
274
$remtokcs()
275
$repeat()
276
$replace()
277
$replacecs()
278
$replacex()
279
$replacexcs()
280
$reptok()
281
$reptokcs()
282
$rgb()
283
$right()
284
$round()
285
$scid()
286
$scon()
287
$screen()
288
$screenb()
289
$screenh()
290
$screenw()
291
$script()
292
$sdir()
293
$server()
294
$sfile()
295
$sha1()
296
$shortfn()
297
$sin()
298
$slapsmenu()
299
$sline()
300
$snick()
301
$sock()
302
$sorttok()
303
$sorttokcs()
304
$sqrt()
305
$str()
306
$strip()
307
$style()
308
$substr()
309
$tan()
310
$time()
311
$timer()
312
$tip()
313
$toolbar()
314
$true()
315
$trust()
316
$upper()
317
$uptime()
318
$user()
319
$utfdecode()
320
$utfencode()
321
$var()
322
$vol()
323
$width()
324
$wildtok()
325
$wildtokcs()
326
$window()
327
$xor()
328 1 Per Amundsen
</pre>
329
330 166 Per Amundsen
h1. Variables added so far
331 1 Per Amundsen
332 166 Per Amundsen
<pre>
333
$0
334
$active
335
$activeserver
336
$activewid
337
$adate
338
$address
339
$adiircdir
340
$adiircexe
341
$adiircini
342
$album
343
$anick
344
$appactive
345
$appstate
346
$artist
347
$audio
348
$away
349
$awaymsg
350
$awaytime
351
$bitrate
352
$bwdown
353
$bwdownb
354
$bwname
355
$bwspeed
356
$bwup
357
$bwupb
358
$cb
359
$chan
360
$chanmodes
361
$channel
362
$chantypes
363
$cid
364
$clevel
365
$cmdline
366
$comment
367
$cpucache
368
$cpucount
369
$cpuident
370
$cpuload
371
$cpumhz
372
$cpuname
373
$cr
374
$crlf
375
$ctime
376
$date
377
$day
378
$daylight
379
$disk
380
$diskfree
381
$disktotal
382
$dlevel
383
$duration
384
$error
385
$event
386
$false
387
$feof
388
$ferr
389
$frequency
390
$fulladdress
391
$fulldate
392
$fulltitle
393
$genre
394
$getdir
395
$gfx
396
$gfxram
397
$gmt
398
$highlight
399
$host
400
$ial
401
$ident
402
$idle
403
$ignore
404
$inmidi
405
$inpaste
406
$insong
407
$inwave
408
$ip
409
$isid
410
$layer
411
$left
412
$length
413
$logdir
414
$logstamp
415
$logstampfmt
416
$lr
417
$ltimer
418
$maddress
419
$matchkey
420
$me
421
$memfree
422
$memfreep
423
$memtotal
424
$mircdir
425
$mircexec
426
$mircini
427
$mnick
428
$mode
429
$modespl
430
$motherboard
431
$mversion
432
$myhost
433
$myident
434
$network
435
$newnick
436
$nick
437
$now
438
$null
439
$numeric
440
$online
441
$os
442
$osbuild
443
$osedition
444
$osmajor
445
$osminor
446
$osname
447
$osservicepack
448
$osversion
449
$percentl
450
$percentp
451
$playcount
452
$player
453
$port
454
$position
455
$prefix
456
$progress
457
$r
458
$r0
459
$raw0
460
$rawbytes
461
$rawmsg
462
$result
463
$screen
464
$screenb
465
$screenh
466
$screenw
467
$script
468
$scriptdir
469
$scriptline
470
$server
471
$serverip
472
$show
473
$site
474
$size
475
$sockbr
476
$song
477
$status
478
$target
479
$ticks
480
$time
481
$timestamp
482
$timestampfmt
483
$timezone
484
$title
485
$totaltracks
486
$track
487
$true
488
$ulevel
489
$updays
490
$uphours
491
$upmins
492
$usermode
493
$version
494
$volume
495
$volumeb
496
$volumep
497
$wid
498
$wildsite
499
$window
500
$year
501
</pre>
502 149 Per Amundsen
503 166 Per Amundsen
Commands added so far
504
505
<pre>
506
/aclear
507
/action
508
/advertise
509
/ajinvite
510
/alias
511
/aline
512
/alphaup
513
/amark
514
/ame
515
/amsg
516
/anick
517
/aquit
518
/away
519
/back
520
/background
521
/ban
522
/banlist
523
/bcopy
524
/beep
525
/betaup
526
/bin2txt
527
/bindip
528
/bread
529
/break
530
/breplace
531
/bset
532
/btrunc
533
/bunset
534
/bwrite
535
/channel
536
/channelbar
537
/charset
538
/clear
539
/clearall
540
/clipboard
541
/close
542
/closefile
543
/color
544
/config
545
/continue
546
/ctcp
547
/ctcpreply
548
/cycle
549
/dcc
550
/debug
551
/dec
552
/dehalfop
553
/deop
554
/describe
555
/desop
556
/devoice
557
/dialog
558
/did
559
/didtok
560
/disable
561
/disconnect
562
/dns
563
/dop
564
/drawcopy
565
/drawdot
566
/drawfill
567
/drawline
568
/drawpic
569
/drawrect
570
/drawreplace
571
/drawsave
572
/drawscroll
573
/drawtext
574
/echo
575
/editbox
576
/enable
577
/encoding
578
/exec
579
/exit
580
/fakeraw
581
/fclose
582
/filter
583
/flist
584
/fopen
585
/fseek
586
/fwrite
587
/gcmem
588
/google
589
/google
590
/goto
591
/hadd
592
/halfop
593
/halt
594
/haltdef
595
/hdec
596
/hdel
597
/help
598
/hfree
599
/hinc
600
/hload
601
/hmake
602
/hop
603
/hsave
604
/ignore
605
/inc
606
/join
607
/kick
608
/kickban
609
/kill
610
/lag
611
/linesep
612
/list
613
/load
614
/logs
615
/logview
616
/loopfile
617
/markall
618
/me
619
/menubar
620
/mkdir
621
/mode
622
/msg
623
/msgbox
624
/nick
625
/nickcolor
626
/nmsg
627
/nomsg
628
/noop
629
/noquery
630
/notice
631
/notify
632
/np
633
/onotice
634
/op
635
/openfile
636
/part
637
/paths
638
/pgoogle
639
/pgoogle
640
/priv
641
/query
642
/quit
643
/quote
644
/raw
645
/rawlog
646
/reconnect
647
/rejoin
648
/reload
649
/remini
650
/remove
651
/rename
652
/reseterror
653
/resolve
654
/restart
655
/return
656
/rmdir
657
/run
658
/runloop
659
/say
660
/scid
661
/sclose
662
/scon
663
/search
664
/seekfile
665
/server
666
/serverlist
667
/set
668
/setoption
669
/sidebar
670
/signal
671
/slap
672
/sleep
673
/smsg
674
/sockaccept
675
/sockclose
676
/socklist
677
/socklisten
678
/sockmark
679
/sockopen
680
/sockpause
681
/sockread
682
/sockrename
683
/sockwrite
684
/sop
685
/sopen
686
/splay
687
/split
688
/statusbar
689
/swrite
690
/tab
691
/tester
692
/time
693
/timer
694
/titlebar
695
/tokenize
696
/toolbar
697
/topic
698
/txt2bin
699
/unban
700
/unignore
701
/unload
702
/unnotify
703
/unset
704
/update
705
/var
706
/vars
707
/viewlog
708
/voice
709
/vol
710
/wdown
711
/window
712
/wjump
713
/wnext
714
/wpause
715
/wplay
716
/wprev
717
/write
718
/writefile
719
/writeini
720
/wsearch
721
/wseekf
722
/wseekr
723
/wselect
724
/wstop
725
/wup
726
</pre>
727
728
Not all are from mIRC, ill seperate the list later.
729
730
All operaters are added.
731
732 154 Per Amundsen
h1. Example scripts
733
734
Simple kickcounter script:
735
736
<pre>
737 166 Per Amundsen
alias kick { 
738
	if (!%kickcount) %kickcount = 0
739 154 Per Amundsen
740 166 Per Amundsen
	inc %kickcount
741 154 Per Amundsen
		 
742 166 Per Amundsen
	if (!$3) { 
743
		kick # $$2 Kick number %kickcount
744 154 Per Amundsen
		halt
745
	} 
746
}
747
</pre>
748
749
Kickban example
750
<pre>
751 166 Per Amundsen
alias kb {
752 154 Per Amundsen
	if (!$1) {
753 166 Per Amundsen
		echo /kb - Nick missing
754 154 Per Amundsen
		return
755
	}
756
757 166 Per Amundsen
	var %msg = $iif(#, $2-, $3-)
758
	var %chan = $iif(#, #, $2)
759 154 Per Amundsen
		
760 166 Per Amundsen
	; Set this for default ban reason, or remove for no default reason
761
	; Can be shortened to %msg = $iif(%msg, %msg, GTFO)
762
	if (!%msg) %msg = GTFO
763 154 Per Amundsen
764
	if ($me isop %chan) {
765 166 Per Amundsen
		MODE %chan +b $wildsite
766
		KICK %chan $1 %msg
767 154 Per Amundsen
	} 
768 166 Per Amundsen
	else echo You are not oper on %chan
769 154 Per Amundsen
}
770
</pre>
771
772
Simple calculator script:
773
<pre>
774 166 Per Amundsen
alias calc {
775 154 Per Amundsen
	if (!$1) {
776 166 Per Amundsen
		echo /calc - Parameters missing
777 154 Per Amundsen
		return
778
	}
779
		
780 166 Per Amundsen
	; typing /calc -p <expression> sends output to channel
781 154 Per Amundsen
	if ($1 == -p) {
782 166 Per Amundsen
		msg # Calculating : $2-
783
		msg # Result is : $calc($2-)
784 154 Per Amundsen
	} else {
785 166 Per Amundsen
		echo Calculating : $1-
786
		echo Result is : $calc($1-)
787 154 Per Amundsen
	}
788
}
789
</pre>
790
791
Colored version
792
<pre>
793 166 Per Amundsen
alias calc {
794 154 Per Amundsen
	if (!$1) {
795 166 Per Amundsen
		echo /calc - Parameters missing
796 154 Per Amundsen
		return
797
	}
798 156 Per Amundsen
	
799
	# typing /calc -p <expression> sends output to channel
800 154 Per Amundsen
	if ($1 == -p) {
801 166 Per Amundsen
		msg # $chr(3)4Calculating : $2-
802
		msg # $chr(3)4Result is : $calc($2-)
803 154 Per Amundsen
	} else {
804 166 Per Amundsen
		echo $chr(3)4Calculating : 4$1-
805
		echo $chr(3)4Result is : $calc($1-)
806 154 Per Amundsen
	}
807 166 Per Amundsen
}
808 154 Per Amundsen
</pre>
809
810
CTCP flood detection example
811
812
<pre>
813 166 Per Amundsen
CTCP *:*:*:{
814
	if (!%count) set -u10 %count 1
815
	else inc -u10 %count 1
816 154 Per Amundsen
817 166 Per Amundsen
	if (%count > 4) ignore -tu30 $wildsite
818 154 Per Amundsen
}
819
</pre>
820
821
Mass mode example
822
823
<pre>
824 166 Per Amundsen
alias mass {
825 154 Per Amundsen
	if (!$2) {
826 166 Per Amundsen
		echo /mass - Parameters missing [+/-<mode> <nick> <nick> <nick>]
827 154 Per Amundsen
		return
828
	}
829
830
	%len = 2
831
	
832 166 Per Amundsen
	; equal to while (%len <= $count(%1-, $chr(32)))
833
	while (%len <= $0) {
834
		if ($(%len) ison #) mode # $1 $($ $+ %len)
835
		inc %len
836 154 Per Amundsen
	}
837
}
838
</pre>
839
840
Shows info about servers, channels and users
841
<pre>
842 166 Per Amundsen
on *:JOIN:#: {
843 154 Per Amundsen
	var %s = $server(0), %c = 0, %u = 0, %t = 0, %c2 = 0;
844
	
845
	while (%t < %s) {
846 166 Per Amundsen
		inc %t
847
		setserver $server(%t);
848 154 Per Amundsen
		%c += $chan(0)
849
	
850
		%c2 = 0
851
		while (%c2 < $chan(0)) {
852 166 Per Amundsen
			in %c2
853 154 Per Amundsen
			%u += $user($chan(%c2), 0)
854
		}
855
	}
856
857 166 Per Amundsen
	/echo You are on ( $+ %s $+ ) servers, ( $+ %c $+ ) channels with ( $+ %u $+ ) users
858 154 Per Amundsen
}
859
</pre>
860
861
It is possible to use scripts as functions.
862
These functions are fully nested like the client functions.
863
864
Lets say you make a /mycalc like this.
865
<pre>
866 166 Per Amundsen
alias mycalc {
867
	return $calc($$1 + $$2);
868 154 Per Amundsen
}
869
</pre>
870
871
Then you can call this function with eiter /mycalc <number> <number> the normal way or $mycalc(<number, <number>)
872
Typing /testcalc will show the result.
873
<pre>
874 166 Per Amundsen
alias testcalc {
875
	echo -a $1 + $2 is $mycalc($1, $2);
876
	echo -a 5 + 4 is $mycalc(5, 4);
877 154 Per Amundsen
}
878
</pre>
879
880
Simple convert temperature C to F or F to C
881
/temp C 20 will print 68 F
882
883
<pre>
884 166 Per Amundsen
alias temp {
885
	if ($1 == C) echo $calc(($2 * 9/5) + 32) F
886
	else if ($1 == F) echo $round($calc(($2 - 32) * 5/9), 1) C
887
	else echo Temp missing
888 154 Per Amundsen
}
889
</pre>
890
891 166 Per Amundsen
Announce song changes in a channel or to a user
892 154 Per Amundsen
<pre>
893 166 Per Amundsen
On *:SONG:{ 
894
	nmsg <network> <channel/Nick> $1-
895 154 Per Amundsen
}
896 158 Per Amundsen
</pre>
897
898 166 Per Amundsen
Announce to several channels with:
899 158 Per Amundsen
<pre>
900 166 Per Amundsen
On *:SONG:{ 
901
	nmsg <network> <channel1/Nick>,<channel2/Nick> $1-
902
	nmsg <network2> <channel3/Nick> $1- 
903 158 Per Amundsen
}
904 166 Per Amundsen
</pre>
905 158 Per Amundsen
906 166 Per Amundsen
Automatically find the summary of a imdb url
907
<pre>
908
On *:TEXT:*:#k: {
909
    var %reg = $regex($1-, http://www\.imdb\.com(/title/[a-z0-9]+/))
910
    if (!%reg) { return }
911
    sockclose imdb
912
    unset %data
913
    %imdb = $regml(1) $+ plotsummary
914
    %imdbchan = #
915
    sockopen imdb www.imdb.com 80
916 1 Per Amundsen
}
917
918 166 Per Amundsen
on *:sockopen:imdb: {
919
    sockwrite -n imdb GET %imdb HTTP/1.1
920
    sockwrite -n imdb Host: www.imdb.com
921
    sockwrite -n imdb User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.24 Safari/536.5
922
    sockwrite -n imdb Referer: http://www.imdb.com
923
    sockwrite -n imdb Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
924
    sockwrite -n imdb Accept-Language: en-us, en;q=0.50
925
    sockwrite -n imdb Connection: Close $+ $crlf $+ $crlf
926 1 Per Amundsen
}
927
928 166 Per Amundsen
on *:sockread:imdb:{
929
    sockread %text
930
    %data = %data $+ %text 
931 1 Per Amundsen
}
932
933 166 Per Amundsen
on *:sockclose:imdb: {
934
    if ($regex(%data, <p class="plotpar">([\s\S]*?)<i>)) {
935
        msg %imdbchan $regml(1)
936
    }
937 1 Per Amundsen
938 166 Per Amundsen
    unset %data
939 1 Per Amundsen
}
940
</pre>