Hi, here's my code for displaying the battle log (RPG style game).
add a stringlist attribute to the game object, call it "battleLog". This will be the data storage for all the messages that will be to printed.
store every message of the "attacktheplayer" turnscript ("you miss...", "the enemy hits...", etc.) in the stringlist with this code:
see http://docs.textadventures.co.uk/quest/using_lists.html for reference.
add (game.battleLog, message)
foreach(entry, game.battleLog) {
request(Hide, "Command") // this is for hiding the command bar while while the timer display the logs.
EnableTimer (displayBattleLog)
}
<timer name="displayBattleLog">
<interval>4</interval>
<script><![CDATA[
message= StringListItem (game.battleLog, 0)
msg ("<br>" + message) // this prints the message
JS.scrollToEnd () // this scrolls the text to the bottom of the GUI
list remove (game.battleLog, message) //this removes the message from the list after it is displayed.
// Now checks if the list is empty.
// If it is, the TIMER stops the the command bar is dislayed, as normal.
if(ListCount(game.battleLog) = 0){
DisableTimer (displayBattleLog)
request(Show, "Command")
}
]]>
</script>
</timer>