cactbot icon indicating copy to clipboard operation
cactbot copied to clipboard

Fishing Timer based on !!! headmarker instead of user hook input

Open AdriaanDeVos opened this issue 4 years ago • 10 comments

Would it be possible to have an event that shows when the fish bite (with !/!!/!!! markers above player head) instead of when the player presses the "hook" button?

https://github.com/quisquous/cactbot/blob/55cfe0c40a9deef11c5a7929bd760fcc3b4a4cd2/ui/fisher/fisher.js#L249-L250

This would greatly increase the reliability of the fishing timer because it's not based on how quick/slow the user reacts to the bites.

AdriaanDeVos avatar Feb 26 '20 14:02 AdriaanDeVos

https://github.com/quisquous/cactbot/issues/1075#issuecomment-591587449

AdriaanDeVos avatar Feb 26 '20 19:02 AdriaanDeVos

I am unable to find lines starting with 27| in the network log. As a test I have tried to catch a fish with (DEBUG) Log all Network Packets enabled. The result is:

00|2020-02-26T21:55:32.0000000+01:00|0039||You apply a versatile lure to your line.|07dd742ccfb675e16a08fe1218a5cfb5
00|2020-02-26T21:55:32.0000000+01:00|08c3||You cast your line at Shirogane.|9b6e005b4242f2df9fa3d5b13c8f0f41
252|2020-02-26T21:55:33.3740000+01:00|00000040|106EF641|106EF641|00000003|010E0014|00430000|5E56DB45|00000000|00000145|00007415|00000000|00000000|00000000|00000000|00000000|00000000||51fcba7255d8bcf07a7c12cae276b2d5
252|2020-02-26T21:55:33.8640000+01:00|00000030|106EF641|106EF641|00000003|032B0014|00430000|5E56DB45|00000000|00060000|01000000|EC000000|00007FD2||3bbfb9483b49cdb210f3f823681884e7
252|2020-02-26T21:55:33.8640000+01:00|00000048|106EF641|106EF641|00000003|01F30014|00430000|5E56DB45|00000000|106EF641|00000000|00150001|00000001|00040001|00000000|00000002|00000113|00000116|00007FD2||95310a23d4e31a7ee09b50e48e969d50
252|2020-02-26T21:55:33.8640000+01:00|00000038|106EF641|106EF641|00000003|03850014|00430000|5E56DB45|00000000|00150001|00000456|00000101|000009C9|00000000|00007FD2||ee6a137440603613373d1d031c23dcea
252|2020-02-26T21:55:35.2490000+01:00|00000030|106EF641|106EF641|00000003|032B0014|00430000|5E56DB47|00000000|00040000|01000000|00000000|00000000||00a164435bfc52cfc14c94b520c370c3
252|2020-02-26T21:55:38.8240000+01:00|00000040|106EF641|106EF641|00000003|010E0014|00430000|5E56DB4A|00000000|41760018|00093A80|00000000|00000000|00000000|00000000|00000000|00000000||98553c0f81475715f3f8d24397f4a8bd
252|2020-02-26T21:55:40.9630000+01:00|00000040|106EF641|106EF641|00000003|01060014|00430000|5E56DB4C|00000000|167D7061|0000014D|00000000|00000000|00000000|00000000|00000000|00000000||e65b22afbf191633154b9e3fb52bf332
252|2020-02-26T21:55:48.8160000+01:00|00000040|106EF641|106EF641|00000003|010E0014|00430000|5E56DB54|00000000|41760018|00093A80|00000000|00000000|00000000|00000000|00000000|00000000||7328611e109c4b3ec62b849f63195e79
252|2020-02-26T21:55:49.3520000+01:00|00000048|106EF641|106EF641|00000003|01F30014|00430000|5E56DB55|00000000|106EF641|00000000|00150001|00000005|00040001|00000000|00000001|00000124|00000000|73617420||33f73682284732346e65d76498ca3480
00|2020-02-26T21:55:50.0000000+01:00|08c3||Something bites!|9a022f758a2416ad351ec94fc16fb86e
252|2020-02-26T21:55:50.8190000+01:00|00000050|106EF641|106EF641|00000003|010C0014|00430000|5E56DB56|00000000|106EF641|00000000|00150001|00000006|00040001|00000000|00000104|0000011C|0000011D|0000010F|00000000|00000000||5e01ef1012e8a1dc5098fcef811b1dcf
252|2020-02-26T21:55:50.8190000+01:00|00000038|106EF641|106EF641|00000003|03850014|00430000|5E56DB56|00000000|00150001|0000045C|00000100|0000011D|0000010F|00000000||fdbf6fca34140ab646e86fecae668fc1
252|2020-02-26T21:55:51.1310000+01:00|00000040|106EF641|106EF641|00000003|01060014|00430000|5E56DB57|00000000|167D9778|0000014D|00000000|00000000|00000000|00000000|00000000|00000000||f223e707d433fc26ad9903227b471df5
252|2020-02-26T21:55:50.8190000+01:00|00000050|106EF641|106EF641|00000003|010C0014|00430000|5E56DB56|00000000|106EF641|00000000|00150001|00000006|00040001|00000000|00000104|0000011C|0000011D|0000010F|00000000|00000000||5e01ef1012e8a1dc5098fcef811b1dcf
252|2020-02-26T21:55:50.8190000+01:00|00000038|106EF641|106EF641|00000003|03850014|00430000|5E56DB56|00000000|00150001|0000045C|00000100|0000011D|0000010F|00000000||fdbf6fca34140ab646e86fecae668fc1
252|2020-02-26T21:55:51.1310000+01:00|00000040|106EF641|106EF641|00000003|01060014|00430000|5E56DB57|00000000|167D9778|0000014D|00000000|00000000|00000000|00000000|00000000|00000000||f223e707d433fc26ad9903227b471df5
252|2020-02-26T21:55:57.0190000+01:00|00000048|106EF641|106EF641|00000003|01F30014|00430000|5E56DB5D|00000000|106EF641|00000000|00150001|00000002|00040001|00000000|00000002|00000000|00000000|00007FD2||813a86cb3220bdd96275122b227b0754
252|2020-02-26T21:55:57.3320000+01:00|00000030|106EF641|106EF641|00000003|00940014|00430000|5E56DB5D|00000000|FFFFFFFF|00000006|00000077|0000006E||7e759921d670a6d5eaefdb6483b343d6
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|0000030E|00007FD2|00170002|00000001|00004E7C|00007FD2|00000000|00000000|75309D00|00000000|00000000|00000000|00000000|00000000|00000000|00000000||2fa09261d4c0e969ddeb13d20487e4a6
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|0000030F|00007FD2|000003E8|00000001|00006F37|00000000|92E920D8|0040002E|67AC9F01|00000001|00004248|00000000|00000000|00000000|00000000|00000000||7bc3a9231f29dd7549a46062e36dbdfc
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000310|00007FD2|000103E8|00000001|0000453E|00000000|00000000|00000000|4D7B9F00|00002710|00000000|00000000|00000000|00000000|00000000|00000000||2c6572ce2075eeef8ca795a95838aee4
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000311|00007FD2|000203E8|00000001|00006F3D|00000000|92E920D8|0040002E|3F399F01|000000BB|00000000|00130013|00000000|07070000|00000000|00000000||05c17cfd9a5c540924f0aa534257e3e8
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000312|00007FD2|000303E8|00000001|00006F3E|00000000|92E920D8|0040002E|520A9F01|000000BB|00000000|00130012|00000000|07070000|00000000|00000000||62401fd7b2641b81ca216d1951d2d9b6
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000313|00007FD2|000403E8|00000001|00006F3F|00000000|92E920D8|0040002E|3F4A9F01|000000BB|00000000|00120012|00000000|05070000|00000000|00000000||acb6ed11ee8e4955833f5cecd146abcc
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000314|00007FD2|000503E8|00000001|00006A5A|00000000|92C219F9|0040002E|3DE79F01|00000FF3|00000000|00000012|00000000|00070000|00000000|00000000||0d93306ed5b58fac5bae5d0f9f0ac8b5
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000315|00007FD2|000603E8|00000001|00006F40|00000000|92E920D8|0040002E|3F5D9F01|000000BB|00000000|00120012|00000000|05050000|00000000|00000000||6ee357b05bb30711ec8a2e82b57ede76
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000316|00007FD2|000703E8|00000001|00006F41|00000000|92E920D8|0040002E|3F2D9F01|000000BB|00000000|00130013|00000000|05050000|00000000|00000000||3641c0ad57f21b3d3ad567eb6bdc2466
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000317|00007FD2|000803E8|00000001|00006A5B|00000000|92C219F9|0040002E|2CDA9F01|00000FF9|00000000|00000012|00000000|00070000|00000000|00000000||9f195a8d180c8170a9a2a6f610286150
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000318|00007FD2|000903E8|00000001|00006A5C|00000000|92C219F9|0040002E|2D4B9F01|00000FF7|00000000|00000013|00000000|00070000|00000000|00000000||a50dec65c19754cedcc7cdc06ad513ec
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|00000319|00007FD2|000A03E8|00000001|00006A5D|00000000|92C219F9|0040002E|2CCD9F01|00000FE7|00000000|00000013|00000000|00070000|00000000|00000000||702404aa5ab9e6d054ccca03cd559e35
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|0000031A|00007FD2|000B03E8|00000001|00006A5E|00000000|92C219F9|0040002E|2CC49F01|00000FF3|00000000|00000013|00000000|00070000|00000000|00000000||91c4e1295201cfb624d37365fc2035aa
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|02E90014|00430000|5E56DB5D|00000000|0000031B|00007FD2|000C03E8|00000001|00006A5E|00000000|92C219F9|0040002E|2D1C9F01|00000FEE|00000000|00000013|00000000|00070000|00000000|00000000||e02cfcb29850a27acc894c57caea7500
252|2020-02-26T21:55:57.3320000+01:00|00000040|106EF641|106EF641|00000003|010E0014|00430000|5E56DB5D|00000000|54010142|00002229|00000000|00000000|00000000|00000000|00000000|00007FD3||49c64e911b1856861f69223e6bddad9c
252|2020-02-26T21:55:57.3320000+01:00|00000040|106EF641|106EF641|00000003|010E0014|00430000|5E56DB5D|00000000|00000140|00004E7C|00370001|003E0104|00000000|00000000|00000000|00007FD2||5687f6122519543b2fc021840f8009a3
252|2020-02-26T21:55:57.3320000+01:00|00000040|106EF641|106EF641|00000003|010E0014|00430000|5E56DB5D|00000000|0000002B|00000012|00000000|00093A80|00000000|00000000|00000000|00000000||97c4edd15697e62fb5c44364dd586152
252|2020-02-26T21:55:57.3320000+01:00|00000060|106EF641|106EF641|00000003|020C0014|00430000|5E56DB5D|00000000|106EF641|00000000|00150001|00000004|00040001|00000000|00000005|0000010F|00000000|00000000|00000001|00000007|03113310|00000000|010097EB|00000000||f99c806cfdb0b69a902f768c64abb3cf
00|2020-02-26T21:55:57.0000000+01:00|0843||You land a grinning anchovy measuring 5.5 ilms!|60f63de64fba6825f07ee368bf136d2d

AdriaanDeVos avatar Feb 26 '20 21:02 AdriaanDeVos

The Something Bites! message appears AFTER the !!! head marker.

AdriaanDeVos avatar Feb 26 '20 21:02 AdriaanDeVos

I implemented this in https://github.com/FabulousCupcake/cactbot/commit/18b07e52bbc804a9b285290b88aeaf518f958362

Note that:

  • This was written before 5.21 and the fisher opcode changed since. (currently 01670014 I believe)
  • FFXIV ACT Plugin must be configured to print network debug logs for this to work.
  • This is a very crude implementation, I don't think it should be merged into cactbot just yet.

I spoke with ngld and can confirm that a new Fishing event is planned to be added to OverlayPlugin.
I'll wait until then to submit a better implementation for this.

FabulousCupcake avatar Mar 12 '20 22:03 FabulousCupcake

Thank you for your research @FabulousCupcake . I'll try it out with manually changing the opcode to 01670014. Is there any way there can be contributed to the implementation of the fishing event in the overlayplugin?

AdriaanDeVos avatar Mar 12 '20 22:03 AdriaanDeVos

Oooh, yeah, having this in OverlayPlugin would be great. Thanks for letting me know that's in the works.

quisquous avatar Mar 12 '20 22:03 quisquous

For anyone who wants to try cupcake's code, or wants to implement their own solution, the current fisher opcode for 5.25 is 02C30014.

gertasik avatar Apr 18 '20 00:04 gertasik

02C3 is indeed the correct opcode for detecting this (the 0014 is in every package at that position, I believe, but I may be wrong).

If you cross-reference the sapphire source code at1

https://github.com/SapphireServer/Sapphire/blob/399d9b0dcd6d87aa624bd53c58415efa27bb1b1c/src/common/Network/PacketDef/Ipcs.h#L183

It would imply that it's used more generally. I don't know if ACT itself provides access to this kind of opcode outside of reading the debug logs, though. If so, that'd be super helpful -- otherwise this changes with each patch :( Anyway.

The structure for this opcode is documented (or, more correctly, guessed) here:

https://github.com/SapphireServer/Sapphire/blob/399d9b0dcd6d87aa624bd53c58415efa27bb1b1c/src/common/Network/PacketDef/Zone/ServerZoneDef.h#L1393

And using the names of fields from above, here's what I know holds true for normal fishing:

The eventId for any fish event is 0x00150001.

scene = 1: you just cast your line, i.e. started fishing scene = 2, param5 == 0: caught fish scene = 2, param5 != 0: fish got away scene = 3: leaving fishing hole scene = 5, param5 == 0x124: weak bite, one ! scene = 5, param5 == 0x125: medium bite, two !! scene = 5, param5 == 0x126: strong/legendary bite, three !!!

I believe some field is set to indicate a collectable (and holds the rating), but it's been a month or two since I looked at it in any capacity. I also haven't tried ocean fishing yet since I've been away from the game and only recently returned, but I would assume stuff to be similar.

This information was also collected before the headmarkers were implemented (and I have some opcodes going back to 4.5), so I'm not actually sure if the headmarkers have different network packets.

You can generally find the opcode rather easily if you turn on debug logs, and search for |00150001| after casting your line once.

But that brings a more important question: Would a contribution that relies on this kind of hack (i.e. reading game log lines manually, be okay? I would think it should be implemented in a way that supplements the current code, and should fall back to the current way of detecting bites. It is work to be done for every new minor patch that is released; and I know you're often busy with the more non-fishing side of things. I know there's a similar thing implemented in the FateWatcher, and that brings with it issues in different game versions & locales.

1: The historical opcodes for patches where I did fish and which I did use for detecting fish events are as follows: 4.5 - 01AB; 5.0 - 01B5; 5.1 - 0096; 5.18 - 0279; 5.2 - 01F3.

mabako avatar May 25 '20 15:05 mabako

I would think it should be implemented in a way that supplements the current code, and should fall back to the current way of detecting bites.

That's how I imagined this would work, with one caveat - in the case of fallback to the current way of detecting bites (hook), the action should be read-only (timer would stop and show the possible fish as usual) and shouldn't write anything to the database.

The entire point of this suggestion is to create a timer database that's precise, and doesn't rely on how fast the user clicks on "hook" after a bite. If the rules of timing the bites suddenly changed for a week after every patch, it would introduce a lot of noise in the timer database and would practically render this entire improvement useless.

But yeah, I agree with what you said, and it's how I thought this could work too.

gertasik avatar May 25 '20 16:05 gertasik

The new opcode for 5.3 is 0379

mabako avatar Aug 11 '20 14:08 mabako

I am not planning to get around to this. GatherBuddy's fishing already does this really well.

quisquous avatar Apr 23 '23 17:04 quisquous