GreaseMonkey'ing Cantr - customizing Cantr, clientside

General out-of-character discussion among players of Cantr II.

Moderators: Public Relations Department, Players Department, Players Department Trainee

User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Doug R. » Tue Oct 09, 2012 5:37 pm

Install Greasmonkey if you're running Firefox, or an equivalent program if you're using Chrome (I use Tampermonkey). Download the Cantr enhanced script and install it (easy on Greasemonkey, harder on Chrome),.
Hamsters is nice. ~Kaylee, Firefly
User avatar
EchoMan
Posts: 7768
Joined: Fri Aug 26, 2005 1:01 pm
Location: Stockholm, Sweden

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby EchoMan » Thu Oct 11, 2012 7:50 am

You install the Greasemonkey plugin in FireFox, and then you can use JavaScript and Stylesheets to alter the looks and some behaviour of the game.
User avatar
Estaar
Posts: 1166
Joined: Tue Jun 19, 2012 9:23 am
Location: Luxembourg

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Estaar » Thu Oct 11, 2012 7:51 am

What kind of alterations?
Stranger in a strange land.
User avatar
EchoMan
Posts: 7768
Joined: Fri Aug 26, 2005 1:01 pm
Location: Stockholm, Sweden

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby EchoMan » Thu Oct 11, 2012 8:07 am

It depends on how good a programmer you are. :)

A lot is possible, some useful. The first post in this topic describes how you use it, though that script isn't available any more I think.
User avatar
EchoMan
Posts: 7768
Joined: Fri Aug 26, 2005 1:01 pm
Location: Stockholm, Sweden

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby EchoMan » Thu Nov 29, 2012 11:55 pm

The cantr-grey userscript is now discontinued and not supported anymore.

Instead it is now part of the Cantr skin pack. More news about that follow shortly in another topic. :)
User avatar
Greek
Programming Dept. Member/Translator-Polish
Posts: 4702
Joined: Mon Feb 13, 2006 5:41 pm
Location: Kraków, Poland
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Greek » Fri Nov 30, 2012 1:28 am

Same for Cantr Green.
‘Never! Run before you walk! Fly before you crawl! Keep moving forward! You think we should try to get a decent mail service in the city. I think we should try to send letters anywhere in the world! Because if we fail, I’d rather fail really hugely’
AlchemicRaker
Translator-Japanese (LD)/ProgD Consultant
Posts: 311
Joined: Thu Feb 05, 2009 4:56 am

CVEE: Event and Emote Restyling mod, read events easier now~

Postby AlchemicRaker » Thu Mar 21, 2013 6:36 am

This "userscript" changes the styling of events in Cantr, like so:
Image
Non-chat is darkened, and emotes are tinted and italicized.

For people who what to customize more, I have it mark the entire event, character's names, "quoted" parts of events, and *emoted* parts of events. On top of this, Cantr already marks types of events (you could detect if it was a character talking, or a radio for instance) so there's lots of possibilities.

To use this you'll need either TamperMonkey(Chrome), GreaseMonkey(FireFox), or the equivalent for your browser.

Now get one of the versions of CVEE (this extension/userscript):

Basic Edition - This should work right away, like shown in the image above.
Advanced Edition - There's some instructions on the page to get you started (and the CSS to make it work like the Basic version) so you can make your own styles.
pancakes
Posts: 9
Joined: Fri Jan 18, 2013 7:25 am

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby pancakes » Thu Mar 21, 2013 8:58 am

Thanks!
User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby Doug R. » Thu Mar 21, 2013 1:20 pm

Interesting. Thanks!
Hamsters is nice. ~Kaylee, Firefly
User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby Doug R. » Thu Mar 21, 2013 1:24 pm

You don't need Tampermonkey if you're running Chrome. You can install it natively in the browser. Just download the script and drag it onto your extensions page.
Hamsters is nice. ~Kaylee, Firefly
User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby Doug R. » Thu Mar 21, 2013 1:27 pm

If anyone is good at modding this, I'd like to mod it extensively for my own purposes. I could learn myself, but if someone can do it in a few minutes and it willing to do it for me, then I won't have to expend that time.
Hamsters is nice. ~Kaylee, Firefly
Navi
Posts: 87
Joined: Tue Dec 06, 2011 5:54 pm

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby Navi » Thu Mar 21, 2013 4:02 pm

Doug R. wrote:If anyone is good at modding this, I'd like to mod it extensively for my own purposes. I could learn myself, but if someone can do it in a few minutes and it willing to do it for me, then I won't have to expend that time.


I can look into it if you want. I've already modified mine to pick up # emotes and ** emotes. I haven't figured out the hyphen emotes used by Spanish characters yet. The simple approach gets confused by the hyphen in the date/time at the beginning of the event. Maybe stripping off the time first, then working on the rest will work.

This is similar to the approach I used for formatting the text in the turn report tool.
AlchemicRaker
Translator-Japanese (LD)/ProgD Consultant
Posts: 311
Joined: Thu Feb 05, 2009 4:56 am

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby AlchemicRaker » Thu Mar 21, 2013 5:21 pm

Doug R. wrote:If anyone is good at modding this, I'd like to mod it extensively for my own purposes. I could learn myself, but if someone can do it in a few minutes and it willing to do it for me, then I won't have to expend that time.

I could probably do it if it's not terribly complicated. What kind of modding do you mean? To the script itself?

@Navi, I'll try and make a code to match paired - emotes. #'d emotes use pairs of # too, right?
Navi
Posts: 87
Joined: Tue Dec 06, 2011 5:54 pm

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby Navi » Thu Mar 21, 2013 5:43 pm

Yes. My current pattern is

Code: Select all

/[#\*]+[\s\S]*?[#\*]+/g
Just adding # to the list of characters conflicts with specifying the color for quotes in the basic version though.
AlchemicRaker
Translator-Japanese (LD)/ProgD Consultant
Posts: 311
Joined: Thu Feb 05, 2009 4:56 am

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby AlchemicRaker » Thu Mar 21, 2013 5:48 pm

I've updated both Basic & Advanced scripts to be a little more robust and to (optionally) include *emotes*, #emotes#, and -emotes- (only * and # are enabled by default).

Navi wrote:Yes. My current pattern is

Code: Select all

/[#\*]+[\s\S]*?[#\*]+/g
Just adding # to the list of characters conflicts with specifying the color for quotes in the basic version though.

Already ran into that and fixed it. If you DO find any interesting cases that the new queries break on, let me know though, I'll keep fixing it up. Did you change anything else about the mod?

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest