# wildcat.src

# $Id: wildcat.src,v 1.13 2018/06/10 09:09:58 rswindell Exp $

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

!include sbbsdefs.inc

:main
cmd_home
async
compare_ars expert
if_false
	clear_abort
	menu wildcat/main
	print "\r\nwhCommand >>? n"
else
	print "\r\nyh@GRP@ @SUB@, wMAIN MENUy: ? n"
	end_if

node_action node_main

getcmd 1AEMHUQCNFTJGPIYWVSBDR?\r

# Write command to log file
logkey_comma

# Commands
cmdkey ?
	compare_ars expert
	if_true
		menu wildcat/main
		end_if
	end_cmd
cmdkey M
	cmd_pop
	goto message
	end_cmd
cmdkey U
	print "\r\nchList Users\r\n"
	mnemonics "\r\n~Logons Today, ~Sub-board, or ~All: "
	getcmd LSA\r
	cmdkey L
		userlist_logons
		end_cmd
	cmdkey S
		userlist_sub
		end_cmd
	cmdkey A
		userlist_all
		end_cmd
	end_cmd

cmdkey N
	menu logon
	pause
	end_cmd

cmdkey C
	setstr "1"
	mail_send_feedback
	end_cmd
cmdkey F
	cmd_pop
	goto transfers
	end_cmd
cmdkey T
	exec_bin chat_sec
	end_cmd
cmdkey J
	msg_select_area
	end_cmd
cmdkey G
	file_download_batch
	if_true
		end_cmd
                end_if
	compare_ars expert
	if_false
		logoff
	else
		logoff_fast
		end_if
	end_cmd

cmdkey P
	page_sysop
	pause
	end_cmd

cmdkey I
	menu ../answer
	pause
	end_cmd

cmdkey Y
	user_defaults
	end_cmd

cmdkey W
	nodelist_users
	crlf
	pause
	end_cmd

cmdkey S
	info_system
	crlf
	pause
	end_cmd

cmdkey B
	text_file_section
	end_cmd

cmdkey D
	exec_bin xtrn_sec
	end_cmd

cmdkey E
	exec_bin email_sec
	end_cmd

cmdkey A
	auto_message
	end_cmd

cmdkey V
	print "\r\nyhUsername search string: w"
	getname 25
	finduser
	if_true
		print "yhVerified: w"
		printstr
		crlf
		end_if
	end_cmd

cmdkey H
	toggle_user_misc UM_EXPERT
	print "\r\nExpert mode is now: "
	compare_ars EXPERT
	if_true
		print "ON"
	else
		print "OFF"
		end_if
	crlf
        end_cmd

cmdkey 1
	compare_ars SYSOP or exempt Q or I or N
	if_true
		cmd_pop
		goto sysop
		end_if
	end_cmd

cmdkey R
	info_user
	pause
	end_cmd

end_cmd

################################ File Section #################################

:transfers
cmd_home
async
compare_ars expert
if_false
	clear_abort
	menu wildcat/file
	print "\r\nwhCommand >>? n"
else
	print "\r\nyh@LIB@ @DIR@, wFILE MENUy: ? n"
	end_if

# Update node status
node_action node_xfer
getcmd 1QLDUNVMSGPIJEFH?\r
logkey_comma

cmdkey ?
	compare_ars expert
	if_true
		menu wildcat/file
		end_if
	end_cmd

cmdkey H
	toggle_user_misc UM_EXPERT
	print "\r\nExpert mode is now: "
	compare_ars EXPERT
	if_true
		print "ON"
	else
		print "OFF"
		end_if
	crlf
        end_cmd

cmdkey Q
	cmd_pop
	goto main
	end_cmd

cmdkey L
	setstr "*.*"
	file_list
        end_cmd

cmdkey D
	print "\r\nchDownload File(s)\r\n"
	file_download_batch
	if_true
		end_cmd
                end_if
	getfilespec
	if_true
		file_download
		end_if
        end_cmd

cmdkey U
	print "\r\nchUpload File\r\n"
	chkfile "../text/menu/upload.*"
	if_true
		menu upload
                end_if
	file_upload
	end_cmd

cmdkey N
	print "\r\nbhUse c@NEWFILETIME@b for new file scan date/time "
	yes_no ""
	if_false
		file_ptrs_cfg
		if_false
			end_cmd
			end_if
		end_if
	file_new_scan
	end_cmd

cmdkey V
	print "\r\nchView File(s)\r\n"
	getfilespec
	if_true
		file_view
		end_if
        end_cmd

cmdkey M
	cmd_pop
	goto message
	end_cmd

cmdkey S
	print "\r\nchSearch for Filename(s)\r\n"
	file_find_name
        end_cmd

cmdkey G
	file_download_batch
	if_true
		end_cmd
                end_if
	compare_ars expert
	if_false
		logoff
	else
		logoff_fast
		end_if
	end_cmd

cmdkey P
	info_user
	pause
	end_cmd

cmdkey I
	print "\r\nchList Extended File Information\r\n"
	getfilespec
	if_true
		file_list_extended
		end_if
        end_cmd

cmdkey J
	file_select_area
        end_cmd

cmdkey E
	file_batch_section
        end_cmd

cmdkey F
	info_xfer_policy
	pause
	cls
	info_directory
	end_cmd

cmdkey 1
	compare_ars SYSOP or exempt Q or I or N
	if_true
		cmd_pop
		goto sysop
		end_if
        end_cmd

end_cmd

############################### Message Section ###############################

:message
cmd_home
async
compare_ars expert
if_false
	clear_abort
	menu wildcat/msg
	print "\r\nwhCommand >>? n"
else
	print "\r\nyh@GRP@ @SUB@, wMESSAGE MENUy: ? n"
	end_if

# Update node status
node_action node_main
getcmd 1GREFSQCUHJT?\r
logkey_comma

cmdkey ?
	compare_ars expert
	if_true
		menu wildcat/msg
		end_if
	end_cmd

cmdkey Q
	cmd_pop
	goto main
	end_cmd

cmdkey R
	cmd_home
	print "n\r\nyhReading Messages: [\1wA\1y]ll messages, [wNy]ew messages, [wSy]earch, "
	print "[wUy]nread personal,\r\n"
	print "[wJy]oin, or [wENTERy] to quit? "
	getstr 5
	logkey

        cmdstr A
		msg_read
                end_cmd

	cmdstr N
		msg_new_scan
		end_cmd

	cmdstr S
		msg_find_text
		end_cmd

	cmdstr U
		msg_your_scan
		end_cmd

	cmdstr J
		msg_select_area
		end_cmd

	cmdstr ""
		cmd_pop
		end_cmd
	print "Invalid command.\r\n"
	cmd_pop
	end_cmd

cmdkey E
	msg_select_area
	if_true
		msg_post
		end_if
	end_cmd

cmdkey F
	cmd_pop
	goto transfers
	end_cmd

cmdkey S
	print "\r\nchSearch for Text in Messages\r\n"
	msg_find_text
        end_cmd

cmdkey C
	print "\r\nchCheck for Messages Posted to You\r\n"
	msg_your_scan
        end_cmd

cmdkey U
	cmd_home
	compare_ars expert
	if_false
		menu maincfg
		end_if
	async
	print "\r\nyhConfig: n"
	getcmd ?QNPIS
	logkey

	cmdkey ?
		compare_ars expert
		if_true
			menu maincfg
			end_if
		end_cmd

	cmdkey N
		msg_new_scan_cfg
		end_cmd

	cmdkey S
		msg_your_scan_cfg
		end_cmd

	cmdkey P
		msg_ptrs_cfg
		end_cmd

	cmdkey I
		msg_ptrs_reinit
		end_cmd

	cmdkey Q
		cmd_pop
		end_cmd

	end_cmd

cmdkey H
	toggle_user_misc UM_EXPERT
	print "\r\nExpert mode is now: "
	compare_ars EXPERT
	if_true
		print "ON"
	else
		print "OFF"
		end_if
	crlf
        end_cmd

cmdkey J
	msg_select_area
        end_cmd

cmdkey T
	msg_qwk
        end_cmd

cmdkey G
	file_download_batch
	if_true
		end_cmd
                end_if
	compare_ars expert
	if_false
		logoff
	else
		logoff_fast
		end_if
        end_cmd

cmdkey 1
	compare_ars SYSOP or exempt Q or I or N
	if_true
		cmd_pop
		goto sysop
		end_if
        end_cmd

end_cmd

################################ Sysop Section ################################

:sysop
cmd_home
async
compare_ars expert
if_false
	clear_abort
	menu wildcat/sysop
	print "\r\nwhCommand >>? n"
else
	print "\r\nyh@GRP@ @SUB@, wSYSOP MENUy: ? n"
	end_if

# Update node status
node_action node_main
getcmd JUQ?NFD1G2A\r
logkey_comma

cmdkey ?
	compare_ars expert
	if_true
		menu wildcat/sysop
		end_if
	end_cmd

cmdkey J
	msg_select_area
        end_cmd

cmdkey U
	setstr "1"
	user_edit
	end_cmd

cmdkey Q
	cmd_pop
	goto main
	end_cmd

cmdkey F
	cmd_pop
	goto transfers
	end_cmd

cmdkey D
	chksyspass
	if_true
		compare_ars "UNIX"
		if_true
			exec_int "%y -i"	
		else
			exec_int "%y"	
			end_if
		end_if
	end_cmd

cmdkey 1
	cmd_pop
	goto message
	end_cmd

cmdkey G
	file_download_batch
	if_true
		end_cmd
                end_if
	compare_ars expert
	if_false
		logoff
	else
		logoff_fast
		end_if
        end_cmd

cmdkey 2
	cmd_pop
	goto transfers
	end_cmd

cmdkey A
	exec_int %!slog
	end_cmd

end_cmd


