# renegade.src

# $Id: renegade.src,v 1.12 2011/08/31 00:28:17 rswindell Exp $

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

!include sbbsdefs.inc

################################# Begins Here #################################
or _sys_misc SM_RA_EMU  # Swap Msg ReRead/Reply commands
:main
# Set return point for main menu commands (via end_cmd)
cmd_home

# Display text/menu/main.* if not in expert mode
compare_ars expert
if_false
	cls
	menu renegade/main
	end_if

# Update node status
node_action node_main
async

# Display main Prompt
compare_ars exempt T
if_true
	print "n\r\nbhTime Used: [c@TUSED@b]  "
else
	print "n\r\nbhTime Left: [c@TLEFT@b]  "
	end_if

print "bh(c?b=cHelpb)\r\nMain Menu m: n"

# Get key (with / extended commands allowed)
compare_user_misc UM_COLDKEYS
if_false
	getkeye
else
	getstrupr 60
        endif

# Do nothing for control keys and space
cmdkey ^@
	end_cmd
cmdkey ^M
	end_cmd
cmdkey ^S
	end_cmd
 cmdkey  "
	end_cmd

# Write command to log file
logkey_comma

# Show the key hit
compare_user_misc UM_COLDKEYS
if_false
	printkey
        endif

cmdkey F
	cmd_pop
	goto file_transfers
        end_cmd

compare_user_misc UM_COLDKEYS
if_false
	crlf
	end_if
pause_reset

# Menu
cmdkey ?
	compare_ars expert
	if_true
		cls
		menu renegade/main
		end_if
	end_cmd

# Sysop Menu
compare_ars SYSOP or exempt Q or I or N
if_true
	cmdkey *
		call sysop
		end_cmd
	end_if

# Commands

cmdkey A
	auto_message
	end_cmd

cmdkey C
	exec_bin chat_sec
	end_cmd

cmdkey E
	cmd_pop
	goto E-mail
	end_cmd

cmdkey G
        file_download_batch
        if_true
                end_cmd
                end_if
        logoff
        end_cmd

cmdkey /G
        file_download_batch
        if_true
                end_cmd
                end_if
        logoff_fast
        end_cmd

cmdkey I
	call main_info
	end_cmd

cmdkey W
	nodelist_users
	end_cmd

cmdkey L
	userlist_logons
	end_cmd

cmdkey /L
	nodelist_all
	end_cmd

cmdkey $
	minute_bank
	end_cmd

cmdkey M
	cmd_pop
	goto message
	end_cmd

cmdkey N
	setstr "1"
	mail_send_feedback
	end_cmd

cmdkey O
        exec_bin xtrn_sec
        end_cmd

cmdkey P
        user_defaults
        end_cmd

cmdkey !
	msg_qwk
	end_cmd

cmdkey S
	text_file_section
	end_cmd

cmdkey U
	userlist_all
	end_cmd

cmdkey X
	toggle_user_misc UM_expert
	end_cmd

cmdkey Y
	info_user
	end_cmd

# fall through
print "\r\nchUnrecognized command."
compare_ars expert
if_true
	print " Hit 'i?nch' for a menu."
	end_if
crlf
end_cmd

# shouldn't hit next line
print "Problem in command shell."
pause
hangup

############################### E-mail Section ################################

:e-mail
cmd_home
compare_ars expert
if_false
	cls
	menu renegade/email
	end_if
async
compare_ars exempt T
if_true
	print "n\r\nbhTime Used: [c@TUSED@b]  "
else
	print "n\r\nbhTime Left: [c@TLEFT@b]  "
	end_if

print "bh(c?b=cHelpb)\r\nEmail Menu m: n"

# Get key (with / extended commands allowed)
compare_user_misc UM_COLDKEYS
if_false
	getkeye
else
	getstrupr 60
        endif

# Do nothing for control keys and space
cmdkey ^@
	end_cmd
cmdkey ^M
	end_cmd
cmdkey ^S
	end_cmd
 cmdkey  "
        end_cmd

logkey

# Show the key hit
compare_user_misc UM_COLDKEYS
if_false
	printkey
        endif

compare_user_misc UM_COLDKEYS
if_false
	crlf
	end_if
pause_reset

cmdkey ?
	compare_ars expert
	if_true
		cls
		menu renegade/email
		end_if
	end_cmd

cmdkey E
	print "_\r\nbhE-mail (User name or number): w"
	getname 40
	compare_str ""
	if_true
		end_cmd
		end_if
	compare_str "SYSOP"
	if_true
		setstr "1"
		end_if
	mail_send
	end_cmd

cmdkey R
	mail_read
	end_cmd

cmdkey V
	mail_read_sent
	end_cmd

# Netmail
cmdkey N
        int i
        copy i _netmail_misc
        or i _inetmail_misc
        and i NMAIL_FILE
        compare i 0
        if_false
		no_yes "\r\nAttach a file"
		end_if
	if_true
		mail_send_netmail
	else	
		mail_send_netfile
		end_if
	end_cmd

cmdkey Q
	cmd_pop
	goto main
	end_cmd

cmdkey G
        file_download_batch
        if_true
                end_cmd
                end_if
        logoff
        end_cmd

cmdkey /G
        file_download_batch
        if_true
                end_cmd
                end_if
        logoff_fast
        end_cmd

# fall through
print "\r\nchUnrecognized command."
compare_ars expert
if_true
	print " Hit 'i?nch' for a menu."
	end_if
crlf
end_cmd


########################### Main Config Section  ##############################

:main_cfg

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

cmdkey ?
	compare_ars expert
	if_true
		menu maincfg
		end_if
	goto main_cfg
	end_cmd

cmdkey N
	msg_new_scan_cfg
	return
	end_cmd

cmdkey S
	msg_your_scan_cfg
	return
	end_cmd

cmdkey P
	msg_ptrs_cfg
	return
	end_cmd

cmdkey I
	msg_ptrs_reinit
	return
	end_cmd

return

########################### File Transfer Section #############################

:file_transfers

cmd_home

compare_ars expert
if_false
	cls
	menu renegade/transfer
	end_if

# Update node status
node_action node_xfer
async

# Display main Prompt
print "n\r\nbh[@LIB@ @DIR@]\r\n"
compare_ars exempt T
if_true
	print "bhTime Used: [c@TUSED@b]  "
else
	print "bhTime Left: [c@TLEFT@b]  "
	end_if

print "bh(c?b=cHelpb)\r\nFile Menu m: n"

# Get key (with / extended commands allowed)
compare_user_misc UM_COLDKEYS
if_false
	getkeye
else
	getstrupr 60
        endif

# Do nothing for control keys and space
cmdkey ^@
	end_cmd
cmdkey ^M
	end_cmd
cmdkey ^S
	end_cmd
 cmdkey  "
        end_cmd

# Write command to log file
logkey_comma

# Hitting number changes current sub-board
cmdkey digit
	compare_user_misc UM_COLDKEYS
	if_false
		ungetkey
                end_if
	file_get_dir_num
	end_cmd

# Hitting /number changes current group
cmdkey edigit
	compare_user_misc UM_COLDKEYS
	if_false
		ungetkey
	else
		shift_str 1
                end_if
	file_get_lib_num
	end_cmd

# Show the key hit
compare_user_misc UM_COLDKEYS
if_false
	printkey
        endif

# Next library
cmdkey ]
	file_directory_up
	end_cmd

# Previous library
cmdkey [
	file_directory_down
	end_cmd

cmdkey Q
	cmd_pop
	goto main
        end_cmd

compare_user_misc UM_COLDKEYS
if_false
	crlf
	end_if
pause_reset

# Menu
cmdkey ?
	compare_ars expert
	if_true
		cls
		menu renegade/transfer
		end_if
	end_cmd

# Sysop Menu
compare_ars SYSOP or exempt Q or I or N
if_true
	cmdkey *
		call sysop
		end_cmd
	end_if

# Commands

cmdkey E
	file_batch_section
	end_cmd

cmdkey C
	exec_bin chat_sec
	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 /D
	file_download_user
	end_cmd

cmdkey F
	print "\r\nchFind Text in File Descriptions (no wildcards)\r\n"
	file_find_text
	end_cmd

cmdkey /F
	file_find_text_all
	end_cmd

cmdkey A
	file_show_directories
	end_cmd

cmdkey /*
	file_show_libraries
	end_cmd

cmdkey J
	file_select_area
	end_cmd

cmdkey L
	print "\r\nchList Files\r\n"
	getfilespec
	if_true
		file_list
		end_if
	end_cmd

cmdkey /L
	nodelist_all
	end_cmd

cmdkey M
	cmd_pop
	goto message
	end_cmd

cmdkey N
	print "\r\nchNew File Scan\r\n"
	file_new_scan
	end_cmd

cmdkey /N
	file_new_scan_all
	end_cmd

cmdkey G
	file_download_batch
	if_true
		end_cmd
                end_if
	logoff
	end_cmd

cmdkey /G
	file_download_batch
	if_true
		end_cmd
                end_if
	logoff_fast
        end_cmd

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

cmdkey /S
	file_find_name_all
	end_cmd

cmdkey /A
	file_temp_section
	end_cmd

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

cmdkey /U
	file_upload_user
	end_cmd

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

cmdkey P
	file_ptrs_cfg
	end_cmd

cmdkey Y
	info_user
	end_cmd

cmdkey Z
	print "\r\nchUpload File to Sysop\r\n"
	file_upload_sysop
	end_cmd

cmdkey #
	print "\r\nncEnter the number of the directory to change to.\r\n"
	end_cmd

cmdkey /#
	print "\r\nncEnter the number of the library to change to.\r\n"
        end_cmd

# fall through
print "\r\nchUnrecognized command."
compare_ars expert
if_true
	print " Hit 'i?nch' for a menu."
	end_if
crlf
end_cmd

# shouldn't hit next line
print "Problem in command shell."
pause
hangup

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

:message
cmd_home
compare_ars expert
if_false
	cls
	menu renegade/message
	end_if

# Update node status
node_action node_main
async

# Display main Prompt
print "n\r\nbh[@GRP@ @SUB@]\r\n"
compare_ars exempt T
if_true
	print "bhTime Used: [c@TUSED@b]  "
else
	print "bhTime Left: [c@TLEFT@b]  "
	end_if

print "bh(c?b=cHelpb)\r\nMessage Menu m: n"

# Get key (with / extended commands allowed)
compare_user_misc UM_COLDKEYS
if_false
	getkeye
else
	getstrupr 60
        endif

# Do nothing for control keys and space
cmdkey ^@
	end_cmd
cmdkey ^M
	end_cmd
cmdkey ^S
	end_cmd
 cmdkey  "
	end_cmd

# Write command to log file
logkey_comma

# Hitting number changes current sub-board
cmdkey digit
	compare_user_misc UM_COLDKEYS
	if_false
		ungetkey
                end_if
	msg_get_sub_num
	end_cmd

# Hitting /number changes current group
cmdkey edigit
	compare_user_misc UM_COLDKEYS
	if_false
		ungetkey
	else
		shift_str 1
                end_if
	msg_get_grp_num
        end_cmd

# Show the key hit
compare_user_misc UM_COLDKEYS
if_false
	printkey
        endif

cmdkey ?
        compare_ars expert
        if_true
		cls
                menu renegade/message
                end_if
        end_cmd

cmdkey Q
	cmd_pop
        goto main
        end_cmd

cmdkey [
	msg_subboard_down
	end_cmd

cmdkey ]
	msg_subboard_up
	end_cmd

compare_user_misc UM_COLDKEYS
if_false
	crlf
	end_if
pause_reset

cmdkey A
	msg_show_subboards
	end_cmd

cmdkey /A
	msg_show_groups
	end_cmd

cmdkey C
	exec_bin chat_sec
	end_cmd

cmdkey /L
	nodelist_all
	end_cmd

cmdkey N
	msg_new_scan
	end_cmd

cmdkey R
	msg_read
	end_cmd

cmdkey P
	msg_post
	end_cmd

cmdkey F
	cmd_pop
	goto file_transfers
	end_cmd

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

cmdkey U
	userlist_sub
	end_cmd

cmdkey G
	file_download_batch
	if_true
		end_cmd
                end_if
	logoff
	end_cmd

cmdkey /G
	file_download_batch
	if_true
		end_cmd
                end_if
	logoff_fast
        end_cmd

cmdkey E
	print "_\r\nbhE-mail (User name or number): w"
	getname 40
	compare_str ""
	if_true
		end_cmd
		end_if
	compare_str "SYSOP"
	if_true
		setstr "1"
		end_if
	mail_send
        end_cmd

cmdkey J
	msg_select_area
        end_cmd

cmdkey Y
	msg_your_scan
	end_cmd

cmdkey Z
	call main_cfg
	end_cmd

cmdkey #
	print "\r\nncEnter the number of the sub-board to change to.\r\n"
	end_cmd

cmdkey /#
	print "\r\nncEnter the number of the message group to change to.\r\n"
        end_cmd

# fall through
print "\r\nchUnrecognized command."
compare_ars expert
if_true
	print " Hit 'i?nch' for a menu."
	end_if
crlf
end_cmd

############################## Sysop Commands #################################

:sysop
cmd_home
menu sysmain
print "n\r\nchSelect an option (or Q to quit): n"
getstrupr 40

cmdstr "Q"
        cmd_pop
        return
        end_cmd

exec_bin "str_cmds %s"

end_cmd


############################ Main Info Section  ###############################

:main_info
cmd_home
compare_ars expert
if_false
	menu maininfo
	end_if
async
print "\r\nyhInfo: n"
getcmd ?QISVY\r
logkey

cmdkey ?
	compare_ars expert
	if_true
		menu maininfo
		end_if
	end_cmd

cmdkey I
	info_system
	end_cmd

cmdkey S
	info_subboard
	end_cmd

cmdkey Y
	info_user
	end_cmd

cmdkey V
	info_version
	end_cmd

cmdkey Q
	cmd_pop
	return
	end_cmd

cmd_pop
return

