The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
# $File: //depot/OurNet-BBSAgent/BBSAgent/maple2/board.inc $ $Author: autrijus $
# $Revision: #10 $ $Change: 2899 $ $DateTime: 2002/01/17 22:20:11 $
# Contributed by Smartboy <kcwu@ck.tp.edu.tw>

Maple2/SOB Board

load maple2.base

setv cursor	¡´
setv morehead	m/\e\[0?m\e\[(?:[\d;]+)m\x20\x20ÂsÄý\x20P./
setv moretail	m/\[q\]\e\[30mµ²§ô\x20\x20\x20\e\[0?m/
setv postsign	0 # ñ¦WÀɦb post «á°Ý
setv escape	\cU
setv leftparen	(
setv rightparen	)

# °²³]¦b¥D¿ï³æ¤Î¬ÝªO¤º, ³£¥i¥H select board
=board
send s
wait ¦WºÙ
send $[board]\n\x20\x20
wait ªO¥D¡G
till ¤å³¹¿ïŪ

=board_list_last
call board $[board]
send 1\n\x24h\x20
wait ªO¥D¡G
wait \x0d$[cursor]
till /
exit

=board_article_fetch_first
call board $[board]
send $[article]\n\n
wait m/\e\[2?J/
till $[morehead]
wait $[leftparen]
till $[rightparen]
wait $[moretail]
exit

=board_article_fetch_next
send \x20
till $[morehead]
wait $[leftparen]
till $[rightparen]
wait $[moretail]
exit

=board_article_fetch_last
send qq
wait ¤å³¹¿ïŪ
exit

=board_list_author
call board $[board]
send a$[author]\n
wait $[cursor]
till ¤å³¹¿ïŪ
exit

=article_post_raw
call board $[board]
send \cP$[title]\n
doif $[postsign]
else
  send 0\n
endo
send $[body]
#send \e,\cY\cY\cY\cY
send \cX
send \cXs\n
wait (E)Ä~Äò½s¿è (W)±j¨î¼g¤J¡H[E]
  or \e[m
doif $[1]
    send w\n
endo
doif $[postsign]
  send 0\n
endo
send \x20
doif $[author]
    call article_edit_author $[author]
endo # ?
exit

=article_edit_author
send \x24E\cY\cY\cY\cY
# 1 empty 2 from 3 origin 4 --
send \cXs\n
wait ¤å³¹¿ïŪ
exit

=article_edit_raw
send E$[content]\x18
wait Àɮ׳B²z
send s\n
doif $[postsign]
  send 0\n
endo
send \x20
doif $[author]
    call article_edit_author $[author]
endo
exit