here is the script ive been trying to port
https://github.com/ethangreen-dev/lovely-injector/blob/master/crates/lovely-core/src/patch/regex.rs
what it does is it uses regex to find a pattern, and then inject a "payload" into the position provided to the script.
im porting it to lua since im making a modloader for balatro which runs fully in lua, but since im using love2d i cant use any luarocks or loverocks packages.
i have some of the packages (if thats what we call them in rust) ported to lua such as rope,
i also moved this package for regex https://github.com/Roblox/luau-regexp/tree/main/src/RegEx from luau to lua, and it seems like for the most part it works with my code (although i had to make some tweaks to it to add methods like get_group(index) or get_group_from_name(index)) and it does inject some parts of the script correctly, but then it seems to mess up really badly in some places causing stuff like this:
if self.STATE if G.STATE == G.STATES.SMDS_BOOSTER_OPENED then
SMODS.OPENED_BOOSTER.config.center:update_pack(dt)
end
== self.STATES.PLAY_TAROT then
self:update_play_tarot(dt)
end
here is the github for my lua code, if theres anything else you guys need to see to help me understand whats going on let me know! although i think the issue is just in my script here: https://github.com/3XPLwastaken/repowhichimusingtogethelpandiwillprivatelater/blob/main/code.lua