on *:JOIN:#:{
if ($nick == $me) {
if ($hget(ajoin, status) == on) {
if ($lines(autojoin.txt) != 30) {
if ($read(autojoin.txt, w, $chan)) {
/echo -a i read the chan }
else {
write autojoin.txt $chan
timer 1 1 msg $chan Added to my auto join :)
}
}
else {
echo -a $chan couldnt be added to auto join
}
}
}
}
alias rewritelist {
.echo -a I am rewriting my autojoin list
.write -c autojoin.txt
var %x = 1
while (%x <= $chan(0)) {
.write autojoin.txt $chan(%x)
inc %x
}
}
alias msgaj {
msg $active My autojoin list:
var %x = 1
while (%x >= $lines(autjoin.txt)) {
if ($read(autojoin.txt, %x) == $null) {
msg $active -- list complete --
halt }
else {
msg $active $read(autojoin.txt, %x)
inc %x
}
}
}
alias ajlist {
var %x = 1
while (%x >= $lines(autjoin.txt)) {
if ($read(autojoin.txt, %x) == $null) {
/echo -a -- list complete --
halt }
else {
/echo -a $read(autojoin.txt, %x)
inc %x
}
}
}
alias aj {
var %x = 1
while (%x >= $lines(autjoin.txt)) {
if ($read(autojoin.txt, %x) == $null) {
/echo -a Joining complete
halt }
else {
/join $read(autojoin.txt, %x)
inc %x
}
}
}
alias addaj {
if ($read(autojoin.txt, w, $1)) {
echo -a This chan ( $+ $1 $+ ) already on autojoin
halt
}
if ($lines(autojoin.txt) == 30) {
.echo -a list full
}
else {
write autojoin.txt $1
/echo -a $1 Added to my auto join
}
}
alias delaj {
if (!$read(autojoin.txt, w, $1)) {
echo -a This chan ( $+ $1 $+ ) is not on autojoin
halt
}
else {
write -ds $+ $1 autojoin.txt
/echo -a $1 deleted from my auto join
}
}
alias clrlist {
write -c autojoin.txt
/echo -a -- list cleared --
}
alias ajoin {
if (!$1) {
echo -a On/Off?
}
if ($1 == ON) {
/hadd -m ajoin status ON
echo -a 4Autojoin adder $+ $hget(ajoin, status)
}
if ($1 == OFF) {
/hadd -m ajoin status OFF
echo -a 4Autojoin adder $+ $hget(ajoin, status)
}
}
alias joinstatus {
.echo -a Autojoin adder; $hget(ajoin, status)
}