;;;;;;;;;;;;;;;;;;;;;;;;Guild Notice Board;;;;;;;;;;;;;;;;
[@GuildNoticeMain]
{
#ACT
   Mov   A5   ""
   LoadValue  D9 "QuestDiary\System\GuildNoticeBoard\GuildInfo.txt" [%GUILDNAME] Total
   LoadValue  D0 "QuestDiary\System\GuildNoticeBoard\UserInfo.txt" [%USERNAME] Current
#IF
   !EQUAL D9 0
#ACT 
   Goto @NothingNew
#ELSEACT
   Goto @NewGuild

[@NothingNew]
#ACT
   AddStr  A5   %GUILDNAME
   AddStr  A5   %D0
   LoadValue A8 "QuestDiary\System\GuildNoticeBoard\NoticeAuthor.txt" [NoticeAuthor] [%A5]
   LoadValue A7 "QuestDiary\System\GuildNoticeBoard\NoticeContent.txt" [NoticeContent] [%A5]
   LoadValue A6 "QuestDiary\System\GuildNoticeBoard\NoticeTitle.txt" [NoticeTitle] [%A5]
#SAY
   <[ View Guild Notices ]/@LookAtNew>\
   <[ Exit ]/@exit>\

[@LookAtNew]
#ACT
#SAY
   Posted By :{FCOLOR/14}(<$OUTPUT(A8)>){FCOLOR/12}\
   Title :{FCOLOR/10} (<$OUTPUT(A6)>){FCOLOR/12}\
   {FCOLOR/10}(<$OUTPUT(A7)>){FCOLOR/12}\\\
   <[ Previous ]/@Previous>\
   <[ Next ]/@Next>\
   <[ Post New ]/@PostNew>\
   <[ Exit ]/@exit>\\

[@Next]
#IF
   Equal D0 %D9
#SAY
   No Newer Posts\
   <[ Show Latest Post ]/@GuildNoticeMan>\
#ELSEACT
   Inc   D0 1
   SaveValue "QuestDiary\System\GuildNoticeBoard\UserInfo.txt" [%USERNAME] [Current] %D0
   DelayGoto [local] 1 @GuildNoticeMan
#ELSESAY
   Please Wait...\

[@Previous]
#IF
   Equal D0 1
#SAY
   No Older Posts\
   <[ Show Latest Post ]/@GuildNoticeMan>\
#ELSEACT
   Dec   D0 1
   SaveValue "QuestDiary\System\GuildNoticeBoard\UserInfo.txt" [%USERNAME] [Current] %D0
   DelayGoto [local] 1 @GuildNoticeMan
#ELSESAY
   Please Wait...\

[@PostNew]
#say
   What would you like to say?
   <[ Enter the Content of the Message ]/@@PostNew1>

[@@PostNew1]
#ACT
   Mov  A1  %INPUTSTR
#IF
   !Equal A1 ""
#SAY
   Is this Correct?\\
   <$OUTPUT(A1)>\\
   <[ Enter Message Title ]/@@PostNew2>\
   <[ Re-Enter Content ]/@PostNew>\
   <[ Exit ]/@exit>\
#ELSESAY
   The message content cannot be empty\
   <[ Start Again! ]/@PostNew>\
   <[ Exit ]/@exit>\

[@@PostNew2]
#ACT
   Mov  A6  %INPUTSTR
#IF
   !Equal A6 ""
#SAY
   Is this Correct?\\
   <$OUTPUT(A6)>\\
   <[ Message Complete ]/@PostNew3>\
   <[ Start Again! ]/@PostNew>\
   <[ Exit ]/@exit>\
#ELSESAY
   The message title cannot be empty\
   <[ Start Again! ]/@PostNew>\
   <[ Exit ]/@exit>\


[@PostNew3]
#ACT
   Mov   A5   ""
   LoadValue  D9 "QuestDiary\System\GuildNoticeBoard\GuildInfo.txt" [%GUILDNAME] Total
   AddStr  A5   %GUILDNAME
   Inc   D9   1
   AddStr  A5   %D9
   SaveValue "QuestDiary\System\GuildNoticeBoard\NoticeTitle.txt" [NoticeTitle] [%A5] %A6
   SaveValue "QuestDiary\System\GuildNoticeBoard\NoticeContent.txt" [NoticeContent] [%A5] %A1
   SaveValue "QuestDiary\System\GuildNoticeBoard\NoticeAuthor.txt" [NoticeAuthor] [%A5] %USERNAME
   SaveValue "QuestDiary\System\GuildNoticeBoard\GuildInfo.txt" [%GUILDNAME] [Total] %D9
   DelayGoto  [local]
#SAY
   Congratulations, Your Notice has been posted!\

[@NewGuild]
#ACT
   Mov   A5   ""
   AddStr  A5   %GUILDNAME
   Inc   D9   1
   AddStr  A5   %D9
   Mov   A6   "Welcome"
   Mov   A1   "Welcome to the Guild Notice Board"
   Mov   A2   "Sting"
   SaveValue "QuestDiary\System\GuildNoticeBoard\NoticeTitle.txt" [NoticeTitle] [%A5] %A6
   SaveValue "QuestDiary\System\GuildNoticeBoard\NoticeContent.txt" [NoticeContent] [%A5] %A1
   SaveValue "QuestDiary\System\GuildNoticeBoard\NoticeAuthor.txt" [NoticeAuthor] [%A5] %A2
   SaveValue "QuestDiary\System\GuildNoticeBoard\GuildInfo.txt" [%GUILDNAME] [Total] %D9
   SaveValue "QuestDiary\System\GuildNoticeBoard\UserInfo.txt" [%USERNAME] [Current] 1
   DelayGoto [local]  1 @GuildNoticeMan
}

;;;;;;;;;;;;;;;;;;;;;;;;Script by Mick;;;;;;;;;;;;;;;;

