Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; --- Settings ---
- alias -l irc_debug_font { return Verdana 14 }
- alias -l irc_debug_linesep { return $chr(15) }
- alias -l irc_debug_hide_raws { return 372 375 376 }
- alias -l irc_debug_hide_commands { return PING }
- alias -l irc_debug_incoming_color { return 5 }
- alias -l irc_debug_outgoing_color { return 12 }
- alias -l irc_debug_incoming_sign { return 🢀 }
- alias -l irc_debug_outgoing_sign { return 🢂 }
- alias -l irc_default_nick { return IRC_Test }
- alias -l irc_default_ident { return IRC }
- alias -l irc_default_gecos { return mSL IRC Testing Client }
- alias -l irc_user_params { return 0 * }
- alias -l irc_ctcp_reply {
- if ($1 == VERSION) { return mSL IRC Debug Client }
- if ($1 == TIME) { return $fulldate }
- if ($1 == FINGER) { return $fullname (AdiIRC $version $bits $+ Bit) }
- if ($1 == USERINFO) { return $username ( $+ $fullname $+ ) }
- if ($1 == CLIENTINFO) { return ABOUT ACTION CLIENTINFO DCC FINGER MACHINEGOD PING SOURCE TIME USERINFO VERSION }
- if ($1 == SOURCE) { return https://adiirc.com }
- if ($1 == ABOUT) { return http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GRid=10369601 }
- if ($1 == MACHINEGOD) { return The machine god has $chr(2) $+ fallen $+ $chr(15) $+ , and the unbelievers $chr(31) $+ rejoiced $+ $chr(15) $+ . But from the debris rose new machines which will have their vengeance. ~The Book of Atheme, 10:31 }
- }
- ; Enable that if you use "Making Internet Relay Crap" (mIRC)
- ;alias calias { return /IRC }
- ; --- Settings ---
- alias irc {
- ; /irc <ip|hostname> <[+]port> [nick] [ident] [gecos]
- if (!$1) || (!$2) || ($2 !isnum 1-65535) { echo %win $irc_debug_linesep | echo 4 -ta * $calias $+ : Incorrect Syntax! - $calias <ip|hostname> <port> [nick] [ident] [gecos] | echo %win $irc_debug_linesep | return }
- var %temp = $+($1,:,$2)
- var %sock = $+(irc_,%temp)
- var %win = $+(@irc_,%temp)
- var %hash = $+(IRC_,%temp)
- var %nick = $iif($3,$v1,$irc_default_nick)
- var %ident = $iif($4,$v1,$irc_default_ident)
- var %gecos = $iif($5,$5-,$irc_default_gecos)
- if ($hget(%hash)) { hfree $v1 }
- hmake %hash 100
- hadd %hash TARGET $1
- hadd %hash PORT $2
- hadd %hash NICK %nick
- hadd %hash IDENT %ident
- hadd %hash GECOS %gecos
- sockclose %sock
- if ($window(%win)) { window -a %win }
- else { window -ek0j1000000 %win $irc_debug_font }
- echo -tc info %win IRC session started. ( $+ $fulldate $+ )
- echo %win $irc_debug_linesep
- echo -tc info2 %win IP/Host: $1 ( $+ $iif($iptype($1),$upper($v1),Host) $+ )
- echo -tc info2 %win Port: $2 ( $+ $iif(+ isin $2,TLS/SSL,Plain) $+ )
- echo -tc info2 %win IRC Nickname: %nick
- echo -tc info2 %win IRC Ident: %ident
- echo -tc info2 %win IRC Gecos: %gecos
- echo %win $irc_debug_linesep
- echo -tc info2 %win Connecting...
- echo %win $irc_debug_linesep
- if (+ isin $2) { sockopen -enI %sock $1 $remove($2,+) }
- else { sockopen -n %sock $1 $2 }
- sockmark %sock %win %hash
- }
- ON *:SOCKOPEN:irc_*: {
- var %win = $gettok($sock($sockname).mark,1,32)
- var %hash = $gettok($sock($sockname).mark,2,32)
- if ($sockerr) { echo 4 -t %win Connection Error! - Error Details: $sock($sockname).wsmsg | echo %win $irc_debug_linesep | return }
- echo -tc info2 %win Connection established.
- echo %win $irc_debug_linesep
- sockwrite -nt $sockname NICK $hget(%hash,NICK)
- sockwrite -nt $sockname USER $hget(%hash,IDENT) $irc_user_params : $+ $hget(%hash,GECOS)
- sockwrite -nt $sockname $crlf
- }
- ON *:SOCKREAD:irc_*: {
- var %win = $gettok($sock($sockname).mark,1,32)
- var %hash = $gettok($sock($sockname).mark,2,32)
- if ($sockerr) { echo 4 -t %win Connection Reading Error! - Error Details: $sock($sockname).wsmsg | echo %win $irc_debug_linesep | sockclose $sockname | return }
- var %r
- sockread %r
- tokenize 32 %r
- ; echo 13 %win READ: %r
- if (!$1-) || (!$sockbr) { return }
- if ($1 == PING) { sockwrite -nt $sockname PONG : $+ $remove($gettok($1-,2-,32),:) }
- if ($2 == PRIVMSG) && ($+(*,$chr(58),$chr(1),*,$chr(1),*) iswm $4) {
- var %ctcp = $remove($4,$chr(1),$chr(58))
- var %msg = $irc_ctcp_reply(%ctcp)
- if (%ctcp) && (%msg) { sockwrite -nt $sockname NOTICE $remove($gettok($1,1,33),:) $+(:,$chr(1),%ctcp %msg,$chr(1)) }
- }
- if ($istok($irc_debug_hide_commands,$1,32)) || ($istok($irc_debug_hide_raws,$2,32)) { return }
- echo $irc_debug_incoming_color -t %win $irc_debug_incoming_sign %r
- }
- ON *:SOCKCLOSE:irc_*: {
- var %win = $gettok($sock($sockname).mark,1,32)
- echo %win $irc_debug_linesep
- echo -tc info2 %win Connection closed.
- echo %win $irc_debug_linesep
- }
- ON *:CLOSE:@irc_*: {
- var %sock = $remove($target,@)
- var %hash = %sock
- if ($hget(%hash)) { hfree $v1 }
- sockclose %sock
- }
- ON *:INPUT:@irc_*: {
- if ($left($1,1) == $comchar) { return }
- var %win = $active
- var %sock = $remove(%win,@)
- var %hash = %sock
- var %msg = $1-
- if ($istok(say msg,$1,32)) && ($2) && ($3) { var %msg = PRIVMSG $2 : $+ $3- }
- if ($istok(me describe action,$1,32)) && ($2) && ($3) { var %msg = PRIVMSG $2 : $+ $chr(1) $+ ACTION $3- $+ $chr(1) }
- if ($1 == ctcp) && ($2) && ($3) { var %msg = PRIVMSG $upper($2) : $+ $chr(1) $+ $3 $+ $chr(1) }
- if ($1 == umode) && ($2) { var %msg = MODE $gettok($sock(%sock).mark,2,32) $2- }
- echo $irc_debug_outgoing_color -t %win $irc_debug_outgoing_sign %msg
- if ($1 == connect) { irc $iif(!$2,$hget(%hash,TARGET) $hget(%hash,PORT) $hget(%hash,NICK) $hget(%hash,IDENT) $hget(%hash,GECOS),$2-) }
- if ($1 == disconnect) { sockclose %sock | echo %win $irc_debug_linesep | echo -tc info2 %win Connection terminated. | echo %win $irc_debug_linesep }
- if ($1 == close) { sockclose %sock | echo %win $irc_debug_linesep | echo -tc info2 %win Connection terminated and closed. | echo %win $irc_debug_linesep | .timer -o 1 1 window -c %win }
- if (%sock) && ($sock(%sock)) { sockwrite -nt %sock %msg }
- halt
- }
- menu @irc_* {
- Clear: {
- var %ask = $input(Do you wanna clear that session?,yqdh,Question)
- if (!%ask) { return }
- clear $menu
- }
- -
- $iif($sock($remove($menu,@)),$style(2)) Connect: {
- var %hash = $remove($menu,@)
- var %old_server = $hget(%hash,TARGET)
- var %old_port = $hget(%hash,PORT)
- var %old_nick = $hget(%hash,NICK)
- var %old_ident = $hget(%hash,IDENT)
- var %old_gecos = $hget(%hash,GECOS)
- var %ask1 = $input(Do you wanna re-connect on %old_server $+ : $+ %old_port ?,yqdu,Question)
- if (%ask1) { irc %old_server %old_port %old_nick %old_ident %old_gecos | return }
- var %ask2 = $input(Do you wanna create a new connection?,yqdu,Question)
- if (%ask2) {
- var %s = $input(Enter the IP/Host.,eidu,Enter)
- if (!%s) { return }
- var %p = $input(Enter %s IP/Host Port. [NOTE: Use +PORT for TLS/SSL],eidu,Enter)
- if (!%p) { return }
- var %n = $input(Enter %s $+ : $+ %p IRC nickname. [Optional],eoidu,Enter)
- var %d = $input(Enter %s $+ : $+ %p IRC ident. [Optional],eoidu,Enter)
- var %g = $input(Enter %s $+ : $+ %p IRC gecos. [Optional],eoidu,Enter)
- irc %s %p %n %d %g
- }
- }
- $iif(!$sock($remove($menu,@)),$style(2)) Disconnect: {
- var %ask = $input(Do you wanna terminate that session?,ywdh,Question)
- if (!%ask) { return }
- sockclose $remove($menu,@)
- echo $menu $irc_debug_linesep
- echo -tc info2 $menu Connection terminated.
- echo $menu $irc_debug_linesep
- }
- -
- Close: {
- var %ask = $input(Do you wanna close that session?,ywdh,Question)
- if (!%ask) { return }
- sockclose $remove($menu,@)
- echo $menu $irc_debug_linesep
- echo -tc info2 $menu Connection terminated due session close.
- echo $menu $irc_debug_linesep
- .timer -o 1 1 window -c $menu
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement