Skip to content
Snippets Groups Projects
bullseye.src 1.43 KiB
# bullseye.src

# Bulletins written in Baja by Rob Swindell

# $Id$

# @format.tab-size 8, @format.use-tabs true

!include file_io.inc
!include sbbsdefs.inc

# Load the configuration file

int i
int b
int file
int filepos
int total
int mode
str fname

printf "\r\nSynchronet BullsEye! Version 1.06 by Rob Swindell\r\n"
pause_reset
set str "%zbullseye.cfg"
fopen file O_RDONLY str
if_false
	printf "\r\n!ERROR %ld opening %s\r\n" _errno str
	return
	end_if
fread_line file str
copy mode str
fget_pos file filepos

set total 0
#print "%l: %s" total str
:count_bulls
	fread_line file str
	#print "%ld: %s" total str
	if_true	# not end of file
		add total 1
		goto count_bulls
	        end_if

# Display menu, list bulletins, display prompt, etc.

:menu
printfile "%zbullseye.asc"
print "\1n\r\n\1b\1hEnter number of bulletin to view or press (\1wENTER\1b) to continue: \1w"
getnum b total
compare b 1
if_less
	return
	end_if
fset_pos file filepos
set i 0
:next
fread_line file str
if_true	# not end of file
	add i 1
	compare i b
	if_equal
		print "\1n\1l"
		truncsp str
		copy fname str
		compare_substr str ".htm"
		replace_text 563 "\1n\1h\1b{\1wContinue? Yes/No\1b} "
		if_true
			exec_bin typehtml
		else
			printfile str 0
			end_if
		sprintf str "Node %d %s viewed bulletin #%d: %s" _node_num _useron.alias i fname
		print_local "%s"
		revert_text 563
		clear_abort
		goto menu
		end_if
	goto next
	end_if
printf "\r\nInvalid bulletin number: %d" b
goto menu