Mauldor found a chinese script, I have translated it and played with it to work.
It needs more experimenting with it ie what happens when it is full etc.
It has 20 pages
2 docs needed and an NPC
eg
==============================================
merchant.txt
GuestBook 0 447 400 Messenger 0 84
==============================================
QuestDiary\System\GuestBook.txt:
;add this
[content]
[user]
[count]
num=0
[check]
chk=0
[maxnum]
max=60
==============================================
Envir\market_def\Guestbook-0.txt:
;add this
[@main]
#SAY
{FCOLOR/14} [ Welcome to the Mates message system ]\
{FCOLOR/12} [ Attention ]:Please type in your message content, do not exceed (20 letters)\ \
<[I want to leave a message]/@@liuyan>\
<[Examine any messages]/@dqly(1)>\\
[@@liuyan]
#ACT
LoadValue D0 "QuestDiary\System\GuestBook.txt" [check] [chk]
MOV A0 %INPUTSTR
#IF
Equal D0 1
#SAY
_[ Reminder ]:Others are using the message this, please try later ! !\\
_<[Message]/@@liuy>\
_<[Exit]/@exit>\
#ACT
break
#IF
!Checkgold 1000
#SAY
_Your dont have enough gold ! !\\
_<[Back]/@main>\
_<[Exit]/@exit>\
#ACT
break
#IF
Equal A0 ""
#SAY
_[ Reminder ]:You have not left a message l ! !\\
_<[Back]/@main>\
_<Exit/@exit>\
#ACT
break
#ELSEACT
goto @savegb
[@savegb]
#ACT
SaveValue "QuestDiary\System\GuestBook.txt" [check] [chk] 1
LoadValue D0 "QuestDiary\System\GuestBook.txt" [count] [num]
LoadValue P0 "QuestDiary\System\GuestBook.txt" [maxnum] [max]
inc D0 1
#IF
Large D0 %P0
#ACT
mov D0 1
#IF
#ACT
SaveValue "QuestDiary\System\GuestBook.txt" [count] [num] %D0
SaveValue "QuestDiary\System\GuestBook.txt" [content] [%D0] %A0
SaveValue "QuestDiary\System\GuestBook.txt" [user] [%D0] %USERNAME
SaveValue "QuestDiary\System\GuestBook.txt" [check] [chk] 0
take gold 1000
#SAY
_Thank you for using Mates message services! !\\
_<[Back]/@main>\
_<[Exit]/@exit>\
[@dqly()]
#ACT
mov D1 %ARG(1)
LoadValue D2 "QuestDiary\System\GuestBook.txt" [count] [num]
#IF
large D1 %D2
#SAY
{FCOLOR/14}=====[ Mates message system ]====={FCOLOR/12}\
<[I want to leave a message]/@@liuyan>\
Page<1/@dqly(1)>|<2/@dqly(4)>|<3/@dqly(7)>|<4/@dqly(10)>|<5/@dqly(13)>|<6/@dqly(16)>|<7/@dqly(19)>|<8/@dqly(22)>|<9/@dqly(25)>|<10/@dqly(28)>|<11/@dqly(31)
>|<12/@dqly(34)>|<13/@dqly(37)>|<14/@dqly(40)>|<15/@dqly(43)>|<16/@dqly(46)>|<17/@dqly(49)>|<18/@dqly(52)>|<19/@dqly(55)>|<20/@dqly(58)>\\
This page does not have any messages! !
#ACT
break
#IF
#SAY
{FCOLOR/14}=====[ Mates message system ]====={FCOLOR/12}\
<[I want to leave a message]/@@liuyan>\
Page<1/@dqly(1)>|<2/@dqly(4)>|<3/@dqly(7)>|<4/@dqly(10)>|<5/@dqly(13)>|<6/@dqly(16)>|<7/@dqly(19)>|<8/@dqly(22)>|<9/@dqly(25)>|<10/@dqly(28)>|<11/@dqly(31)
>|<12/@dqly(34)>|<13/@dqly(37)>|<14/@dqly(40)>|<15/@dqly(43)>|<16/@dqly(46)>|<17/@dqly(49)>|<18/@dqly(52)>|<19/@dqly(55)>|<20/@dqly(58)>\\
#ACT
inc D2 1
#IF
small D1 %D2
#ACT
LoadValue A1 "QuestDiary\System\GuestBook.txt" [content] [%D1]
LoadValue B1 "QuestDiary\System\GuestBook.txt" [user] [%D1]
mov P1 %D1
inc D1 1
#SAY
(<$OUTPUT(P1)>) {FCOLOR/10}<$OUTPUT(A1)>{FCOLOR/12} ||<$OUTPUT(B1)>\\
#ELSEACT
break
#IF
small D1 %D2
#ACT
LoadValue A2 "QuestDiary\System\GuestBook.txt" [content] [%D1]
LoadValue B2 "QuestDiary\System\GuestBook.txt" [user] [%D1]
mov P2 %D1
inc D1 1
#SAY
(<$OUTPUT(P2)>) {FCOLOR/8}<$OUTPUT(A2)>{FCOLOR/12} ||<$OUTPUT(B2)>\\
#ELSEACT
break
#IF
small D1 %D2
#ACT
LoadValue A3 "QuestDiary\System\GuestBook.txt" [content] [%D1]
LoadValue B3 "QuestDiary\System\GuestBook.txt" [user] [%D1]
mov P3 %D1
#SAY
(<$OUTPUT(P3)>) {FCOLOR/13}<$OUTPUT(A3)>{FCOLOR/12} ||<$OUTPUT(B3)>\\
=============================================
It needs more experimenting with it ie what happens when it is full etc.
It has 20 pages
2 docs needed and an NPC
eg
==============================================
merchant.txt
GuestBook 0 447 400 Messenger 0 84
==============================================
QuestDiary\System\GuestBook.txt:
;add this
[content]
[user]
[count]
num=0
[check]
chk=0
[maxnum]
max=60
==============================================
Envir\market_def\Guestbook-0.txt:
;add this
[@main]
#SAY
{FCOLOR/14} [ Welcome to the Mates message system ]\
{FCOLOR/12} [ Attention ]:Please type in your message content, do not exceed (20 letters)\ \
<[I want to leave a message]/@@liuyan>\
<[Examine any messages]/@dqly(1)>\\
[@@liuyan]
#ACT
LoadValue D0 "QuestDiary\System\GuestBook.txt" [check] [chk]
MOV A0 %INPUTSTR
#IF
Equal D0 1
#SAY
_[ Reminder ]:Others are using the message this, please try later ! !\\
_<[Message]/@@liuy>\
_<[Exit]/@exit>\
#ACT
break
#IF
!Checkgold 1000
#SAY
_Your dont have enough gold ! !\\
_<[Back]/@main>\
_<[Exit]/@exit>\
#ACT
break
#IF
Equal A0 ""
#SAY
_[ Reminder ]:You have not left a message l ! !\\
_<[Back]/@main>\
_<Exit/@exit>\
#ACT
break
#ELSEACT
goto @savegb
[@savegb]
#ACT
SaveValue "QuestDiary\System\GuestBook.txt" [check] [chk] 1
LoadValue D0 "QuestDiary\System\GuestBook.txt" [count] [num]
LoadValue P0 "QuestDiary\System\GuestBook.txt" [maxnum] [max]
inc D0 1
#IF
Large D0 %P0
#ACT
mov D0 1
#IF
#ACT
SaveValue "QuestDiary\System\GuestBook.txt" [count] [num] %D0
SaveValue "QuestDiary\System\GuestBook.txt" [content] [%D0] %A0
SaveValue "QuestDiary\System\GuestBook.txt" [user] [%D0] %USERNAME
SaveValue "QuestDiary\System\GuestBook.txt" [check] [chk] 0
take gold 1000
#SAY
_Thank you for using Mates message services! !\\
_<[Back]/@main>\
_<[Exit]/@exit>\
[@dqly()]
#ACT
mov D1 %ARG(1)
LoadValue D2 "QuestDiary\System\GuestBook.txt" [count] [num]
#IF
large D1 %D2
#SAY
{FCOLOR/14}=====[ Mates message system ]====={FCOLOR/12}\
<[I want to leave a message]/@@liuyan>\
Page<1/@dqly(1)>|<2/@dqly(4)>|<3/@dqly(7)>|<4/@dqly(10)>|<5/@dqly(13)>|<6/@dqly(16)>|<7/@dqly(19)>|<8/@dqly(22)>|<9/@dqly(25)>|<10/@dqly(28)>|<11/@dqly(31)
>|<12/@dqly(34)>|<13/@dqly(37)>|<14/@dqly(40)>|<15/@dqly(43)>|<16/@dqly(46)>|<17/@dqly(49)>|<18/@dqly(52)>|<19/@dqly(55)>|<20/@dqly(58)>\\
This page does not have any messages! !
#ACT
break
#IF
#SAY
{FCOLOR/14}=====[ Mates message system ]====={FCOLOR/12}\
<[I want to leave a message]/@@liuyan>\
Page<1/@dqly(1)>|<2/@dqly(4)>|<3/@dqly(7)>|<4/@dqly(10)>|<5/@dqly(13)>|<6/@dqly(16)>|<7/@dqly(19)>|<8/@dqly(22)>|<9/@dqly(25)>|<10/@dqly(28)>|<11/@dqly(31)
>|<12/@dqly(34)>|<13/@dqly(37)>|<14/@dqly(40)>|<15/@dqly(43)>|<16/@dqly(46)>|<17/@dqly(49)>|<18/@dqly(52)>|<19/@dqly(55)>|<20/@dqly(58)>\\
#ACT
inc D2 1
#IF
small D1 %D2
#ACT
LoadValue A1 "QuestDiary\System\GuestBook.txt" [content] [%D1]
LoadValue B1 "QuestDiary\System\GuestBook.txt" [user] [%D1]
mov P1 %D1
inc D1 1
#SAY
(<$OUTPUT(P1)>) {FCOLOR/10}<$OUTPUT(A1)>{FCOLOR/12} ||<$OUTPUT(B1)>\\
#ELSEACT
break
#IF
small D1 %D2
#ACT
LoadValue A2 "QuestDiary\System\GuestBook.txt" [content] [%D1]
LoadValue B2 "QuestDiary\System\GuestBook.txt" [user] [%D1]
mov P2 %D1
inc D1 1
#SAY
(<$OUTPUT(P2)>) {FCOLOR/8}<$OUTPUT(A2)>{FCOLOR/12} ||<$OUTPUT(B2)>\\
#ELSEACT
break
#IF
small D1 %D2
#ACT
LoadValue A3 "QuestDiary\System\GuestBook.txt" [content] [%D1]
LoadValue B3 "QuestDiary\System\GuestBook.txt" [user] [%D1]
mov P3 %D1
#SAY
(<$OUTPUT(P3)>) {FCOLOR/13}<$OUTPUT(A3)>{FCOLOR/12} ||<$OUTPUT(B3)>\\
=============================================
