Automatic Luopan Notifier

Eorzea Time
 
 
 
Language: JP EN FR DE
users online
Forum » FFXI » Jobs » Geomancer » Automatic Luopan Notifier
Automatic Luopan Notifier
Offline
Posts: 148
By RolandJ 2016-05-23 18:51:14
Link | Quote | Reply
 
Hello!

Here is some code that will notify you when your luopan dies or expires. It is something that has always bugged me since sometimes I get distracted from ffxi often thus am I very prone to forgetting to recast in a timely manner. With this I can make it tell me, yell at me, or both when my luopan dies. ^^

For a Mote-based GEO.lua
Code
--- ..:: Luopan Notifier ::.. ---
function job_pet_change(pet,gain_or_loss)
status_change(player.status)
if not gain_or_loss then
add_to_chat(123,'Your luopan has vanished.')
windower.play_sound('C:/Filepath/Filename.wav') --must be a .wav--
end
end


For a non Mote-based GEO.lua
Code
--- ..:: Luopan Notifier ::.. ---
function pet_change(pet,gain_or_loss)
status_change(player.status)
if not gain_or_loss then
add_to_chat(123,'Your luopan has vanished.')
windower.play_sound('C:/Filepath/Filename.wav') --must be a .wav--
end
end


Well, I hope that some people find that helpful! Thank you Krystela for teaching me this code.
[+]
Offline
Posts: 148
By RolandJ 2016-05-29 13:54:45
Link | Quote | Reply
 
Oh. I forgot to follow up on this post this for about a week. I found the answer elsewhere (thanks dlsmd!) and I'll post it here. Sorry to keep you guys waiting.

Since mote-include handles the function pet_change I must change it to job_pet_change so that it stays compatible with mote's structure. Simply changing that one detail makes this code work with a mote geo.lua ^^

Geo bubble death notification {You can have this.} :D
Offline
Posts: 5188
By Faelar 2016-05-29 14:04:15
Link | Quote | Reply
 
I have no idea what mote is, so I assume I'd go with the non-mote one. Where do I slap it into my lua for it to work, just anywhere?
[+]
Offline
Posts: 148
By RolandJ 2016-05-29 14:08:00
Link | Quote | Reply
 
Mote(Motenten) is an extensive library that you can load within a job.lua. Your job.lua has to be basically overhauled in order to make it compatible with it and so it's far easier to start with a job.lua that is already compatible instead of converting one.

I recommend putting it somewhere near the bottom of your job.lua, below the gearsets and precast/midcast functions. I put it among my other special functions at the bottom of my geo.lua such as my macro book set, self_commands, and status_change functions. Just make sure it's not inside another function and that if you already have a pet_change function that you merge my function with it instead of copying my function in alongside it, thus creating a duplicate function - do that and you should be golden.
[+]
 Asura.Calatilla
Offline
Server: Asura
Game: FFXI
user: Calatilla
Posts: 2507
By Asura.Calatilla 2016-05-29 17:31:00
Link | Quote | Reply
 
Why not just make it recast for you, that way you don't have pay attention at all
Offline
By Draylo 2016-05-29 18:33:11
Link | Quote | Reply
 
Asura.Calatilla said: »
Why not just make it recast for you, that way you don't have pay attention at all

I'm guessing its for a mule, not like its hard to play GEO but whatever makes it easier to multi box is less stress.
[+]
Offline
Posts: 265
By Nocki 2016-05-30 20:57:07
Link | Quote | Reply
 
Is it possible to still use this function, but not have it go off when you full circle?
Offline
Posts: 148
By RolandJ 2016-05-30 23:25:41
Link | Quote | Reply
 
I can think of one way to do that but I doubt it is the most efficient. I'd like to find a way that requires less code.

My method would be to assign a new value in your lua; let's go with 'Notifier'. Put a rule in your precast for full circle that has 'Notifier = 'Off'' and then put another rule in your aftercast for full circle that has 'Notifier = 'On'. Finally, put an 'if Notifier == 'On'' on the first line after the 'function pet_change(pet,gain_or_loss)' and then add an additional end at the bottom of that function to close out that if.

That might work but if it is too fast to prevent the notifier from going off - it would happen instanteously - then you can create a self_command that toggles the on/off value of the Notifier value. In the precast you can make it 'send_command('gs c COMMANDNAME;wait 0.5;gs c COMMANDNAME')' to make it toggle it off and keep it off for a brief period in order to keep the notifier from going off.
 Asura.Krystela
Offline
Server: Asura
Game: FFXI
Posts: 334
By Asura.Krystela 2016-05-31 00:20:09
Link | Quote | Reply
 
RolandJ said: »
Hello!

Here is some code that will notify you when your luopan dies or expires. It is something that has always bugged me since sometimes I get distracted from ffxi often thus am I very prone to forgetting to recast in a timely manner. With this I can make it tell me, yell at me, or both when my luopan dies. ^^

For a Mote-based GEO.lua
Code
--- ..:: Luopan Notifier ::.. ---
function job_pet_change(pet,gain_or_loss)
status_change(player.status)
if not gain_or_loss then
add_to_chat(123,'Your luopan has vanished.')
windower.play_sound('C:/Filepath/Filename.wav') --must be a .wav--
end
end


For a non Mote-based GEO.lua
Code
--- ..:: Luopan Notifier ::.. ---
function pet_change(pet,gain_or_loss)
status_change(player.status)
if not gain_or_loss then
add_to_chat(123,'Your luopan has vanished.')
windower.play_sound('C:/Filepath/Filename.wav') --must be a .wav--
end
end


Well, I hope that some people find that helpful!

Aurorastorm notifier. Luopan notifier... What next?
I don't want to create issues here but I can't lie that it tickles me a bit. You didn't made it, all you did is add sound to an already existing rule and you claiming that you did the entire rule, is annoying me.

At least you could give credit where it's due.
[+]
Offline
Posts: 148
By RolandJ 2016-05-31 07:26:06
Link | Quote | Reply
 
Ah - yes, Krystela did supply me with the function. Thank you again Krystela :D

For what it's worth I wasn't claiming to have created it. This thread was originally a question of "Why isn't this code that someone gave me working with my motenten GEO.lua" noting that I got it from someone else. When I updated the original post with the solution that bit got lost when I trimmed it down to an answer-only version.
[+]
 Shiva.Hiep
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 669
By Shiva.Hiep 2016-05-31 07:31:57
Link | Quote | Reply
 
Slightly off topic, but what's the max timer for Indi spells and how do you implement the timer to GS again?
[+]
 Odin.Lygre
Offline
Server: Odin
Game: FFXI
user: Dylaudid
Posts: 89
By Odin.Lygre 2016-05-31 09:06:07
Link | Quote | Reply
 
Code
function job_setup()
	indi_timer = ''
	indi_duration = 324
end

function job_aftercast(spell, action, spellMap, eventArgs)
	if not spell.interrupted then
		if spell.english:startswith('Indi') then
			send_command('@timers d "'..indi_timer..'"')
			indi_timer = spell.english
			send_command('@timers c "'..indi_timer..'" '..indi_duration..' down')
		end
	end
end

Not sure about absolute max indi-duration, but 324 is pretty close i think.
[+]
 Asura.Sechs
Offline
Server: Asura
Game: FFXI
user: Akumasama
Posts: 9876
By Asura.Sechs 2016-05-31 09:16:24
Link | Quote | Reply
 
Indicolure base duration is 3 minutes (180 seconds).
We can get duration enhancements from these sources:

Solstice (+15 seconds, static)
Bagua Pants +1 (+15 seconds, static)
Azimuth Gaiters +1 (+20 seconds, static)
Lifestream cape (up to +20% duration, percentage)
Nantosuelta's cape (+20 seconds, static)
Job Points (+40 seconds, static)


The % duration bonus is calculated after all static values have been added.
So formula is (Baseduration + Gearduration + JPduration) + X% of the previous sum total.

Under these circumstances the max total duration should be 324 seconds if you midcast with Solstice.
Idris owners are gonna see such values only if they swap to Solstice, for instance during Entrust (since Idris potency doesn't matter for that anyway).
[+]
Offline
Posts: 5188
By Faelar 2016-05-31 23:20:44
Link | Quote | Reply
 
Any way to set the soundfile in the code to be a <call> from the game?
[+]
 Asura.Krystela
Offline
Server: Asura
Game: FFXI
Posts: 334
By Asura.Krystela 2016-05-31 23:44:58
Link | Quote | Reply
 
Faelar said: »
Any way to set the soundfile in the code to be a <call> from the game?
Yes, doing a send_command with a <call> in it, but you are going to annoy everyone in your party lol

The original code did an echo, mine sends a tell to my main character.

I also have an indi timer, we did with 300s to be safe but 324 sounds right.
[+]
Offline
Posts: 5188
By Faelar 2016-06-01 00:41:22
Link | Quote | Reply
 
Asura.Krystela said: »

The original code did an echo, mine sends a tell to my main character.

This is what I would like for it to do, but when I stick the code in my lua, I get errors galore as long as my luopan is out, saying something is a nil value.

Non-mote, btw. Dunno what Mote is, so I figured non-mote was the way to go.
[+]
 Asura.Extract
Offline
Server: Asura
Game: FFXI
user: deezydabs
Posts: 40
By Asura.Extract 2016-06-01 02:06:52
Link | Quote | Reply
 
Asura.Krystela said: »
I don't want to create issues here but I can't lie that it tickles me a bit. You didn't made it, all you did is add sound to an already existing rule and you claiming that you did the entire rule, is annoying me.

At least you could give credit where it's due.

Thank you for this. Helps a lot! Although it isn't playing a sound for me :(
[+]
Offline
By Amunaptra 2016-06-01 02:19:48
Link | Quote | Reply
 
Asura.Sechs said: »
Entrust (since Idris potency doesn't matter for that anyway).

I believe this is a very popular false rumor.
I don't have Idris but i'm 100% sure Dunna potency affects the Entrusted spells since I tested myself
 Fenrir.Nightfyre
Offline
Server: Fenrir
Game: FFXI
user: Nightfyre
Posts: 11680
By Fenrir.Nightfyre 2016-06-01 02:24:56
Link | Quote | Reply
 
You're 100% wrong. Geomancy+ does not affect entrusted spells.
[+]
 Odin.Llewelyn
Offline
Server: Odin
Game: FFXI
user: Llewelyn
Posts: 2254
By Odin.Llewelyn 2016-06-01 02:55:24
Link | Quote | Reply
 
Testing now reconfirms Geomancy+ does not affect Entrust. Dunna and Idris Entrusted Indi-Barriers granted the same additional defense.
[+]
 Asura.Sechs
Offline
Server: Asura
Game: FFXI
user: Akumasama
Posts: 9876
By Asura.Sechs 2016-06-01 03:07:11
Link | Quote | Reply
 
Yep, can test it with indi-stats as well or indi fury or indiprecision. Very easy, don't even need a mule or a friend, call a trust and entrust unto them.

No clue how Amunaptra could get such results, it's very easy to test o.o
I mean, no big deal in the end, but I'm puzzled how you can get wrong results in such a simple test.
[+]
Offline
By Amunaptra 2016-06-01 03:17:38
Link | Quote | Reply
 
Well guess I was wrong, my apologize.

I tested a while back with a friend doing indi-regen I believe, something must gone wrong I suppose
[+]
 Odin.Llewelyn
Offline
Server: Odin
Game: FFXI
user: Llewelyn
Posts: 2254
By Odin.Llewelyn 2016-06-01 03:20:58
Link | Quote | Reply
 
One possible error you may have done was doing the non-Geomancy+ test without a bell equipped, which would reduce quite a bit of skill since you wouldn't be getting any of your Handbell skill and thus losing out on some potency. But whatevs.
[+]
 Asura.Sechs
Offline
Server: Asura
Game: FFXI
user: Akumasama
Posts: 9876
By Asura.Sechs 2016-06-01 03:42:54
Link | Quote | Reply
 
Oh that's a good one, could've lost a bit of potency from the lack of handbell skill, quite a bit actually, and then equipping Dunna would have made a difference, leading him to believe Geomancy+ was working.

Pretty confident that's what happened now, makes total sense :D
[+]
 Asura.Krystela
Offline
Server: Asura
Game: FFXI
Posts: 334
By Asura.Krystela 2016-06-01 04:43:21
Link | Quote | Reply
 
Faelar said: »
Asura.Krystela said: »

The original code did an echo, mine sends a tell to my main character.

This is what I would like for it to do, but when I stick the code in my lua, I get errors galore as long as my luopan is out, saying something is a nil value.

Non-mote, btw. Dunno what Mote is, so I figured non-mote was the way to go.

My existing code:
Code
--- ..:: Pet Status change ::.. --->
function pet_change(pet,gain_or_loss)
    status_change(player.status)
    if not gain_or_loss then
        enable('feet')
		send_command('input /t Krystela ..:: Luopan died ::..')
    end	
end


can change the send_command to :
Code
send_command('input /p <call> ..:: Luopan died ::..')


Mine isnt mote either, entirely made by me xD
[+]
Offline
Posts: 5188
By Faelar 2016-06-01 22:49:51
Link | Quote | Reply
 
I keep getting this, constantly, as long as my Luopan is out, using the above code you posted.

[+]
 Asura.Krystela
Offline
Server: Asura
Game: FFXI
Posts: 334
By Asura.Krystela 2016-06-01 23:11:07
Link | Quote | Reply
 
Faelar said: »
I keep getting this, constantly, as long as my Luopan is out, using the above code you posted.

Just take out the status change part, it's because you dont have a status change category in your lua.

But I suggest you making one, it makes the lua constantly check for changes.
[+]