Jump to content


Photo

Help with smn lua, debugging, interpreting print commands


    No replies to this topic

    #1 Gukai

    Gukai

      Advanced Member

    • Members
    • PipPipPip
    • 95 posts

      Posted 28 December 2015 - 05:50 AM

      Hi.  

      I'm trying to interpret some print commands I got when trying to debug my smn lua

       

      I have the following code 

      function pet_change(pet, gain)
      	if gain then
      		print('summoning')
      		if pet.name == 'Odin' then
      			print('summoning odin')
      			equip(sets.avatar.odin)
      		elseif pet.name == 'Alexander' then
      			print('summoning alex')
      			equip(sets.avatar.alexander)
      		elseif pet.name == 'Atomos' then
      			print('summoning atomos')
      			equip(sets.avatar.atomos)
      		elseif pet.name:match('Light') then
      			print('summoning light')
      			equip(sets.spirit.light)
      		elseif pet.name:match('Spirit') then
      			print('summoning spirit')
      			equip(sets.spirit)
      		elseif buffactive["Avatar's Favor"] then
      			print('summoning avatars favor')
      			equip(sets.avatar.favor)
      		else
      			print('summoning general')
      			equip(sets.avatar[avatar_mode])
      		end
      		disable('main', 'ammo')
      	else
      		if not tp_lock then
      			enable('main', 'ammo')
      		end
      		equip(sets.idle)
      	end
      end
      

      When i summoned garuda, i got 4 lines of print commands:

      summoning

      summoning general

      summoning

      summoning general

       

      Why did it double up?

       

      When i had garuda assault something, it did:

      summoning

      summoning general

       

      I will admit, its been a very long time since i made this lua so a lot of the logic i've forgotten.  I thought this stuff was for when i summoned only, i'm not sure why it did it when i had garuda attack something, and same after i did a bloodpact (summoning & summoning general), so maybe i need a refresher on what pet_change(pet, gain) means  :(

       

      Can i get some help?  Seems I need to figure out this before it drives me crazy, and then see what other things happen and ask about them later.






      1 user(s) are reading this topic

      0 members, 1 guests, 0 anonymous users