Rng Error On Arislan Lua

Language: JP EN DE FR
users online
Forum » Windower » Spellcast Scripting » Ranger » Rng error on Arislan lua
Rng error on Arislan lua
 Asura.Samsonxiii
Offline
Server: Asura
Game: FFXI
user: Spook153
Posts: 9
By Asura.Samsonxiii 2021-07-02 09:32:42
Link | Quote | Reply
 
Using Arislan.rng and getting error: Rng.lua 1089 attempt to index field 'WeaponLock' (a nil value)


function job_aftercast(spell, action, spellMap, eventArgs)
if spell.english == "Shadowbind" then
send_command('@timers c "Shadowbind ['..spell.target.name..']" 42 down abilities/00122.png')
end
(-> this line is 1089) if player.status ~= 'Engaged' and state.WeaponLock.value == false then
check_weaponset()
end
end

Help much appreciated
Offline
Posts: 319
By aisukage 2021-07-02 10:08:18
Link | Quote | Reply
 
Looking at his RNG lua online. He doesn't have a WeaponLock variable. He doesn't even have a key bind in the RNG lua or his Global binds lua to toggle the value. The only other place in the lua that mentions the WeaponLock value is double hyphened out. So it looks unfinished or something he was removing from his lua.

Either way i would just reccomend removing these lines
Code
    if player.status ~= 'Engaged' and state.WeaponLock.value == false then
        check_weaponset()
    end


Which should be line 1089 - 1091 for you. Or atleast just double hyphen those lines out
[+]
 Asura.Samsonxiii
Offline
Server: Asura
Game: FFXI
user: Spook153
Posts: 9
By Asura.Samsonxiii 2021-07-02 15:58:09
Link | Quote | Reply
 
Thank you.

Yeah - I deleted the segment temporarily - I wonder the purpose or the intended purpose was?
Offline
Posts: 319
By aisukage 2021-07-02 18:27:15
Link | Quote | Reply
 
He has this check_weaponset function.
Code
function check_weaponset()
    if state.OffenseMode.value == 'LowAcc' or state.OffenseMode.value == 'MidAcc' or state.OffenseMode.value == 'HighAcc' then
        equip(sets[state.WeaponSet.current].Acc)
    else
        equip(sets[state.WeaponSet.current])
    end
    if player.sub_job ~= 'NIN' and player.sub_job ~= 'DNC' then
       equip(sets.DefaultShield)
    end
end

Which looks like it equips specific sets based on the value of "state.WeaponSet"
Code
state.WeaponSet = M{['description']='Weapon Set', 'Annihilator', 'Fomalhaut', 'Armageddon'}


Quickly looking through his lua he has predetermined weapon sets based on the value which are displayed below.
Code
    sets.Annihilator = {main="Perun +1", sub="Blurred Knife +1", ranged="Annihilator"}
    sets.Fomalhaut = {main="Perun +1", sub="Blurred Knife +1", ranged="Fomalhaut"}
    sets.Armageddon = {main="Perun +1", sub="Malevolence", ranged="Armageddon"}
    --sets.Gastraphetes = {main="Malevolence", sub="Malevolence", ranged="Gastraphetes"}

    sets.DefaultShield = {sub="Nusku Shield"}


So the code you were having issues with is forcing the check after every action with the following factors being true. 1st being while you're engaged and the 2nd being the non existing weaponlock value being false. He seems to have put a lot of effort into this lua but there are functions like this one below which shows Carnwenhan as the weapon which has me believe this lua is still a work in progress.
Code
function customize_melee_set(meleeSet)
    if buffactive['Aftermath: Lv.3'] and player.equipment.main == "Carnwenhan" then
        meleeSet = set_combine(meleeSet, sets.engaged.Aftermath)
    end

    check_weaponset()

    return meleeSet
end


So while the majority of the lua looks pretty solid there are a few things in the lua that look a little misplaced you're going to have to fix.
Log in to post.