tny5989 / ffxikeys Goto Github PK
View Code? Open in Web Editor NEWA small windower addon to automate trading Special Gobbiedial Keys for rewards
A small windower addon to automate trading Special Gobbiedial Keys for rewards
You lua works well for when buying items in quantities less than 8, but any quantity 8 or above it needs a change.
The function: CreateDialogChoicePacket
in ./model/valid_purchase.lua
needs the following change (see I am just adding a way to add the _unknown1
field):
local function CreateDialogChoicePacket(target, option, u1, zone, automated)
local pkt = packets.new('outgoing', 0x05B)
pkt['Target'] = target:Npc()
pkt['Option Index'] = option
pkt['_unknown1'] = u1
pkt['Target Index'] = target:Entity():Index()
pkt['Automated Message'] = automated
pkt['Zone'] = zone
pkt['Menu ID'] = target:Menu()
return pkt
end
then it means that the CreateDialogChoicePackets
function in the same file needs a change:
local function CreateDialogChoicePackets(target, item, zone, count)
local to_send = {}
to_send[1] = CreateDialogChoicePacket(target, 10, 0, zone, true)
to_send[2] = CreateDialogChoicePacket(target, item:Option(), 0, zone, true)
to_send[3] = CreateDialogChoicePacket(target, (count % 8) * (2^13) + item:Option() + 1, math.floor(count/8), zone, true)
to_send[4] = CreateDialogChoicePacket(target, 0, 0, zone, false)
return to_send
end
Specifically look at the following line:
CreateDialogChoicePacket(target, (count % 8) * (2^13) + item:Option() + 1, math.floor(count/8), zone, true)
the option
field now uses modulus 8 (i.e. (count % 8)
since the option field cycles from 0 + item:Option() + 1
to 7 * (2^13) + item:Option() + 1
.
the u1
field (i.e. _unknown1
) now has the number of "cycles" given by the formula math.floor(count/8)
.
I have tested this with other items and seems to work!
Running the addon before your inventory is fully loaded can cause problems.
If you have openlinks on, the addon will open a link for every item in your inventory as it is loaded (after you call //keys start).
The addon does not detect a full inventory when using multiple keys. Inventory updates and key usage are asynchronous operations and one is not guaranteed to happen before the other.
When the addon goes to use another key the inventory is not guaranteed to have been updated with the item from the previous key use. The addons makes the decision to use another key based on stale information and gets hung up.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.