Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions addons/Dimmer/Dimmer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
--[[
Copyright © 2018, Chiaia
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Dimmer nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]]

--Complete addon is almost a direct copy of MyHome from "from20020516" but for warping to a different area.

_addon.name = 'Dimmer'
_addon.author = 'Chiaia'
_addon.version = '1.1'
_addon.commands = {'dim','dimmer'}


require('logger')
extdata = require('extdata')

lang = string.lower(windower.ffxi.get_info().language)
item_info = {
[1]={id=26176,japanese='D.ホラリング',english='"Dim. Ring (Holla)"',slot=13},
[2]={id=26177,japanese='D.デムリング',english='"Dim. Ring (Dem)"',slot=13},
[3]={id=26178,japanese='D.メアリング',english='"Dim. Ring (Mea)"',slot=13},
}

function search_item()
local item_array = {}
local bags = {0,8,10,11,12} --inventory,wardrobe1-4
local get_items = windower.ffxi.get_items
for i=1,#bags do
for _,item in ipairs(get_items(bags[i])) do
if item.id > 0 then
item_array[item.id] = item
item_array[item.id].bag = bags[i]
end
end
end
for index,stats in pairs(item_info) do
local item = item_array[stats.id]
local set_equip = windower.ffxi.set_equip
if item then
local ext = extdata.decode(item)
local enchant = ext.type == 'Enchanted Equipment'
local recast = enchant and ext.charges_remaining > 0 and math.max(ext.next_use_time+18000-os.time(),0)
local usable = recast and recast == 0
log(stats[lang],usable and '' or recast and recast..' sec recast.')
if usable or ext.type == 'General' then
if enchant and item.status ~= 5 then --not equipped
set_equip(item.slot,stats.slot,item.bag)
log_flag = true
repeat --waiting cast delay
coroutine.sleep(1)
local ext = extdata.decode(get_items(item.bag,item.slot))
local delay = ext.activation_time+18000-os.time()
if delay > 0 then
log(stats[lang],delay)
elseif log_flag then
log_flag = false
log('Item use within 3 seconds..')
end
until ext.usable or delay > 10
end
windower.chat.input('/item '..windower.to_shift_jis(stats[lang])..' <me>')
break;
end
else
log('You don\'t have '..stats[lang]..'.')
end
end
end

windower.register_event('addon command',function(...)
local args = T{...}
local cmd = args[1]
if cmd == 'all' then
windower.chat.input('//dimmer')
windower.send_ipc_message('dimmer')
else
search_item()
end
end)

windower.register_event('ipc message',function (msg)
if msg == 'dimmer' then
windower.chat.input('//dimmer')
end
end)
14 changes: 14 additions & 0 deletions addons/Dimmer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Dimmer
## English
- Automatically choose and uses the first Dimensional Ring on cool down to warp to Reisenjima for you.

### Command
- `//dim` OR `//dimmer`
- `//dim all` OR `//dimmer all` will use ring on all characters.
- Priorities are:
1. Dim. Ring (Holla)
2. Dim. Ring (Dem)
3. Dim. Ring (Mea)

## 日本語
- Should support the Japanesse client too.
25 changes: 19 additions & 6 deletions addons/MyHome/MyHome.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]]

_addon.name = 'MyHome'
_addon.author = 'from20020516'
_addon.version = '1.0'
_addon.version = '1.1'
_addon.commands = {'myhome','mh','warp'}

require('logger')
Expand Down Expand Up @@ -85,15 +85,28 @@ function search_item()
end
end

windower.register_event('addon command',function()
windower.register_event('addon command',function(...)
local args = T{...}
local cmd = args[1]
if cmd == 'all' then
windower.chat.input('//myhome')
windower.send_ipc_message('myhome')
else
local player = windower.ffxi.get_player()
local get_spells = windower.ffxi.get_spells()
local spell = S{player.main_job_id,player.sub_job_id}[4]
and (get_spells[261] and player.vitals.mp >= 100 and {japanese='デジョン',english='"Warp"'}
or get_spells[262] and player.vitals.mp >= 150 and {japanese='デジョンII',english='"Warp II"'})
if spell then
windower.chat.input('/ma '..windower.to_shift_jis(spell[lang])..' <me>')
else
search_item()
if spell then
windower.chat.input('/ma '..windower.to_shift_jis(spell[lang])..' <me>')
else
search_item()
end
end
end)

windower.register_event('ipc message',function (msg)
if msg == 'myhome' then
windower.chat.input('//myhome')
end
end)
6 changes: 4 additions & 2 deletions addons/MyHome/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

### Command
- `//mh` OR `//warp`
- `//mh all` OR `//warp all` will warp all characters.


- Priorities are:
1. Warp <me\> - require learned and main job or sub job BLM.
2. Warp II <me\>
1. Warp <me> - require learned and main job or sub job BLM.
2. Warp II <me>
3. Warp Ring - search inventory and wardrobes.
4. Warp Cudgel
5. Instant Warp - search inventory.
Expand All @@ -18,6 +19,7 @@

### Command
- `//mh` または `//warp`
- `//mh all` または `//warp all` すべての文字をワープします。
- 優先順位:


Expand Down
7 changes: 7 additions & 0 deletions addons/addons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@
<description>Displays Chocobo digging accuracy, fatigue and remaining greens after each dig. Also shows dig "recast" timer using the Timers plugin.</description>
<bugtracker>https://github.com/svanheulen/digger-windower-addon/issues</bugtracker>
<support>http://www.ffxiah.com/player/Odin/Acacia</support>
</addon>
<addon>
<name>Dimmer</name>
<author>Chiaia</author>
<description>Helps warp you to Reisenjima using (Dim) Rings.</description>
<bugtracker>https://github.com/Windower/Lua/issues</bugtracker>
<support>https://discord.gg/b275nMv</support>
</addon>
<addon>
<name>Distance</name>
Expand Down