laytya / LazyScript

22 stars 12 forks source link

Trying to add -ifWDown and -ifCurrentDefaultForm=form #24

Open HugeMcBigger opened 5 months ago

HugeMcBigger commented 5 months ago

Someone else suggested -ifCurrentDefaultForm=form. Where there is an if criteria that checks for the current default Lazyscript form name. I have been trying to add this myself but I can’t for the life of me code in LUA. Anyone got any tips?

I am also trying to add -ifWDown that works similarly to -ifShiftDown or -ifCtrlDown, but I am struggling with that, too. Any tips?

if anyone knows how to get this working, I can give you 300 gold on turtle wow lol

HugeMcBigger commented 5 months ago
function lazyscript.bitParsers.ifLazyForm(bit, actions, masks)
    if (not lazyscript.rebit(bit, "^ifLazyForm=(.*)$")) then
        return false
    end
    local negate = lazyscript.negate1()
    table.insert(masks, lazyScript.negWrapper(lazyScript.masks.LazyForm(defaultForm), negate))
    if (lazyScript.perPlayerConf.defaultForm == form) then
        return true
        else
        return false
    end
end

I have added that to ParseGeneral.lua, but it's kicking up a LUA error at the first line. Any ideas?