Gearswap Help: Not Calling Functions

Langues: JP EN DE FR
users online
Forum » Windower » Support » Gearswap help: not calling functions
Gearswap help: not calling functions
Offline
Posts: 7
By Sonicrich05 2015-12-06 09:45:22
Link | Citer | R
 
I'm new to gearswap, and am kinda confused as to why this line won't work. It seems pretty straight forward, but gearswap doesn't seem to call aftercast or status_change when I'm not engaged. If someone could point out the probably simple mistake I've made, I'd really appreciate it! ALl the sets to switch to are the same just for testing purposes, I couldn't get any to work but they'd eequip if I did a manual command in the console.
Code
function aftercast(spell)
	 if player.status == 'Idle' then
        equip(sets.engaged)
	elseif player.status == 'Engaged' then
		equip(sets.engaged)
    end
end

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

end

Offline
Posts: 7
By Sonicrich05 2015-12-06 12:43:45
Link | Citer | R
 
Turns out it's calling them, but its still equiping sets.idle, using default values in status_change. I can't figure out how to get it to change :|
 Shiva.Malthar
Offline
Serveur: Shiva
Game: FFXI
user: Malthar
Posts: 516
By Shiva.Malthar 2015-12-06 12:49:37
Link | Citer | R
 
Post your gs file.
 Cerberus.Conagh
Offline
Serveur: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2015-12-06 13:00:12
Link | Citer | R
 
Sonicrich05 said: »
I'm new to gearswap, and am kinda confused as to why this line won't work. It seems pretty straight forward, but gearswap doesn't seem to call aftercast or status_change when I'm not engaged. If someone could point out the probably simple mistake I've made, I'd really appreciate it! ALl the sets to switch to are the same just for testing purposes, I couldn't get any to work but they'd eequip if I did a manual command in the console.
Code
function aftercast(spell)
	 if player.status == 'Idle' then
        equip(sets.engaged)
	elseif player.status == 'Engaged' then
		equip(sets.engaged)
    end
end

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

end

This piece of code looks absolutely fine to be honest, there must be another rule for idle sets somewhere else in your GS file that's causing a conflict, so much so that at some point it may even lock up on you.

If you can find that bit of code you could delete it and see if it works, if it does then you have your answer, if not post your gearswap file and we'll help, but it's always a better learning experience if you work things out yourself so I would give that a shot first.
Offline
Posts: 7
By Sonicrich05 2015-12-06 13:11:35
Link | Citer | R
 
Here's my file for BST, there's nothing other than my idle sets. I've been playing with different things in status_change but nothing changes it. It's a basic file right now, I'm trying to figure it out as I make it.
Code
function get_sets()
	mote_include_version = 2
	
	include ('Mote-Include.lua')
end

function job_setup()

end

function user_setup()
	state.JugMode = M{['description']='Jug Mode', 'FaithfulFalcorr','BlackbeardRandy','ThreestarLynn','CursedAnnabelle'}
	state.RewardMode = M{['description']='Reward Mode', 'Theta', 'Zeta', 'Eta'}
	
end
	
function init_gear_sets()
	sets.precast.JA['Bestial Loyalty'] = {}
	sets.precast.JA['Call Beast'] = sets.precast.JA['Bestial Loyalty']
	
	-------------------------------------------------------------------------------------------------------------------
-- Complete Lvl 76-99 Jug Pet Precast List +Funguar +Courier +Amigo
-------------------------------------------------------------------------------------------------------------------

	sets.precast.JA['Bestial Loyalty'].FunguarFamiliar = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Seedbed Soil"})
	sets.precast.JA['Bestial Loyalty'].CourierCarrie = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Fish Oil Broth"})
	sets.precast.JA['Bestial Loyalty'].AmigoSabotender = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Sun Water"})
	sets.precast.JA['Bestial Loyalty'].NurseryNazuna = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="D. Herbal Broth"})
	sets.precast.JA['Bestial Loyalty'].CraftyClyvonne = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Cng. Brain Broth"})
	sets.precast.JA['Bestial Loyalty'].PrestoJulio = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="C. Grass. Broth"})
	sets.precast.JA['Bestial Loyalty'].SwiftSieghard = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Mlw. Bird Broth"})
	sets.precast.JA['Bestial Loyalty'].MailbusterCetas = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Gob. Bug Broth"})
	sets.precast.JA['Bestial Loyalty'].AudaciousAnna = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="B. Carrion Broth"})
	sets.precast.JA['Bestial Loyalty'].TurbidToloi = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Auroral Broth"})
	sets.precast.JA['Bestial Loyalty'].LuckyLulush = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="L. Carrot Broth"})
	sets.precast.JA['Bestial Loyalty'].DipperYuly = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Wool Grease"})
	sets.precast.JA['Bestial Loyalty'].FlowerpotMerle = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Vermihumus"})
	sets.precast.JA['Bestial Loyalty'].DapperMac = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Briny Broth"})
	sets.precast.JA['Bestial Loyalty'].DiscreetLouise = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Deepbed Soil"})
	sets.precast.JA['Bestial Loyalty'].FatsoFargann = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="C. Plasma Broth"})
	sets.precast.JA['Bestial Loyalty'].FaithfulFalcorr = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Lucky Broth"})
	sets.precast.JA['Bestial Loyalty'].BugeyedBroncha = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Svg. Mole Broth"})
	sets.precast.JA['Bestial Loyalty'].BloodclawShasra = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Rzr. Brain Broth"})
	sets.precast.JA['Bestial Loyalty'].GorefangHobs = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="B. Carrion Broth"})
	sets.precast.JA['Bestial Loyalty'].GooeyGerard = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Cl. Wheat Broth"})
	sets.precast.JA['Bestial Loyalty'].CrudeRaphie = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Shadowy Broth"})

-------------------------------------------------------------------------------------------------------------------
-- Complete iLvl Jug Pet Precast List
-------------------------------------------------------------------------------------------------------------------

	sets.precast.JA['Bestial Loyalty'].DroopyDortwin = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Swirling Broth"})
	sets.precast.JA['Bestial Loyalty'].PonderingPeter = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Vis. Broth"})
	sets.precast.JA['Bestial Loyalty'].SunburstMalfik = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Shimmering Broth"})
	sets.precast.JA['Bestial Loyalty'].AgedAngus = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Ferm. Broth"})
	sets.precast.JA['Bestial Loyalty'].WarlikePatrick = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Livid Broth"})
	sets.precast.JA['Bestial Loyalty'].ScissorlegXerin = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Spicy Broth"})
	sets.precast.JA['Bestial Loyalty'].BouncingBertha = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Bubbly Broth"})
	sets.precast.JA['Bestial Loyalty'].RhymingShizuna = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Lyrical Broth"})
	sets.precast.JA['Bestial Loyalty'].AttentiveIbuki = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Salubrious Broth"})
	sets.precast.JA['Bestial Loyalty'].SwoopingZhivago = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Windy Greens"})
	sets.precast.JA['Bestial Loyalty'].AmiableRoche = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Airy Broth"})
	sets.precast.JA['Bestial Loyalty'].HeraldHenry = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Trans. Broth"})
	sets.precast.JA['Bestial Loyalty'].BrainyWaluis = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Crumbly Soil"})
	sets.precast.JA['Bestial Loyalty'].HeadbreakerKen = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Blackwater Broth"})
	sets.precast.JA['Bestial Loyalty'].RedolentCandi = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Electrified Broth"})
	sets.precast.JA['Bestial Loyalty'].AlluringHoney = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Bug-Ridden Broth"})
	sets.precast.JA['Bestial Loyalty'].CaringKiyomaro = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Fizzy Broth"})
	sets.precast.JA['Bestial Loyalty'].VivaciousVickie = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Tant. Broth"})
	sets.precast.JA['Bestial Loyalty'].HurlerPercival = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Pale Sap"})
	sets.precast.JA['Bestial Loyalty'].BlackbeardRandy = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Meaty Broth"})
	sets.precast.JA['Bestial Loyalty'].GenerousArthur = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Dire Broth"})
	sets.precast.JA['Bestial Loyalty'].ThreestarLynn = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Muddy Broth"})
	sets.precast.JA['Bestial Loyalty'].BraveHeroGlenn = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Wispy Broth"})
	sets.precast.JA['Bestial Loyalty'].SharpwitHermes = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Saline Broth"})
	sets.precast.JA['Bestial Loyalty'].ColibriFamiliar = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Sugary Broth"})
	sets.precast.JA['Bestial Loyalty'].ChoralLeera = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Glazed Broth"})
	sets.precast.JA['Bestial Loyalty'].SpiderFamiliar = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Sticky Webbing"})
	sets.precast.JA['Bestial Loyalty'].GussyHachirobe = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Slimy Webbing"})
	sets.precast.JA['Bestial Loyalty'].AcuexFamiliar = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Poisonous Broth"})
	sets.precast.JA['Bestial Loyalty'].FluffyBredo = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Venomous Broth"})
	sets.precast.JA['Bestial Loyalty'].CursedAnnabelle = set_combine(sets.precast.JA['Bestial Loyalty'], {ammo="Creepy Broth"})
	
	sets.precast.JA.Reward = 	{main="Zoraal Ja's axe", sub="Zoraal Ja's axe", 
								 head="Bison warbonnet", body="Twilight Mail", neck="Promise Badge",
								 hands="Ogre Gloves", waist="Crudelis belt", ring1="Aqua ring", ring2="Aqua Ring"
								}

	sets.precast.JA.Reward.Theta = set_combine(sets.precast.JA.Reward, {ammo="Pet Food Theta"})
	sets.precast.JA.Reward.Zeta = set_combine(sets.precast.JA.Reward, {ammo="Pet Food Zeta"})
	sets.precast.JA.Reward.Eta = set_combine(sets.precast.JA.Reward, {ammo="Pet Food Eta"})
	
	sets.precast.WS = {body="Twilight Mail"}
	
	sets.engaged = {main="Budliqa", sub="Astolfo",
					body="Ferine gausape +1", head="Ferine cabasset +2", neck="Ferine necklace",
					hands="Brego gloves", ring1="Rajas ring", ring2="Heed ring", waist="Moepapa stone"}
	
	sets.aftercast = {}
	
	sets.idle = {body="Ferine gausape +1"}
	
	end
	-------------------------------------------------------------
	--functions
	----------------------------------------------
	function job_precast(spell, action, spellMap, eventArgs)

	if spell.english == 'Reward' then
		if player.status == 'Engaged' then
			disable('main','sub')
		else
			enable('main','sub')
		end
		if state.RewardMode.value == 'Theta' then
				equip(sets.precast.JA.Reward.Theta)
			elseif state.RewardMode.value == 'Zeta' then
				equip(sets.precast.JA.Reward.Zeta)
			elseif state.RewardMode.value == 'Eta' then
				equip(sets.precast.JA.Reward.Eta)	

		end
	end

	if spell.english == 'Bestial Loyalty' or spell.english == 'Call Beast' then
                if state.JugMode.value == 'FunguarFamiliar' then
					equip(sets.precast.JA['Bestial Loyalty'].FunguarFamiliar)
                elseif state.JugMode.value == 'CourierCarrie' then
					equip(sets.precast.JA['Bestial Loyalty'].CourierCarrie)
                elseif state.JugMode.value == 'AmigoSabotender' then
					equip(sets.precast.JA['Bestial Loyalty'].AmigoSabotender)
                elseif state.JugMode.value == 'NurseryNazuna' then
					equip(sets.precast.JA['Bestial Loyalty'].NurseryNazuna)
                elseif state.JugMode.value == 'CraftyClyvonne' then
					equip(sets.precast.JA['Bestial Loyalty'].CraftyClyvonne)
                elseif state.JugMode.value == 'PrestoJulio' then
					equip(sets.precast.JA['Bestial Loyalty'].PrestoJulio)
                elseif state.JugMode.value == 'SwiftSieghard' then
					equip(sets.precast.JA['Bestial Loyalty'].SwiftSieghard)
                elseif state.JugMode.value == 'MailbusterCetas' then
					equip(sets.precast.JA['Bestial Loyalty'].MailbusterCetas)
                elseif state.JugMode.value == 'AudaciousAnna' then
					equip(sets.precast.JA['Bestial Loyalty'].AudaciousAnna)
                elseif state.JugMode.value == 'TurbidToloi' then
					equip(sets.precast.JA['Bestial Loyalty'].TurbidToloi)
                elseif state.JugMode.value == 'SlipperySilas' then
					equip(sets.precast.JA['Bestial Loyalty'].SlipperySilas)
                elseif state.JugMode.value == 'LuckyLulush' then
					equip(sets.precast.JA['Bestial Loyalty'].LuckyLulush)
                elseif state.JugMode.value == 'DipperYuly' then
					equip(sets.precast.JA['Bestial Loyalty'].DipperYuly)
                elseif state.JugMode.value == 'FlowerpotMerle' then
					equip(sets.precast.JA['Bestial Loyalty'].FlowerpotMerle)
                elseif state.JugMode.value == 'DapperMac' then
					equip(sets.precast.JA['Bestial Loyalty'].DapperMac)
                elseif state.JugMode.value == 'DiscreetLouise' then
					equip(sets.precast.JA['Bestial Loyalty'].DiscreetLouise)
                elseif state.JugMode.value == 'FatsoFargann' then
					equip(sets.precast.JA['Bestial Loyalty'].FatsoFargann)
                elseif state.JugMode.value == 'FaithfulFalcorr' then
					equip(sets.precast.JA['Bestial Loyalty'].FaithfulFalcorr)
                elseif state.JugMode.value == 'BugeyedBroncha' then
					equip(sets.precast.JA['Bestial Loyalty'].BugeyedBroncha)
                elseif state.JugMode.value == 'BloodclawShasra' then
					equip(sets.precast.JA['Bestial Loyalty'].BloodclawShasra)
                elseif state.JugMode.value == 'GorefangHobs' then
					equip(sets.precast.JA['Bestial Loyalty'].GorefangHobs)
                elseif state.JugMode.value == 'GooeyGerard' then
					equip(sets.precast.JA['Bestial Loyalty'].GooeyGerard)
				elseif state.JugMode.value == 'CrudeRaphie' then
					equip(sets.precast.JA['Bestial Loyalty'].CrudeRaphie)
                elseif state.JugMode.value == 'DroopyDortwin' then
					equip(sets.precast.JA['Bestial Loyalty'].DroopyDortwin)
                elseif state.JugMode.value == 'PonderingPeter' then
                        equip(sets.precast.JA['Bestial Loyalty'].PonderingPeter)
                elseif state.JugMode.value == 'SunburstMalfik' then
                        equip(sets.precast.JA['Bestial Loyalty'].SunburstMalfik)
                elseif state.JugMode.value == 'AgedAngus' then
                        equip(sets.precast.JA['Bestial Loyalty'].AgedAngus)
                elseif state.JugMode.value == 'WarlikePatrick' then
                        equip(sets.precast.JA['Bestial Loyalty'].WarlikePatrick)
                elseif state.JugMode.value == 'ScissorlegXerin' then
                        equip(sets.precast.JA['Bestial Loyalty'].ScissorlegXerin)
                elseif state.JugMode.value == 'BouncingBertha' then
                        equip(sets.precast.JA['Bestial Loyalty'].BouncingBertha)
                elseif state.JugMode.value == 'RhymingShizuna' then
                        equip(sets.precast.JA['Bestial Loyalty'].RhymingShizuna)
                elseif state.JugMode.value == 'AttentiveIbuki' then
                        equip(sets.precast.JA['Bestial Loyalty'].AttentiveIbuki)
                elseif state.JugMode.value == 'SwoopingZhivago' then
                        equip(sets.precast.JA['Bestial Loyalty'].SwoopingZhivago)
                elseif state.JugMode.value == 'AmiableRoche' then
                        equip(sets.precast.JA['Bestial Loyalty'].AmiableRoche)
                elseif state.JugMode.value == 'HeraldHenry' then
                        equip(sets.precast.JA['Bestial Loyalty'].HeraldHenry)
                elseif state.JugMode.value == 'BrainyWaluis' then
                        equip(sets.precast.JA['Bestial Loyalty'].BrainyWaluis)
                elseif state.JugMode.value == 'HeadbreakerKen' then
                        equip(sets.precast.JA['Bestial Loyalty'].HeadbreakerKen)
                elseif state.JugMode.value == 'RedolentCandi' then
                        equip(sets.precast.JA['Bestial Loyalty'].RedolentCandi)
                elseif state.JugMode.value == 'AlluringHoney' then
                        equip(sets.precast.JA['Bestial Loyalty'].AlluringHoney)
                elseif state.JugMode.value == 'CaringKiyomaro' then
                        equip(sets.precast.JA['Bestial Loyalty'].CaringKiyomaro)
                elseif state.JugMode.value == 'VivaciousVickie' then
                        equip(sets.precast.JA['Bestial Loyalty'].VivaciousVickie)
                elseif state.JugMode.value == 'HurlerPercival' then
                        equip(sets.precast.JA['Bestial Loyalty'].HurlerPercival)
                elseif state.JugMode.value == 'BlackbeardRandy' then
                        equip(sets.precast.JA['Bestial Loyalty'].BlackbeardRandy)
                elseif state.JugMode.value == 'GenerousArthur' then
                        equip(sets.precast.JA['Bestial Loyalty'].GenerousArthur)
                elseif state.JugMode.value == 'ThreestarLynn' then
                        equip(sets.precast.JA['Bestial Loyalty'].ThreestarLynn)
                elseif state.JugMode.value == 'BraveHeroGlenn' then
                        equip(sets.precast.JA['Bestial Loyalty'].BraveHeroGlenn)
                elseif state.JugMode.value == 'SharpwitHermes' then
                        equip(sets.precast.JA['Bestial Loyalty'].SharpwitHermes)
                elseif state.JugMode.value == 'ColibriFamiliar' then
                        equip(sets.precast.JA['Bestial Loyalty'].ColibriFamiliar)
                elseif state.JugMode.value == 'ChoralLeera' then
                        equip(sets.precast.JA['Bestial Loyalty'].ChoralLeera)
                elseif state.JugMode.value == 'SpiderFamiliar' then
                        equip(sets.precast.JA['Bestial Loyalty'].SpiderFamiliar)
                elseif state.JugMode.value == 'GussyHachirobe' then
                        equip(sets.precast.JA['Bestial Loyalty'].GussyHachirobe)
                elseif state.JugMode.value == 'AcuexFamiliar' then
                        equip(sets.precast.JA['Bestial Loyalty'].AcuexFamiliar)
                elseif state.JugMode.value == 'FluffyBredo' then
                        equip(sets.precast.JA['Bestial Loyalty'].FluffyBredo)
				elseif state.JugMode.value == 'CursedAnnabelle' then
						equip(sets.precast.JA['Bestial Loyalty'].CursedAnnabelle)
		end
	end
end

function aftercast(spell)
	 if player.status == 'Idle' then
        equip(sets.engaged)
	elseif player.status == 'Engaged' then
		equip(sets.engaged)
    end
end

function status_change(new,old)
	if new == 'Resting' then
		if player.hpp > 50 then
			equip(sets.engaged)
		end
	end
end


 Shiva.Malthar
Offline
Serveur: Shiva
Game: FFXI
user: Malthar
Posts: 516
By Shiva.Malthar 2015-12-07 08:19:37
Link | Citer | R
 
I see you are using mote's. Have you tried creating your own gearswap from scratch to see how the whole thing works? I never much liked mote's, so I created my own gearswap base to act like spellcast.
 Leviathan.Vow
Offline
Serveur: Leviathan
Game: FFXI
user: woVow
Posts: 125
By Leviathan.Vow 2015-12-07 11:12:59
Link | Citer | R
 
You probably need to change aftercast and status_change to job_aftercast and job_status_change.


You can simplify that chunk to
Code
if spell.english == 'Bestial Loyalty' or spell.english == 'Call Beast' then
    equip(sets.precast.JA['Bestial Loyalty'][state.JugMode.value])
end
Offline
Posts: 7
By Sonicrich05 2015-12-09 13:40:20
Link | Citer | R
 
Thanks for the replies guys, I've been busy with homeowrk, am gonna try it when I get home.
Offline
Posts: 7
By Sonicrich05 2015-12-09 13:47:12
Link | Citer | R
 
Vow,

I tried job_status_change and it still goes to equip the resting set when I do something according to the debugmode. I'm completely confused as to why it's not working.
Log in to post.