React

Chat about the Ashita v3 project here.
Post Reply
Nasteff
Posts: 11
Joined: Wed Jun 15, 2016 5:15 pm

React

Post by Nasteff » Sat May 27, 2017 10:50 am

anyway to get the React addon that was made for windower to work with ashita? or could someone make one to do the same thing?
shinzaku
Posts: 52
Joined: Wed May 17, 2017 8:34 am

Re: React

Post by shinzaku » Wed May 31, 2017 10:08 pm

I believe the onevent addon already does something similar to Sammeh's addon.
http://ashita.atom0s.com/wiki/doku.php?id=addon:onevent
Nasteff
Posts: 11
Joined: Wed Jun 15, 2016 5:15 pm

Re: React

Post by Nasteff » Sat Jun 17, 2017 8:10 am

it can execute commands on event but it cant make your character runaway
Shiva219
Posts: 2
Joined: Sat Aug 17, 2019 4:38 am

Re: React

Post by Shiva219 » Sat Aug 17, 2019 4:43 am

Is there still no way to use react for Ashita? Is there a way to port it?
pantafernando
Posts: 23
Joined: Mon Nov 06, 2017 6:12 am

Re: React

Post by pantafernando » Wed Nov 20, 2019 7:47 am

Not answering this, but looking the React addon, it uses windowers functions like "run" (windower.ffxi.run) and "turn" (windower.ffxi.turn).

Does ashita have equivalent functions or anyone have some insights to how to make functions to execute those windower functions? Tried looking the libs for that but i think its inside LuaCore.dll? IDK how to read that file.

Thanks in advance
User avatar
atom0s
Site Admin
Posts: 454
Joined: Sat May 14, 2016 5:13 pm

Re: React

Post by atom0s » Wed Nov 20, 2019 1:39 pm

Directly no, but you can create the functions yourself from an addon reading/writing to memory since that's all that is done for things like this.

windower.ffxi.run just makes you move/auto-run. The auto-run structure can be found via this pointer signature:

Code: Select all

Pattern: 8BCFE8????????8B0D????????E8????????8BE885ED750CB9
Offset : +25
The structure this points to is as follows:
  1.     struct autofollow_t
  2.     {
  3.         uintptr_t       VTablePointer;          // The base VTable pointer.
  4.         uint32_t        TargetIndex;            // The last targeted entities target index.
  5.         uint32_t        TargetServerId;         // The last targeted entities server id.
  6.         float           FollowDeltaX;           // The auto-run/auto-follow X delta.
  7.         float           FollowDeltaZ;           // The auto-run/auto-follow Z delta.
  8.         float           FollowDeltaY;           // The auto-run/auto-follow Y delta.
  9.         float           Unknown0000;            // Unknown [Set to 1 when you stop auto-following.]
  10.         uintptr_t       VTablePointer2;         // The base VTable pointer.
  11.         uint32_t        FollowTargetIndex;      // The auto-follow follow target index.
  12.         uint32_t        FollowTargetServerId;   // The auto-follow follow target server id.
  13.         uint8_t         IsFirstPersonCamera;    // Flag if the camrea is in first person mode or node.
  14.         uint8_t         IsAutoRunning;          // Flag if the player is auto-running / auto-following. (Or auto-running in a direction.)
  15.         uint16_t        Unknown0001;            // Padding
  16.         uint32_t        Unknown0002;            // Unknown [Set to 0 when messing with auto-follow.]
  17.         uint8_t         IsCameraLocked;         // Set to 1 when the camera is locked forward. (When holding shift.)
  18.         uint8_t         IsCameraLockedOn;       // Set to 1 when the camera is locked on to a target and is in third-person mode.
  19.         uint16_t        Unknown0003;            // Padding
  20.  
  21.         /**
  22.          * Following the last unknown, there are three sets of coords stored. (XZY?)
  23.          * These do not appear to be used consistently enough to determine their purpose.
  24.          *
  25.          * Rest of the structure does not seem to contain any useful information.
  26.          */
  27.     };
windower.ffxi.turn turns your character by altering your heading direction. You can access that via the entity object's warp pointer.
From the warp pointer, the offsets to the editable coords are:

Code: Select all

+52 - Editable X
+56 - Editable Z
+60 - Editable Y
+72 - Editable Heading
+1476 - Editable X (2)
+1480 - Editable Z (2)
+1484 - Editable Y (2)
For turn, here's an example of doing it via memory:
  1. local function turn(dir)
  2.     -- Get the local player entity..
  3.     local player = GetPlayerEntity();
  4.     if (player == nil) then
  5.         return;
  6.     end
  7.  
  8.     -- Get the local player entity warp pointer..
  9.     local warp = player.WarpPointer;
  10.     if (warp == nil or warp == 0) then
  11.         return;
  12.     end
  13.    
  14.     -- Set the players heading direction..
  15.     ashita.memory.write_float(warp + 0x48, dir);
  16. end
This can also be done by packets by altering the player direction information in the appropriate packets.
Lead Ashita Developer

Want to donate to say thanks?
https://www.paypal.me/atom0s
pantafernando
Posts: 23
Joined: Mon Nov 06, 2017 6:12 am

Re: React

Post by pantafernando » Wed Nov 20, 2019 5:13 pm

Thanks Atom0s
Shiva219
Posts: 2
Joined: Sat Aug 17, 2019 4:38 am

Re: React

Post by Shiva219 » Thu Nov 21, 2019 6:05 pm

Thanks for the info. I’m not that savvy so this would be a lot of work for me, lol. I have another question somebody might be able to answer though. I see Onevent is similar except it can’t turn or runaway. Can Onevent react to mob “readies” moves however? Ie... equip certain gear when certain moves are about to fire. Can it also be used to equip certain gear when certain spells are cast on you? Like equipping cure effect received gear when your about to be cured.
pantafernando
Posts: 23
Joined: Mon Nov 06, 2017 6:12 am

Re: React

Post by pantafernando » Fri Nov 22, 2019 8:20 am

Shiva219 wrote:
Thu Nov 21, 2019 6:05 pm
Thanks for the info. I’m not that savvy so this would be a lot of work for me, lol. I have another question somebody might be able to answer though. I see Onevent is similar except it can’t turn or runaway. Can Onevent react to mob “readies” moves however? Ie... equip certain gear when certain moves are about to fire. Can it also be used to equip certain gear when certain spells are cast on you? Like equipping cure effect received gear when your about to be cured.
I dont use onevent but reading the lua, it should react to that if you arent using filters.

But do notice reading log has its cons. For example there is a delay between the action and the message of it. For mobs instant tp moves can not work right. Plus when the enviroment is too spammy, often we lose some mchat messages.

Though, it shouldnt be hard to create an ashita version of the react. All it does is receiving a packet action and putting a lot of ifs for any mob action
Post Reply