[EasyUO] ReReader 0.91 (Chat/Journal Viewer)

If you make a Client-side script you can publish it here for other players to use
Post Reply
User avatar
Devlin
Legendary Scribe
Posts: 652
Joined: Thu Mar 18, 2010 12:50 pm

[EasyUO] ReReader 0.91 (Chat/Journal Viewer)

Post by Devlin »

I got bored and decided to play around with a few scripts. Here's the first of the few I've been toying with, an updated version of the guild/global chat viewer that's been floating around forever. You can filter on guild or global chat, or have both displayed.

The nifty part of this version is that it archives/records all guild and global chat since the script was started. Switching the chat type filter will not lose any message history; instead, every message since the script was started is stored and will be displayed in the journal when you swap types. So if you start the script in guild chat mode and swap to global chat 20 minutes later, all global chat messages from that that 20 minutes will be added to the journal. Then, if you swap back to guild chat, you'll have all the messages you had from guild chat previously, plus any additional messages you may have missed while filtered on global. Nothing crazy, but preserving fidelity/all messages can be handy.

- The default chat filter is whatever type you had selected when you ran the script last.
- Clicking the settings button will open a prompt to save the window location, so it will open in the same spot every time.

Two things to note.
1. Worked out a few kinks, namely clashes with Rearmer. If you hit any issues, let me know.
2. If you've been running the script for a long period/recorded a lot of messages, swapping chat types may take a moment to fully populate all message history. If it becomes an issue, I may add something to only include the last 100 messages. Or not, iunno.

Code: Select all

; Script: ReReader
; Author: Devlin
; Current Version: 0.91
; Purpose: It's a journal. Not the diary kind.
; Shows global or guild chat. Or both.
;
; The script archives all chat (until it is stopped).
;
; Selecting guild/global will display all chat messages
; of that type, going back to when the script started.
;
; The chat type selected last time will be the default type
; upon the next startup. To save the location of the window,
; click "Settings" and follow the instructions.
;=============================================

set #menubutton N/A
set %indexB 0
set %indexG 0
set %indexC 0
set %newLine #journal
gosub Menu
set #menubutton *DefaultChat

loop:
    scanJournal 1
    if #menubutton = CLOSED
       stop
    if #menubutton = Guild
        gosub Buttons Guild G 1
    if #menubutton = Global
        gosub Buttons Global C 2
    if #menubutton = Both
        gosub Buttons Both B 3
    if #menubutton = Settings
        gosub Buttons Settings ;#cursorX #cursorY

    gosub Scan
goto loop:

sub Scan
    if %newLine <> #journal
    {
        set %temp #journal
        str Left %temp 1
        set %type #strres
        if  #STRRES = < || #STRRES = [
        {
            set %string #journal
            loop2:
            str Pos %string _
            set %pos #strRes
            str Del %string #strRes 1
            str Ins #strRes #spc %pos
            set %string #strRes
            str Count %string _
            if #strRes > 0
              goto loop2

            set %indexB %indexB + 1
            if %type = < && %type <> [
            {
                gosub time
                ;set %time <
                set %indexG %indexG + 1
                set %stringG . %indexG %time , #spc , %string
                set %stringB . %indexB %time , #spc , %string
                gosub Write G
            }
            if %type = [ && %type <> <
            {
                set %indexC %indexC + 1
                set %stringC . %indexC %string
                set %stringB . %indexB %string
                gosub Write C
            }
            if  %type = < || %type = [
            {
                gosub Write B
            }

            set %newLine #journal
            ;gosub Write B
        }
    }
return

sub Write
    if %chatType = %1
    {
        set %tempI index , %1
        set %tempS string , %1 , % . %tempI
        set %reString % . %tempS
        set %reIndex % . %tempI

        menu List Add mainBuffer %reString
        menu List Select mainBuffer %reIndex
    }
return

sub ReMenu
    gosub Menu
    if %index . %1 > 0
    {
        for %i 1 %index . %1
        {
            set %tempS string , %1 , %i
            set %tempI index , %1
            set %reString % . %tempS
            set %reIndex % . %tempI
            menu List Add mainBuffer %reString
        }
        menu List Select mainBuffer %reIndex
    }
return

sub Menu
    menu clear
    menu Window Title Chat Viewer - Both
    menu Window transparent 90
    menu Font Transparent #false
    menu Font Size 8
    menu Font Align left
    menu Window Color grey
    menu Window Size 675 200
    menu Font BGColor grey
    menu Font Color black
    menu List Create mainBuffer 0 0 675 200
    menu Button Guild 475 175 50 25 Guild
    menu Button Global 525 175 50 25 Global
    menu Button Both 575 175 50 25 Both
    menu Button Settings 625 175 50 25 Settings
    ;if %startup = 0
    ;{
    ;menu Font BGColor green
    ;menu Font Color white
    ;menu Button Both 575 175 50 25 Both
    ;}
    menu Show *reReaderX *reReaderY
return

sub Buttons
    set #menubutton N/A
    if %1 = Settings
    {
        display yesnocancel Save the current position of the window, so that it opens in this position next startup?
        if #dispres = yes
        {
            display OKCancel Please move your mouse in the center the red circle in the menu. You have 3 seconds to do so. $$Hit Cancel if you do not wish to save the menu location.
            if #dispres = OK
            {
                menu clear
                menu Window transparent 100
                menu Shape ShapeC 325 80 10 10 1 6 1 red 7 red
                ;menu Show
                wait 3s
                set *reReaderX #cursorX - 325
                set *reReaderY #cursorY - 80
            }
        }
        gosub ReMenu %2
        return
    }
    event sysmessage Switching to %1 chat.
    set *DefaultChat %1
    set %chatType %2
    ;set %chatType2 %2
    set %temp %1
    set %temp2 425 + ( 50 * %3 )
    gosub ReMenu %2
    menu Window Title Chat Viewer - %temp
    menu Font BGColor green
    menu Font Color white
    menu Button %temp %temp2 175 50 25 %temp
return

sub time
    set %time #time
    str left %time 2
    set %hr #strres + 4
    str mid %time 3 2
    set %min #strres
    if %hr > 24
       set %hr %hr - 24
    if %hr = 24
       set %hr 00
    str len %hr
    if #strres = 1
       set %hr 0 , %hr
    set %time [ , %hr , : , %min , ]
return

Resident Wiki Editor/Village Idiot

EasyUO Scripts
ReArmer
ReArmer (Old Version)
ReReader
Separate Journal for Guild or Public Chat (Old)
---------------------------------------------
Combat Focus Guide (Godmode Formula)
Post Reply