Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eureka: add ability to import times from web tracker #103

Merged
merged 2 commits into from
Apr 21, 2018

Conversation

christianhood
Copy link
Contributor

Hi, I've made it so that you can take the clipboard copy function from ffxiv-eureka.com
image and paste them into the game
e.g. /e ★ NMs on cooldown: Sabo (70m) > Emperor (82m) > Pazuzu (85m) > Caym (98m) > Amemet (110m)
This will grab the times and update them on the cactbot tracker.

Copy link
Owner

@quisquous quisquous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks great and it's a really needed improvement 👍! I have just one quick change for you to make, and then I'll commit this.

Noranda that runs the tracker said they'd add a public nm cooldown API so this can get done automatically in the future.

@@ -404,6 +405,22 @@ class EurekaTracker {
if (match) {
this.currentTracker = match[1];
}
match = log.match(gImportRegex);
if (match) {
var webKeys = ['Sabo', 'Lord', 'Teles', 'Emperor', 'Callisto', 'Number', 'Jaha', 'Amemet', 'Caym', 'Bomba', 'Serket', 'Julika', 'Rider', 'Poly', 'Strider', 'Hazmat', 'Fafnir', 'Amarok', 'Lamashtu', 'Pazuzu'];
Copy link
Owner

@quisquous quisquous Apr 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move these up to zone info dict up top? Maybe just add a trackerKey field to each of them with this string, e.g.

lama: {
  name: 'Lama',
  mobName: 'Lamashtu',
  trackerKey: 'Lamashtu',
  x: 7.7,
  y: 25.3,
  time: 'Night',
},

There's going to be some other Eureka zone soon, so having it in the zone info will make it easier to add the next zone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quisquous I thought about doing it that way, but I wasn't sure how to get the names from there without doing a for loop and looking at each one individually.
I can do it that way if you want or another option would be to change your keys to match theirs if you aren't attached to them. Then we can just do a toLower on the string to match them up.

@christianhood
Copy link
Contributor Author

That commit is how I was suggesting doing it. Didn't realize it would automatically add it to the PR haha.

@christianhood
Copy link
Contributor Author

christianhood commented Apr 16, 2018

Damn, left a line in there on accident, knew I should have tested it first.

Edit: It won't let me commit the removal of the line, sorry, I'm kind of a noob with git and stuff. The line that shouldn't be there is var nmIndex = webKeys.indexOf(name);

@quisquous
Copy link
Owner

Yeah, github pull requests work such that when you push more commits to your branch, they show up in the pull request.

I think I'd rather just have the keys be something explicit rather than the key name there be the web key name. There's already a lookup that has to occur for the mob name elsewhere, so it's not clear to me why the web key should be privileged as the key name vs the mob name. I wanted those strings to just be like internal ids that weren't used anywhere else.

I think you're overthinking the performance here. There's only 20 items, so at most 400 lookups for a one time thing. If you're worried about that, you can always construct a lookup dict from the list of nms once in that function by walking through the 20 nms first and then using that while iterating through the split string.

@quisquous
Copy link
Owner

Thanks for this! I think I'm going to land this and then just follow up with a few small things. Was hoping to do another release this weekend. :)

@quisquous quisquous merged commit fe6215e into quisquous:master Apr 21, 2018
@christianhood
Copy link
Contributor Author

Oh, sorry about that, got busy with some other stuff and completely forgot about it

@quisquous
Copy link
Owner

No worries at all! I figured it was something like that. I just did some Eureka and having this is so convenient.

CptDraco added a commit to CptDraco/cactbot that referenced this pull request Apr 21, 2018
* Shortening O5 timeline names (quisquous#49)

* Adding timelines for Sigmascape 6-8N (quisquous#53)

* Cleanup o5678n reset lines

* O8S naming cleanup (quisquous#55)

* Triggers for o6s (quisquous#54)

* Add Triggers in o6s

* update severity for last kiss target

* Fix tabbed indents and fix missing square bracket

* More indenting fixes

* o7n: replace missile with prey

* raidboss: add preRun functions

* raidboss: Allow overrides for condition and texts

This allows users to specify shorter/longer outputs from triggers.  Also,
overriding conditions lets folks narrow (or broaden) when triggers show
up, e.g. see provokes even when you're not a tank or turn off mechanics
triggers for particular roles when they matter less.

Style-wise the capitalization on all the options looks weird, but I'm just
going to leave it for now for the sake of consistency.

Closes quisquous#51.

* Add tts for general provoke/shirk/etc triggers

Also shorten the names.

* ucu: Fix adds phase rp text mistake OOPS

* raidboss: o6s triggers

* o5s: Add more sync windows in case somebody misses the train coming back

* fractal hard: don't call knockback on first death spin

* o7s: make more program names specific

* o5s: narrow sync times after add phase

* Fix https update check

Releases page is now https only, so needs some extra flags and
should use the correct url.

* Bump version to 0.6.3

* Create fr.js (quisquous#58)

* Create fr.js

New locale 'fr'

* Update fr.js

Added translation for Seal and Unseal.

* Logic fixes in lang/fr

* Move zone names out of locale-specific lang files

These names come from ACT and not the game, so they're all in English.

* Add sigmascape zones to well fed regex

* Fix cactbot initialization race

The log doesn't get set up until after the plugin has started.
There's no event for this, so defer cactbot initialization until the
first slow timer.

This allows initialization error messages to not be dropped on the floor.

* Support html entities in custom elements

resource-bar, timer-bar, and timer-icon all currently only allow
flat text.  Allow html entities in these text strings as well.

* raidboss: Allow timeline names to be overridden

This closes issue quisquous#8.

This also is intended to be used as the way for issue quisquous#57 to
replace timeline names in English with French.

* oopsy: fix test bootshine trigger misapplying

* raidboss: Allow timeline syncs to be overridden

This is intended to help solve issue quisquous#57.

* raidboss: add support for localized triggers

Triggers can now have localized regexes.  For a given local (e.g. ko)
if there's a regexKo entry on the trigger, that will take precedence
over regex on its own.

Additionally, any trigger field that can be treated as a function
can now also return localized responses as an object, e.g.
instead of:

   return 'Get Out';

...triggers can instead do something like:

   return {en: 'Get Out', fr: 'something french here, etc'};

This change also avoids running Regexes.Parse on every single log line
for every single trigger.  @_@;;

This will help issue quisquous#57.

* oopsy: re-re-fix test bootshine typo

This fixes a typo from 4dd1cc4, whoops.

* oopsy: ability ids can only match entire ids

This prevents Bootshine (35) from matching Hakaze (1D35).

* raidboss: O8S timeline tweaks (quisquous#62)

Adding targetable/untargetable lines where appropriate

* Add DispatchToJS lock to prevent races

These data races have always been there, but were only going to be
exposed in PullCounter, which called an OverlayMessage that dispatched
an event, which could collide with game events dispatched from the
fast thread.

These races result in bogus Javascript to execute, such as such as
    document.dispatchEvent(new CustomEvent('onSendSaveData', { detail: {document.dispatchEvent(new CustomEvent('onSendUserConfigLocation', { detail: "data":" etc

...because both of these events are trying to be sent simultaneously,
and the string builder still has text from the previous event in
progress.  This leads to anonymous Javascript errors like "Unexpected
token )", which are awfully confusing.  It also sometimes but not
always leads to JSON serialization C# errors.

(This could explain why PullCounter never started when loaded
remotely as well.  onSendSaveData could be clobbering other events.)

This should fix races that will become a lot more common in pull quisquous#64.

* raidboss: Fix triggers returning integers

This fixes a bug introduced in 6c2c560 where anything that returned an
integer was incorrectly handled, so all delaySeconds became zero.

One day I will learn enough Javascript not to make silly mistakes.

* Custom User Config Local Directory (quisquous#64)

Adds user-specified config directory override to the C# config panel.

By default, it picks the user directory adjacent to the CactbotOverlay.dll
(and not to the html).  So if you are using cactbot out of a git repo
outside of your ACT directory, you likely will need to specify a directory
override.

Closes quisquous#56.

* Minor fixes after pull quisquous#64

* Allow blank as a custom user directory default

This removes several levels of redundant default filling.

* Simplify user location messages

If remote user directories aren't going to check for existence, then
there's no reason to do it in the local case either.  This cleans up
needing to send the overlay name along with the message and just
allows the remote side to send the user directory alone.

This also removes the checks for css and js, which allows for
overriding css without overriding js in the case of local files.

* Refactor SendFastRateEvents preamble/cleanup

Since I'm about to add another early out, hoist the timer and semaphore
code outside the SendFastRateEvents body so that nobody can mess it up.

* Automatically add onDOMContentReady listener

Every plugin will now get code injected to wait for DOMContentReady.
Once this is done, it will message the overlay plugin back, which
will automatically send the user data info, and the overlay can initialize
itself.

(Overlays currently pre-initialize and then reinitialize, but that can be
cleaned up after this commit.)

* Wait for user config before initializing overlay

This is the followup to 476ea6d which changes overlays to wait on the
onOverlayInitialize message before creating any of their objects,
reading options, or hooking up to DOM elements.  This should stop
initialization races ONCE AND FOR ALL.

This also reverts most of 65cf263 which half-heartedly tried to fix this.

* util: make_timeline.py improvements (quisquous#67)

Added FFlogs support, event filtering, and phases. Also supports
importing from external scripts now.

* oopsy: belated 4.2 flag value updates

Many flag values changed in 4.2, most notably:
* '0' is never an attack anymore (which will help issue quisquous#63)
* instant death is 33 not 32
* mysterious 3C shift is now a 3D shift

The 3D change explains why oopsy was flakily dropping damage messages.

* oopsy: Add all nameless autos as ids

Thanks to Nemekh on the fflogs discord.

* oopsy: reset first puller on countdown start/cancel

This should hopefully address issue quisquous#63.

* readme: add more details to install instructions

* Add fr.js to overlay html files

This should fix some errors going on in issue quisquous#57.

* raidboss: fix localization return values

This fixes the return values from triggers to properly return localized
results.  Currently they only return the 'en' value.

This should help with issue quisquous#57.

* Read data files in unicode

Previously, this was destroying any non-ASCII characters in read files,
which meant that it was impossible to specify these properly, either
as regexes or as outputs.

This fixes a number of problems in issue quisquous#57.

* raidboss: fr localization for test triggers

From quisquous#57 (comment)

* Add french engage replaceSync for test timeline

This fixes the issue mentioned in:
quisquous#57 (comment)

* raidboss: add load/run o7s triggers

* raidboss: O7S timeline fixes (quisquous#72)

Minor oversights. They were close enough to not lose syncing but still
enough to be misleading

* raidboss: fix o7s visual continuity times

Fixes quisquous#73.

* raidboss: add suppressSeconds to triggers

Too many triggers have had to do this manually, such as heavensfall or kefka
triggers.  Add this option that prevents retriggering for N seconds.

* raidboss: Clean up triggers to use suppressSeconds

* raidboss: better ucu fireball logic

Don't use the debuff anywhere, just track if you took the fireball.
Also, shorten the triggers back to not talk about thunder.

* Adding O8S timeline syncs (quisquous#66)

* raidboss: Adding O8S timeline syncs

The diff may not be super useful, so I'll summarize the changes (beyond
simply adding syncs). Preserved the existing naming for the most part.

- Added the Thunder/Fire hits of Celestriad
- Fixed some slight +/- 1s timing issues
- Added all non-starstrafe Soaks (The Path of Light, renamed for
clarity), since they were included, albeit inconsistently, later on in
the fight. Having specific timing for them is useful for dodging into
it.
- Added All Things Ending to Past/Future End during Starstrafe. The ATE
cast on the normal ones is fast enough (3s) that it's not worth timing
it, but there's a bigger gap in that one (8s).
- Also added Meteor hit (the stack) during Starstrafe
- Added some missing Ultimas (1328, 1358, 1543)
- Added a missing Ultimate Embraces (1364)
- Changed tether times to activation rather than appearance

* raidboss: O8S timeline minor fixes

Forgot to save these.

* raidboss: O8S end of fight syncs

* Support mixing remote url with local user files

For obvious security reasons, Chrome doesn't let you load files
off the local disk from a remote url.  To fix this, have the C#
load all the user files from disk and pass them to JS if that
directory exists locally.  JS can then inject this text directly
into the page.  If the directory doesn't exist locally, then
the overlay will link to the user page.

This should let all combinations of local and remote for url and
user directories work properly.

Fixes quisquous#56.

* Log dll versions and locations when starting cactbot

This is a bit verbose, but I've had a ton of users who have old dlls
lying around their system (quisquous#75), or the wrong OverlayPlugin (quisquous#70),
or a misnamed FFXIV plugin (quisquous#50).  This should help debug things.

* raidboss: more o8s triggers

* raidboss: fix o7s rot triggers

* raidboss: improve mana release triggers for tts

Closes quisquous#59.

* Bump version to 0.6.4

* Fix null config directory preventing overlays from starting

The Uri constructor apparently throws exceptions (oops) and this was
causing the overlay to explode and not send the init message.  This
would happen if you hadn't set the user config directory.  I had
tested this earlier, but not after the most recent user file sending
changes that broke it.

SORRY T_T

Fixes quisquous#76.

* Bump version to 0.6.5

* de: Create de.js (quisquous#84)

Add german locale

* de: Update jobs.html (quisquous#79)

Add de.js to html file

* de: Update pull_counter.html (quisquous#80)

Add de.js to html file

* de: Update oopsyraidsy.html (quisquous#81)

Add de.js to html file

* de: Update xephero-cactbot.html (quisquous#82)

Add de.js to html file

* de: Update raidboss.html (quisquous#83)

Add de.js (german lang)

* Allow spaces in cactbot user config dir locations

Uri unescaping, oops.  /o\

Fixes quisquous#90.

* Try loading user files html-relative before dll-relative

This is the way it used to work and allows folks working in git
repositories that aren't inside of the ACT folder to have their
user folder work as they'd expect.  If the html-relative doesn't
exist, it'll fall back to DLL-relative.

Fixes quisquous#88.

* Localize o5s for de/fr/jp (quisquous#85)

JEDF clients should now work with timeline sync and triggers. 
timeline translation for german client added

* Clean up formatting from pull quisquous#85

Multi-line conditionals need {}.
Two space indent everywhere.
Line up }; with the { indent level.

* Fix fr engage message in pull quisquous#85

See comments in quisquous#57 for more details.

* Split out regexes by language after pull quisquous#85

* Register languages before initializing overlay

* Add more ignore zones to xephero dps

* oopsy: ignore pvp and eureka

* raidboss: eureka triggers

* Fix typo in o2s.js

Fixes quisquous#94.

* raidboss: add fafnir eureka trigger

* o8s: Fix hyperdrive and ultimate embrace triggers

Closes quisquous#98.

* raidboss: pass locale through as data.lang

This should help with issue quisquous#57.

* o8s: add fr translation for mana release

This uses the new data parameter from fcc101c to help issue quisquous#57.

* jobs: Add option for showing hp/mp for other jobs

* Add eureka map module

* eureka: make resize helper match real thing

* eureka: be more permissive with tracker regexes

Tracker regexes can have hyphens in them too.

* eureka: prevent console error when changing zones

* rdmty: fix resize handle not appearing

The path to resize_handle.js

Fixes quisquous#102.

* eureka: add ability to import times from web tracker (quisquous#103)

* eureka: Split out tracker names explicitly

* eureka: split out tracker vs local times

If you've seen a mob die, then that's more accurate than a tracker time.

* eureka: add more readme information

* eureka: add star in NM readme text

* raidboss: allow sound volume settings for infoText

Previously you could only do this on named sounds.

* eureka: add wraith counter
SiliconExarch pushed a commit to SiliconExarch/cactbot that referenced this pull request Mar 19, 2024
github-actions bot pushed a commit to SiliconExarch/cactbot that referenced this pull request Mar 19, 2024
github-actions bot pushed a commit to SiliconExarch/cactbot that referenced this pull request Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants