Project

General

Profile

 

Also available in: PDF

Accessing Chat Channels and Messages

To use this test script, create a file in your /innerspace/scripts folder called TestEVEChat.iss and place the entire text below. Then, you can run the script by typing the following command in the InnerSpace console (while in the game): run TestEVEChat.

 

function main()
{
    variable index:chatchannel Channels
    variable index:pilot ChannelMembers
    variable index:chatchannelmessage ChannelMessages
    variable iterator ChannelsIterator
    variable iterator ChannelMembersIterator
    variable iterator ChannelMessagesIterator
    
    Chat:GetChannels[Channels]
    Channels:GetIterator[ChannelsIterator]
    
    echo "- Channels: ${Channels.Used}"
    if ${ChannelsIterator:First(exists)}
    do
    {
        echo "- Name:               ${ChannelsIterator.Value.Name}"
        echo "-- ID:                ${ChannelsIterator.Value.ID}"
        echo "-- PilotCount:        ${ChannelsIterator.Value.PilotCount}"
        
        if (${ChannelsIterator.Value.PilotCount} > 0)
        {
            ChannelsIterator.Value:GetMembers[ChannelMembers]
            ChannelMembers:GetIterator[ChannelMembersIterator]
            if ${ChannelMembersIterator:First(exists)}
            do
            {
                echo "--- ${ChannelMembersIterator.Value.Name} (CharID: ${ChannelMembersIterator.Value.CharID})"
            }
            while ${ChannelMembersIterator:Next(exists)}
        }
        
        echo "-- MOTD:              ${ChannelsIterator.Value.MOTD}"
        echo "-- Category:          ${ChannelsIterator.Value.Category}"
        echo "-- LastActivityTime:  ${ChannelsIterator.Value.LastActivityTime}"
        
        ChannelsIterator.Value:GetMessages[ChannelMessages]
        ChannelMessages:GetIterator[ChannelMessagesIterator]
        echo "-- Messages:          ${ChannelMessages.Used}"
        if ${ChannelMessagesIterator:First(exists)}
        do
        {
            echo "--- <${ChannelMessagesIterator.Value.Author.Name}> '${ChannelMessagesIterator.Value.Message}' (${ChannelMessagesIterator.Value.Timestamp})"
        }
        while ${ChannelMessagesIterator:Next(exists)}
    }
    while ${ChannelsIterator:Next(exists)}
}