YATCO

Share your scripts and packages with other Mudlet users.
Post Reply
User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

YATCO

Post by demonnic »

YATCO is still a working product, but has been replaced by EMCO viewtopic.php?f=6&t=22797 in terms of receiving improved functionality and updates. YATCO will still place a tabbed chat in the corner of your choice, but EMCO provides further styling options, better embedding in existing Geyser UIs, and the added bonus of future updates.


YATCO has been updated to 2.5
Please report issues on GitHub
You should head over to YATCO's github page HERE for more information on YATCO.

Quick Start, for version 2.5

Install base config package.
Code: [show] | [select all] lua
lua local a="https://raw.githubusercontent.com/demonnic/YATCO/master/YATCOConfig.xml"function d(b,c)if not c:find("YATCOConfig",1,true)then return end installPackage(c)os.remove(c)cecho("<lime_green>Package installed!\n")end registerAnonymousEventHandler("sysDownloadDone","d")downloadFile(getMudletHomeDir()..(a:ends("xml")and"/YATCOConfig.xml"or"/YATCOConfig.zip"),a)
once you've installed this, go over the configuration options and set the name of the tabs, etc. Then once you're ready to start up YATCO itself, install the code package. This is for 2.5.
Code: [show] | [select all] lua
lua local a="https://raw.githubusercontent.com/demonnic/YATCO/master/YATCO2.5.xml"function d(b,c)if not c:find("YATCO",1,true)then return end installPackage(c)os.remove(c)cecho("<lime_green>Package installed!\n")end registerAnonymousEventHandler("sysDownloadDone","d")downloadFile(getMudletHomeDir()..(a:ends("xml")and"/YATCO.xml"or"/YATCO.zip"),a)
This will startup the actual tabbed chat using the configs you edited. From this point forward you should be able to just uninstall YATCO and install the new version to pick up any code fixes, etc. I will add additional packages for bringing yourself up to date with configuration options which are added post 2.5.


2.5 adds Map display options. demonnic.chat.config.Maptab defaults to "", if you set it to the same name as one of the tabs in your tablist, it will create a Geyser mapper object in that tab. Leave it as "" in order ignore this functionality.
I also added demonnic.chat.useContainer , which you set to the Geyser container you want YATCO to be contained in. So if you have a container you created with
Code: [show] | [select all] lua
uiRight = Geyser.Container:new()
Then you would do
Code: [show] | [select all] lua
demonnic.chat.useContainer = uiRight
Leave it set to false if you don't want to add YATCO to some other container. This way YATCO will be easier to incorporate into other UI projects. It should be noted that if you stuff YATCO into another container, it will be at x=0, y=0 and both height and width will be 100% of this container. Then to hide or show all of YATCO you can hide or show the container. In the example, uiRight:hide() and uiRight:show(). This also means that the height and width of the chat boxes will be determined by the container you place them in, and not YATCO. This could mean you'll need to adjust your demonnic.chat.config.width until the text wraps properly. I intend to make this autodetect and work itself out in the future, but haven't gotten it in place yet.


OLDER INFO KEPT BELOW
UPDATE: Bumped to 2.4. New download link HERE
Also, you should be able to install using the following in your mudlet inputbar:
Code: [show] | [select all] lua
lua local a="https://raw.githubusercontent.com/demonnic/YATCO/master/YATCO-2.4.xml"function d(b,c)if not c:find("YATCO",1,true)then return end installPackage(c)os.remove(c)cecho("<lime_green>Package installed!\n")end registerAnonymousEventHandler("sysDownloadDone","d")downloadFile(getMudletHomeDir()..(a:ends("xml")and"/YATCO.xml"or"/YATCO.zip"),a)
Please report issues on GitHub

I am starting a new thread, since this version is significantly different from the one I posted to this forum last and the redirection at the top of the last post points to an outside forum. If you're using one of the versions of tabbed chat I wrote which makes use of geyser (all the 2.x ones) then using this should be about the same. If you're on 2.2, the only real changes are I added an alias to fix the blackbox issue on the chats, and I stripped out some leftover kruft from Lusternia, did not need any GMCP handlers in a mud agnostic tabbed chat widget. Scroll to the bottom for the configuration options, but since it's really just a copy/paste job from the configuration options in the script package itself, you almost may as well just go edit it. =)

You can download the xml HERE

I provided an example trigger to send something to the "Org" tab. Simply call demonnic.chat:append("Tabname") to send the line you've triggered upon to the Tabname tab. This is case sensitive, "tabname" is not the same as "Tabname"

There are currently 2 aliases provided with this.

dblink:
turns the blinking on or off. Temporary toggle, to make permanent change the configuration option in the script editor.

fixchat:
In 2.0test5 through 7 there is a slight issue with miniconsoles. If you are using one of the predefined locations for the chat tabs (topright, topleft, bottomright, bottomleft) then running this alias sets the tabbed chat to the opposite corner, redraws the it, then sets it back to where it was before and redraws it again. In my experience this removes the blackbox over the top of the chat console every time. There is a fix for this in git but not yet released. Once it is released this alias will no longer be necessary.
Code: [show] | [select all] lua
--[[
This is where all of the configuration options can be set. 
Anything I've put in this script object can be changed, but please do pay attention to what you're doing.
If you change one of the values to something it shouldn't be, you could break it. 
]]

--This is where you tell it to use tabbed chat.
demonnic.chat.use = true

--[[
The timestamp option is set here.
Set to false if you do not want any timestamps displayed for chat.
If you do want it displayed, set to the string for the format you wish. 
see http://wiki.mudlet.org/w/Manual:Lua_Functions#getTime for information
how to format the string
]]
demonnic.chat.config.timestamp = "HH:mm:ss"

--[[ Should we use our own colors for the timestamp?
Set to true if you want to specify foreground and background colors
for the timestamp.
Set to false if you want the timestamps background and foreground
colors to match that of the mud output.
]]
demonnic.chat.config.timestampCustomColor = false
--[[
and what foreground color? You can either use one of the 'named' colors
(see http://wiki.mudlet.org/images/c/c3/ShowColors.png for available colors)
demonnic.chat.config.timestampFG = "slate_grey"

Or you can use a table of R,G,B values. 
demonnic.chat.config.timestampFG = {
  255,
    0,
    0,
}
then the foreground for the timestamp would be 255 read, 100 green, and 0 blue
]]
demonnic.chat.config.timestampFG = "red"

--and background? Same rules as for the foreground above
demonnic.chat.config.timestampBG = "blue"

--[[
This is where you say what corner of the screen you want the tabbed chat on
Valid settings are "topright", "topleft", "bottomright", "bottomleft"
]]--
demonnic.chat.config.location = "topright"

--[[
This is a table of channels you would like.
AKA the place you tell the script what tabs you want.
Each entry must be a string. The defaults should be a pretty effective guide.
]]

demonnic.chat.config.channels = {
  "All",
  "Org",
  "Guild",
  "Clans",
  "Tells",
  "Says",
  "Misc",
}


--Set this to the name of the channel you want to have everything sent to. 
--Per the default, this would be the "All" channel. If you have a different name for it:
--
--demonnic.chat.config.Alltab = "Bucket"  
--
--And if you don't want it turned on at all:
--
--demonnic.chat.config.Alltab = false

demonnic.chat.config.Alltab = "All"



---------------------------------------------------------------------------------
--                                                                             --
--The infamous blinking stuff!!!                                               --
--                                                                             --
---------------------------------------------------------------------------------

--[[
Do you want tabs to blink when you get new messages, until you click on the tab?
True if yes, false if no.
]]
demonnic.chat.config.blink = true

--How long (in seconds) between blinks? For example, 1 would mean a 1 second pause in between blinks.
demonnic.chat.config.blinkTime = 3

--Blink if the bucket tab ("All" by default, but configured above) is in focus?
demonnic.chat.config.blinkFromAll = false




--Font size for the chat messages

demonnic.chat.config.fontSize = 9

--[[
Should we preserve the formatting of the text. 
Or should we set the background of it to match the window color?
Set this to false if you want the background for all chat to match the background of the window.
Useful if you change the background from black, and don't like the way the pasted chat makes blocks in it
]]

demonnic.chat.config.preserveBackground = false

--[[
Gag the chat lines in the main window?
defaults to false, set to true if you want to gag.
]]

demonnic.chat.config.gag = true

--[[
Number of lines of chat visible at once. 
Will determine how tall the window for the chats is.
]]

demonnic.chat.config.lines = 45

--[[
Number of characters to wrap the chatlines at.
This will also determine how wide the chat windows are.
]]

demonnic.chat.config.width = 60

--[[
Set the color for the active tab. R,G,B format.
The default here is a brightish green
]]

demonnic.chat.config.activeColors = {
  r = 0,
  g = 180,
  b = 0,
}

--[[
Set the color for the inactive tab. R,G,B format.
The default here is a drab grey
]]

demonnic.chat.config.inactiveColors = {
  r = 60,
  g = 60,
  b = 60,
}

--[[
Set the color for the chat window itself. R,G,B format.
Defaulted to the black of my twisted hardened soul. Or something.
]]

demonnic.chat.config.windowColors = {
  r = 0,
  g = 0,
  b = 0,
}

--[[
Set the color for the text on the active tab. Uses color names.
Set the default to purple. So the tab you're looking at, by default will be purple on bright green. 
Did I mention I'm a bit colorblind?
]]

demonnic.chat.config.activeTabText = "purple"

--[[
Set the color for the text on the inactive tabs. Uses color names.
Defaulted this to white. So the tabs you're not looking at will be white text on boring grey background.
]]

demonnic.chat.config.inactiveTabText = "white"

--[[
have to make sure a currentTab is set... 
so we'll use the one for the bucket, or the first one in the channels table
Or, you know... what it's currently set to, if it's already set.
]]
demonnic.chat.currentTab = demonnic.chat.currentTab or demonnic.chat.config.Alltab or demonnic.chat.config.channels[1]
To show the difference between preserveBackground true/false... top is false, bottom is true.
preserveBackground.png
preserveBackground.png (1.25 KiB) Viewed 82322 times

Constin
Posts: 8
Joined: Sat Jan 05, 2013 8:59 pm

Re: YATCO 2.3

Post by Constin »

Ok.
write manual to make trigger
i tryed:
selectString(line,1)
copy()
demonnic.chat.append("All")
ChatStuff.append("Guild")
deselect()

doesnt work

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: YATCO 2.3

Post by demonnic »

There is an included trigger with the package, but it seems I accidentally left it blank. I will fix that for the next release.

you want demonnic.chat:append("Tabname")

It will go to the 'All' tab (or any other name you decide to give it in the bucket option) automatically so long as the option is set for it to do so.

Constin
Posts: 8
Joined: Sat Jan 05, 2013 8:59 pm

Re: YATCO 2.3

Post by Constin »

thank you!
it works!

set it to false if u want to view messages in main window

demonnic.chat.config.gag = false (default true)

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: YATCO 2.3

Post by demonnic »

That's another way to phrase what's in there, yeah.

lexus_3s
Posts: 4
Joined: Wed Jan 02, 2013 2:34 am

Re: YATCO 2.3

Post by lexus_3s »

Ok, I setup the following trigger:

[-Jugger( "begin of line substring"
[-Jugger-] "begin of line substring"

With the following in the code box:

selectString(line,1)
copy()
demonnic.chat:append("All")
demonnic.chat:append("Guild")
deselect()

It is showing the text in the All tab, but not in the Guild tab. Also, it shows my chats twice in all, one with a timestamp.

suggestions?

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: YATCO 2.3

Post by Akaya »

I believe you only need to demonnic.chat:append("Guild"). Sending to the All tab shouldn't be necessary.

There should be a configuration option within the script to turn timestamps off.

lexus_3s
Posts: 4
Joined: Wed Jan 02, 2013 2:34 am

Re: YATCO 2.3

Post by lexus_3s »

Yeah, I figured that out about 45 seconds ago. thanks!

lexus_3s
Posts: 4
Joined: Wed Jan 02, 2013 2:34 am

Re: YATCO 2.3

Post by lexus_3s »

Also, anyone have problems with multi-line chats? IE: Some spammy person sends you a huge tell. Need to make sure stuff doesnt get cut off.

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: YATCO 2.3

Post by demonnic »

Depends on how your MUD handles such things. If they have the option to turn server-side word wrapping off, so that everything comes in as one line and mudlet handles the word wrapping, then you don't need to do anything special.

Otherwise, you have to find some way to trigger to capture the rest of the tell.

Post Reply