A Question For Lua Users Regarding Sublimation.

言語: JP EN DE FR
2010-06-21
New Items
users online
フォーラム » FFXI » Jobs » Scholar » A question for lua users regarding sublimation.
A question for lua users regarding sublimation.
 Bahamut.Odaru
Offline
サーバ: Bahamut
Game: FFXI
By Bahamut.Odaru 2017-03-24 15:30:34  
I'm very new to lua, I never used SC so I'm slowly learning the language whenever time permits me to actually play and modify my own luas. Someone gave me a really basic mage lua and I've been revising/building on it for my SCH, but I can't seem to get it to switch to idle sublimation gear when sublimation is active. What I have written is:

function aftercast(spell)

if player.status == 'Sublimation: Activated'
then equip(sets.Idle.Sublimation)
else equip(sets.Idle[sets.Idle.index[Idle_ind]])
end

I've tried looking at others' luas, but again I'm very new to the language and have a hard time discerning how to revise my own in accordance to theirs to make the ability work, every time I try to revise this section I just get console errors about functions and lines. If someone could tell me how to revise my lines/what to replace them with I'd greatly appreciate it.
 Fenrir.Caiir
VIP
Offline
サーバ: Fenrir
Game: FFXI
user: Minjo
Posts: 199
By Fenrir.Caiir 2017-03-24 15:53:49  
First, player.status refers to whether you are Idle, Engaged, Resting, Dead, fishing, etc.

For a list of variables available to you, look in your beta examples and information folder for an excel file.

Second, you have you created the table sets.Idle.index? That's done with sets.Idle.index = {}. The variable "Idle_ind" will also have be to created and defined.

If you have
Code
sets = {}
sets.Idle = {}
sets.Idle.Sublimation = { 
-- gear here 
}
sets.Idle.Standard = {
 -- gear here
} 

function aftercast(spell,action_type)

  if buffactive['sublimation: activated'] then 
     equip(sets.Idle.Sublimation)
  else
     equip(sets.Idle.Standard)
  end
end


That covers the behavior you explained. Keep in mind that . And [] both access a table value, and if that table does not exist, you will get errors.
 Fenrir.Caiir
VIP
Offline
サーバ: Fenrir
Game: FFXI
user: Minjo
Posts: 199
By Fenrir.Caiir 2017-03-24 15:54:48  
I'd better explain a method for handling switching to an Idle set, but alas I am on mobile and coding on mobile is tragic.
 Ragnarok.Martel
Offline
サーバ: Ragnarok
Game: FFXI
Posts: 2894
By Ragnarok.Martel 2017-03-24 15:54:49  
Player.status is only for idle/engaged/resting and amusingly, dead.

You need buffactive.

So like, if buffactive["Sublimation: Activated"] then
 Bahamut.Odaru
Offline
サーバ: Bahamut
Game: FFXI
By Bahamut.Odaru 2017-03-28 08:44:21  
I was able to modify the line to get the aftercast functioning properly. Thank you guys so much.
[+]
Log in to post.