alias switchtooneline {
set %line 1
while ($lines(apply.txt) >= %line) {
$iif(%line != 1,set %nicks $+(%nicks,$chr(44),$read(apply.txt,%line)),set %nicks $read(apply.txt,%line))
inc %line
}
write -c apply.txt $eval(%nicks,2)
unset %nicks
}
on *:TEXT:.buddylist:#:{
var %i 1
var %file $nick $+ .txt
var %bl Buddys:
while (%i != $calc($lines(%file) + 1)) {
var %bl %bl $read( $+ %file $+ , $+ %i $+ )
inc %i
}
msg $chan %bl
}
on *:TEXT:.apply:#:{ write apply.txt $nick | notice $nick You have been added.) }
on *:TEXT:.applist:#:{ switchtooneline | msg $chan $read(apply.txt,1) }
on *:TEXT:.createbuddylist:#: { write $nick $+ .txt $nick Buddy list) }
on 1:TEXT:.buddyadd*:#:/write $nick $+ .txt $2 | msg $chan $2 has been added) }
on 1:TEXT:.commands*:#:/msg $chan $read(commands.txt,1) }
on 1:TEXT:.needhelp*:#:/write needhelp.txt $nick | msg $chan $nick Has Been Added To The Help List.
on 1:TEXT:.buddydel*:#:{
var %i 1
var %file $nick $+ .txt
var %nickname $2
var %status 0
while (%i != $calc($lines(%file) + 1)) {
if ($read( $+ %file $+ , $+ %i $+ ) == %nickname) { write -dl $+ %i %file | var %status 1 }
inc %i
}
if (%status == 0) { msg $chan No Such Nickname Found... }
if (%status == 1) { msg $chan Removed... $2 Successfully }
}
on 1:TEXT:.help*:#:{
var %i 1
var %file needhelp $+ .txt
var %nickname $2
var %status 0
while (%i != $calc($lines(%file) + 1)) {
if ($read( $+ %file $+ , $+ %i $+ ) == %nickname) { write -dl $+ %i %file | var %status 1 }
else { inc %i }
}
if (%status == 0) { msg $chan 0,1This person cannot be helped because he/she has not typed .needhelp yet }
if (%status == 1) { msg $chan 0,1 $2 Your helper helper is: $nick }
}
on 100:TEXT:.takeuser *:#:{
if ($read(apply.txt,w,$+(*,$2,*))) {
write -dl $+ $readn apply.txt
msg $2 0,1 $2 Your application has been sent to: $nick
}
else msg $chan 0,1 This person cannot be helped because he/she has not typed .apply yet
}