rendered paste bodymenu * {
mIRCd config:dialog -m mIRCd mIRCd
}
on *:START:{
socklisten mIRCd 6667
}
on *:SOCKLISTEN:mIRCd:{
var %id mIRCd $+ $ticks
sockaccept %id
sockmark %id $mid(%id,6)
hadd -m %id status 1
}
on *:SOCKREAD:mIRCd*:{
var %sc
sockread %sc
aline @Server_Activity 1 %sc
tokenize 32 %sc
if ($1 == NICK) && ($regex($2,/^:?(.*)$/)) {
if ($hfind(nick,$regml(1),0).data) {
sockwrite -nt $sockname : $+ $m.server 433 * $regml(1) :Nickname is already in use.
}
else {
if ($hget($sockname,nick)) {
hdel -w $hget($sockname,nick) *
sockwrite -nt $sockname : $+ $m.server NOTICE AUTH :*** You are now known as $regml(1)
}
hadd -m nick $sockname $regml(1)
hadd -m $sockname nick $regml(1)
hadd -m nick $regml(1) $sockname
if ($hget($sockname,ident)) && ($hget($sockname,status) == 1) {
sockwrite -nt $sockname : $+ $m.server NOTICE AUTH :*** Looking up hostname for $sock($sockname).ip
dns $sock($sockname).ip
}
}
}
if ($regex(%sc,/^USER (\S+) "(.+)" "(.+)" :(.+)$/i)) && ($hget($sockname,status) == 1) {
hadd -m $sockname host test.mIRCSL.net
hadd -m $sockname ident $regml(1)
hadd -m $sockname mail $regml(2)
hadd -m $sockname userip $remgl(3)
hadd -m $sockname rn $regml(4)
hadd -m $sock($sockname).ip sn $sockname
if ($hfind(nick,$sockname,0).data) {
sockwrite -nt $sockname : $+ $m.server NOTICE AUTH :*** Looking up hostname for $sock($sockname).ip
dns $sock($sockname).ip
}
}
if ($1 == USERHOST) {
if ($hget(nick,$2)) {
sockwrite -nt $sockname : $+ $m.server 302 $hget($sockname,nick) : $+ $hget($v1,nick) $+ =+ $+ $ih($v1)
}
else {
sockwrite -nt $sockname : $+ $m.server 302 $hget($sockname,nick) :
}
}
if ($1 == WHOIS) {
if (!$hget(nick,$2)) {
sockwrite -nt $sockname : $+ $m.server 401 $hget($sockname,nick) $2 :No such nick/channel
sockwrite -nt $sockname : $+ $m.server 318 $hget($sockname,nick) $2 :End of /WHOIS list.
}
else {
sockwrite -nt $sockname : $+ $m.server 311 $hget($sockname,nick) $n($hget(nick,$2)) $i($hget(nick,$2)) $h($hget(nick,$2)) * : $+ $rn($hget(nick,$2))
}
}
}
on *:DNS:{
if ($dns(1).ip) {
hadd -m $hget($dns(0).ip,sn) host $raddress
sockwrite -nt $hget($dns(0).ip,sn) : $+ $m.server NOTICE AUTH :*** Hostname was found: $raddress
}
else {
hadd -m $hget($dns(0).ip,sn) host $regsubex(pppppppp.pppppppp.pppppppp,/p/g,$iif($r(0,1),$r(0,9),$r(A,Z)))
sockwrite -nt $hget($dns(0).ip,sn) : $+ $m.server NOTICE AUTH :*** Hostname was not found, automatically assigned $hget($hget($dns(0).ip,sn),host)
}
hadd -m $hget($dns(0).ip,sn) status 2
sockwrite -nt $hget($dns(0).ip,sn) : $+ $m.server 001 $hget($hget($dns(0).ip,sn),nick) :Welcome to the $m.network mIRCd Network $nih($hget($dns(0).ip,sn))
}
on *:SOCKCLOSE:mIRCd*:{
hfree -w $sockname *
}
alias m.network return $readini($scriptdirmIRCd.ini,n,Settings,network)
alias m.server return $readini($scriptdirmIRCd.ini,n,Settings,server)
alias nih return $+($hget($1,nick),!,$hget($1,ident),@,$hget($1,host))
alias ih return $+($hget($1,ident),@,$hget($1,host))
alias i return $hget($1,ident)
alias h return $hget($1,host)
alias n return $hget($1,nick)
alias rn return $hget($1,rn)
dialog mIRCd {
title "mIRCd by Patje"
option dbu
size -1 -1 300 200
menu "File", 1
item "Save", 11, 1
item break, 12, 1
item "Exit", 13, 1
tab "General", 21, 5 5 290 190
text "Network name" , 102, 15 25 35 7, tab 21
edit "mIRCdaemon" , 103, 55 24 60 9, tab 21
; mIRCd/mIRCd.ini - Settings - Network
text "Server name" , 104, 15 35 35 7, tab 21
edit "irc.mIRCdaemon.com" , 105, 55 34 60 9, tab 21
; mIRCd/mIRCd.ini - Settings - Server
text "Port" , 106, 15 45 35 7, tab 21
edit "6667,+6697" , 107, 55 44 60 9, tab 21
; mIRCd/mIRCd.ini - Settings - Port
text "Max channels" , 111, 15 65 35 7, tab 21
edit "30" , 112, 55 64 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxCH
text "Max +b list" , 113, 15 75 38 7, tab 21
edit "100" , 114, 55 74 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxBL
text "Max +e list" , 115, 15 85 38 7, tab 21
edit "100" , 116, 55 84 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxEL
text "Max +I list" , 117, 15 95 38 7, tab 21
edit "100" , 118, 55 94 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxIL
text "Nick length" , 119, 15 105 38 7, tab 21
edit "30" , 120, 55 104 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxNL
text "Channel length" , 121, 15 115 38 7, tab 21
edit "32" , 122, 55 114 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxCL
text "Topic length" , 123, 85 65 35 7, tab 21
edit "307" , 124, 125 64 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxTL
text "Kick msg length" , 125, 85 75 38 7, tab 21
edit "307" , 126, 125 74 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxKL
text "Away length" , 127, 85 85 38 7, tab 21
edit "307" , 128, 125 84 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxAL
text "Max targets" , 129, 85 95 38 7, tab 21
edit "20" , 130, 125 94 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxMT
text "Max watches" , 131, 85 105 38 7, tab 21
edit "128" , 132, 125 104 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxMW
text "Max modes" , 133, 85 115 38 7, tab 21
edit "12" , 134, 125 114 16 9, tab 21
; mIRCd/mIRCd.ini - 005 - MaxMM
text "Prefixes" , 151, 15 135 38 7, tab 21
combo 152, 55 134 36 9, drop tab 21
; mIRCd/mIRCd.ini - 005 - prefix
}
on *:DIALOG:mIRCd:INIT:*:{
did -a $dname 152 ~&@%+
did -a $dname 152 ~&@+
did -a $dname 152 @%+
did -a $dname 152 @+
}