rendered paste body; ––––––––––––––––––––––––––––––––––––––––
; Put your own scripts in here.
; ––––––––––––––––––––––––––––––––––––––––
on *:text:*youtube.com/watch?v=*:*:{
%entry = $1-
if %tube != on {
window @YouTube
set %tube on
echo @YouTube •›› Info: YouTube window opened $day $+ , $date $+ , $time
echo @YouTube .................................................................................................................................................
}
if (http:// isin $1-) %ytpath = / $+ $gettok($gettok($1-,3,47),1,38)
else %ytpath = / $+ $gettok($gettok($1-,2,47),1,38)
%ytnick = $nick
%ytchan = $chan
sockclose yt
sockopen yt youtube.com 80
}
on *:close:@YouTube:{
set %tube off
}
on *:sockopen:yt:{
if ($sockerr) { echo -a $chr(91) $+ $time $+ $chr(93) YouTube: socket error | halt }
sockwrite -n $sockname GET %ytpath HTTP/1.1
sockwrite -n $sockname Host: youtube.com
sockwrite -n $sockname $crlf
}
on *:sockread:yt: {
:read
sockread -f %ytread
:gettitle
if (*"video_title"* iswm %ytread ) {
noop $regex(%ytread,/<h1 id="video_title">(.*?)</h1>/Si)
set %titles $remove($regml(1),<h1 id="video_title">,</h1>)
if (%ytchan != $null) {
; msg %ytchan %ytpath Title: %titles
echo @YouTube ...................................................................................................................................................................................................................................................................................................
echo @YouTube 4-----> 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network %ytchan $+ 4> 4< $+ %ytnick $+ 4>
echo @YouTube %entry
echo @YouTube Title: %titles
write youtube.txt .....................................................................................................................................................................................................................................................................
write youtube.txt < $+ $date $+ > < $+ $time $+ > < $+ $network %ytchan $+ > < $+ %ytnick $+ > %entry
write youtube.txt Title: %titles
goto getdesc
}
if (%ytchan == $null && %ytnick != $null) {
; msg %ytnick %ytpath Title: %titles
echo @YouTube ...................................................................................................................................................................................................................................................................................................
echo @YouTube 4-----> 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network PM $+ 4> 4< $+ %ytnick $+ 4>
echo @YouTube %entry
echo @YouTube Title: %titles
write youtube.txt .....................................................................................................................................................................................................................................................................
write youtube.txt < $+ $date $+ > < $+ $time $+ > < $+ $network PM $+ > < $+ %ytnick $+ > %entry
write youtube.txt Title: %titles
}
}
:getdesc
if (*"vidDescRemain"* iswm %ytread ) {
noop $regex(%ytread,/<span id="vidDescRemain">(.*?)</span>/Si)
set %descs $remove($regml(1), ,<span id="vidDescRemain">,<br/>,</span>)
if (%ytchan != $null) {
; msg %ytchan %ytpath Description: %descs
echo @YouTube Description: %descs
write youtube.txt Description: %descs
unset %ytchan
unset %ytnick
unset %ytpath
unset %titles
unset %descs
goto end
}
if (%ytchan == $null && %ytnick != $null) {
; msg %ytnick %ytpath Description: %descs
echo @YouTube Description: %descs
write youtube.txt Description: %descs
unset %ytchan
unset %ytnick
unset %ytpath
unset %titles
unset %descs
}
}
; msg %ytchan %ytpath Title: %titles Description: %descs
:end
if ($sockbr) goto read
}
on *:invite:#sonora:{ /msg $nick No Thanks | /part #sonora }
on ^*:HOTLINK:http*//*.*:*:return
on *:HOTLINK:http*//*.*:*:run "C:\Program Files\Opera\opera.exe" $1-
on ^*:HOTLINK:www.*:*:return
on *:HOTLINK:www.*:*:run "C:\Program Files\Opera\opera.exe" $1-
;;; Force Firefox to launch urls
;on ^*:HOTLINK:http*//*.*:*:return
;;on *:HOTLINK:http*//*.*:*:run "C:\FirefoxPortable\FirefoxPortable.exe" $1-
;;;on *:HOTLINK:http*//*.*:*:run "C:\Program Files\Mozilla Firefox\firefox.exe" $1-
;on *:HOTLINK:http*//*.*:*:run "C:\cygwin\bin\run.exe" dillo $1-
;on ^*:HOTLINK:www.*:*:return
;;on *:HOTLINK:www.*:*:run "C:\FirefoxPortable\FirefoxPortable.exe" $1-
;;;on *:HOTLINK:www.*:*:run "C:\Program Files\Mozilla Firefox\firefox.exe" $1-
;on *:HOTLINK:www.*:*:run "C:\cygwin\bin\run.exe " dillo $1-
; PAUSE SCRIPT RETRIEVED FROM
; http://www.hdesk.org/wiki/index.php?title=/pause
;
; Author: FiberOPtics
;
; Email: mirc.fiberoptics@gmail.com
;
; Usage: /pause <s|ms> <N>, where s stands for seconds, and ms for milliseconds.
;
; Examples: //echo -a hi | pause s 3 | echo -a sup
; //echo -a 1 2 3... | pause ms 1500 | echo -a 4
;
; Purpose: Will pause the script engine on the current thread from processing, until
; the specified interval in seconds (s) or milliseconds (ms) has passed.
;
; Reqs: mIRC 5.9
; /pause with param 's' works on all Windows versions
; /pause with param 'ms' works on Windows OS'es from Win2k and higher
;
;
; Notes: - If you want to use this in an event, use a signal, as otherwise it would pause the event,
; making successive triggerings of the event queued.
;
; - The reason the millisecond property only works from Win2k on, is because pathping.exe
; only started to be shipped from that OS. So in theory, you could use this snippet
; on all Windows versions, as long as it has pathping.exe installed.
;
; - Remember that mIRC has the functionality of timers (/help /timer), so look into using,
; timers before resorting to /pause.
;
; - Online has already created a great /sleep snippet that works on all Windows OS'es
; that don't have Windows Scripting disabled, so why did I release this snippet?
;
; * /pause doesn't have to do disk access in order to work, which makes it more
; efficient and less slow.
;
; * /pause is more accurate in respecting the specified interval to pause
; (don't expect it to be right on the spot though, there will always be
; some variation)
;
; * /pause doesn't trigger anti-spyware/anti-virus programs, something /sleep
; suffers from with for example MS Windows AntiSpyware, because it executes
; a Windows Scripting file, which is often seen as malicious. This was the
; primary reason to release /pause.
;
alias pause {
var %e = !echo $color(info) -a * /pause:
if ($version < 5.91) {
%e this snippet requires atleast mIRC version 5.91
}
elseif (!$regex(pause,$1-,/^m?s \d+$/Si)) {
%e incorrect/insufficient parameters. Syntax: /pause <s|ms> <N>
}
elseif ($1 == ms) && ($istok(95 98 ME,$os,32)) {
%e cannot use milliseconds parameter on OS'es beneath Win2k
}
elseif ($2 !isnum 1-) {
%e must specify a number within range 1-
}
else {
var %wsh = wsh $+ $ticks, %cmd
if ($1 == s) %cmd = ping.exe -n $int($calc($2 + 1)) 127.0.0.1
else %cmd = pathping.exe -n -w 1 -q 1 -h 1 -p $iif($2 > 40,$calc($2 - 40),$2) 127.0.0.1
.comopen %wsh wscript.shell
.comclose %wsh $com(%wsh,run,1,bstr*,% $+ comspec% /c %cmd >nul,uint,0,bool,true)
}
}
; HIGHLIGHT WINDOW SCRIPT RETRIEVED FROM
; http://www.mpcforum.com/showthread.php?t=128044&page=2
on *:text:*:*: {
if $me isin $1- {
if %hlw != on {
window @Highlights
set %hlw on
echo @highlights •›› Info: Highlight window opened $day $+ , $date $+ , $time
echo @highlights .................................................................................................................................................
}
if ($chan == $null) {
echo @highlights 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network PM $+ 4> 4< $+ $nick $+ 4> $1-
write HIGHLIGHTS.txt < $+ $date $+ > < $+ $time $+ > < $+ $chan $+ > < $+ $nick $+ > $1-
}
else {
echo @highlights 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network $chan $+ 4> 4< $+ $nick $+ 4> $1-
write HIGHLIGHTS.txt < $+ $date $+ > < $+ $time $+ > < $+ $chan $+ > < $+ $nick $+ > $1-
}
}
}
on *:action:*:*: {
if $me isin $1- {
if %hlw != on {
window @Highlights
set %hlw on
echo @highlights •›› Info: Highlight window opened $day $+ , $date $+ , $time
echo @highlights .................................................................................................................................................
}
echo @highlights 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network $chan $+ 4> 4 $+ $nick $+ $1-
write HIGHLIGHTS.txt < $+ $date $+ > < $+ $time $+ > < $+ $chan $+ > $nick $1-
}
}
on *:voice:* {
if $vnick == $me {
if %hlw != on {
window @Highlights
set %hlw on
echo @highlights •›› Info: Highlight window opened $day $+ , $date $+ , $time
echo @highlights .................................................................................................................................................
}
echo @highlights 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network $chan $+ 4> $nick sets +v $vnick
write HIGHLIGHTS.txt < $+ $date $+ > < $+ $time $+ > < $+ $chan $+ > $nick sets +v $vnick
}
}
on *:devoice:* {
if $vnick == $me {
if %hlw != on {
window @Highlights
set %hlw on
echo @highlights •›› Info: Highlight window opened $day $+ , $date $+ , $time
echo @highlights .................................................................................................................................................
}
echo @highlights 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network $chan $+ 4> $nick sets -v $vnick
write HIGHLIGHTS.txt < $+ $date $+ > < $+ $time $+ > < $+ $chan $+ > $nick sets -v $vnick
}
}
on *:help:* {
if $hnick == $me {
if %hlw != on {
window @Highlights
set %hlw on
echo @highlights •›› Info: Highlight window opened $day $+ , $date $+ , $time
echo @highlights .................................................................................................................................................
}
echo @highlights 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network $chan $+ 4> $nick sets +h $hnick
write HIGHLIGHTS.txt < $+ $date $+ > < $+ $time $+ > < $+ $chan $+ > $nick sets +h $hnick
}
}
on *:dehelp:* {
if $hnick == $me {
if %hlw != on {
window @Highlights
set %hlw on
echo @highlights •›› Info: Highlight window opened $day $+ , $date $+ , $time
echo @highlights .................................................................................................................................................
}
echo @highlights 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network $chan $+ 4> $nick sets -h $hnick
write HIGHLIGHTS.txt < $+ $date $+ > < $+ $time $+ > < $+ $chan $+ > $nick sets -h $hnick
}
}
on *:op:* {
if $opnick == $me {
if %hlw != on {
window @Highlights
set %hlw on
echo @highlights •›› Info: Highlight window opened $day $+ , $date $+ , $time
echo @highlights .................................................................................................................................................
}
echo @highlights 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network $chan $+ 4> $nick sets +o $opnick
write HIGHLIGHTS.txt < $+ $date $+ > < $+ $time $+ > < $+ $chan $+ > $nick sets +o $opnick
}
}
on *:deop:* {
if $opnick == $me {
if %hlw != on {
window @Highlights
set %hlw on
echo @highlights •›› Info: Highlight window opened $day $+ , $date $+ , $time
echo @highlights .................................................................................................................................................
}
echo @highlights 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network $chan $+ 4> $nick sets -o $opnick
write HIGHLIGHTS.txt < $+ $date $+ > < $+ $time $+ > < $+ $chan $+ > $nick sets -o $opnick
}
}
on *:close:@highlights:{
set %hlw off
}
; ––––––––––––––––––––––––––––––––––––––––
; End of file
; ––––––––––––––––––––––––––––––––––––––––