Jump to content


Photo

Curing rules in Lua not working


Best Answer Kenshi , 08 December 2014 - 05:26 PM

With this rule you are using same set for idle and resting, try this:

function status_change(new,old)
	if new == 'Idle' then
		equip(sets.aftercast.Idle)
        elseif new == 'Resting' then
                equip(sets.aftercast.Resting)
	elseif new == 'Engaged' then
		equip(sets.aftercast.TP)
	end
end
Go to the full post


23 replies to this topic

#21 Kenshi

Kenshi

    Advanced Member

  • Members
  • PipPipPip
  • 334 posts

    Posted 08 December 2014 - 05:26 PM   Best Answer

    With this rule you are using same set for idle and resting, try this:

    function status_change(new,old)
    	if new == 'Idle' then
    		equip(sets.aftercast.Idle)
            elseif new == 'Resting' then
                    equip(sets.aftercast.Resting)
    	elseif new == 'Engaged' then
    		equip(sets.aftercast.TP)
    	end
    end
    


    #22 Gukai

    Gukai

      Advanced Member

    • Members
    • PipPipPip
    • 95 posts

      Posted 08 December 2014 - 08:47 PM

      Thats what i thought!!!  maybe the lua i took it from didnt have a real resting set!!  /head-desk!!

       

      This part:      if T{'Idle','Resting'}:contains(new)then          was confusing me, with the T{...    so I was hesitant to try to change it, lol

       

      Thank you Kenshi again!



      #23 Arcon

      Arcon

        Advanced Member

      • Windower Staff
      • 1189 posts
      • LocationMunich, Germany

      Posted 10 December 2014 - 08:49 AM

      If you change sets.aftercast.TP to sets.aftercast.Engaged you can even shorten it to the following:

      status_change = function(status)
          equip(sets.aftercast[status])
      end


      #24 Cptbirdseye

      Cptbirdseye

        Advanced Member

      • Members
      • PipPipPip
      • 88 posts

        Posted 11 December 2014 - 05:14 PM

        I'm noticing issues too where certain sets are not activating.  Here's a chunk from mine from Kinematics' SMN gearswap:

        sets.precast.FC = {
            head="Nahtirah Hat",ear2="Loquac. Earring",
            body="Vanir Cotehardie",ring1="Prolix Ring",
            back="Swith Cape +1",waist="Witful Belt",legs="Orvail Pants +1",feet="Chelona Boots"}
        
        sets.midcast.Cure = {main="Tamaxchi",sub="Genbu's Shield",
            head="Nahtirah Hat",ear2="Loquac. Earring",
            body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Prolix Ring",ring2="Sirona's Ring",
            back="Swith Cape +1",waist="Witful Belt",legs="Hagondes Pants",feet="Hag. Sabots +1"}
        
        sets.idle.Avatar = {main="Gridarvor",sub="Vox Grip",ammo="Seraphicaller",
            head="Con. Horn +1",neck="Caller's Pendant",ear1="Gifted Earring",ear2="Loquac. Earring",
            body="Glyphic Doublet +1",hands="Serpentes Cuffs",ring1="Evoker's Ring",ring2="Sangoma Ring",
            back="Conveyance Cape",waist="Fucho-no-Obi",legs="Nares Trews",feet="Con. Pigaches"}
         

        These are the functions I think to work with the sets:

        function customize_idle_set(idleSet)
            if pet.isvalid then
                if pet.element == world.day_element then
                    idleSet = set_combine(idleSet, sets.perp.Day)
                end
                if pet.element == world.weather_element then
                    idleSet = set_combine(idleSet, sets.perp.Weather)
                end
                if sets.perp[pet.name] then
                    idleSet = set_combine(idleSet, sets.perp[pet.name])
                end
                gear.perp_staff.name = elements.perpetuance_staff_of[pet.element]
                if gear.perp_staff.name and (player.inventory[gear.perp_staff.name] or player.wardrobe[gear.perp_staff.name]) then
                    idleSet = set_combine(idleSet, sets.perp.staff_and_grip)
                end
                if state.Buff["Avatar's Favor"] and avatars:contains(pet.name) then
                    idleSet = set_combine(idleSet, sets.idle.Avatar.Favor)
                end
                if pet.status == 'Engaged' then
                    idleSet = set_combine(idleSet, sets.idle.Avatar.Melee)
                end
            end
            
            if player.mpp < 51 then
                idleSet = set_combine(idleSet, sets.latent_refresh)
            end
            
            return idleSet
        end
        
        
        function job_update(cmdParams, eventArgs)
            classes.CustomIdleGroups:clear()
            if pet.isvalid then
                if avatars:contains(pet.name) then
                    classes.CustomIdleGroups:append('Avatar')
                elseif spirits:contains(pet.name) then
                    classes.CustomIdleGroups:append('Spirit')
                end
            end
        end
         

        What happens is that if I cure someone then sets.precast.FC equips, but it is not then being followed by sets.midcast.Cure or sets.idle.Avatar so I'm bleeding mana after using any ability or spell.  Thing is this all worked before the update.

         






        1 user(s) are reading this topic

        0 members, 1 guests, 0 anonymous users