Item Search
     
BG-Wiki Search
Page 82 of 302 FirstFirst ... 32 72 80 81 82 83 84 92 132 ... LastLast
Results 1621 to 1640 of 6036

Thread: Gearswap Help Thread!     submit to reddit submit to twitter

  1. #1621
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    OK for whm i made some code to change what tier cure spell is cast based on target's HP and caster MP. I like to use Cure 1 for this, so that i can directly cast Cure 2-6 if needed. I took my code in spellcast and tried to make something similiar in gearswap. Its crazy long and it works somewhat. Sometimes it doesnt do anything when i cast cure 1 (according to showswaps its doin precast and stopping.) usually when the target's hp is pretty close to topped off. And i suspect its is doin an infinite loop or something. So i am going to post the code from spellcast and then what i came up with, if anyone can take a look at what i got and tell me how i am doin it wrong or to fix it or show me a better way that would be awesome sauce!

    The spellcast code
    Code:
    <if Spell="Cure" SpellTargetType="PLAYER|SELF">					    <!-- Vanadiel #s 95  85  65  40  20  0 -->
    			<action type="Equip" when="precast" set="FCHeal" />
    			<action type="Equip" when="midcast" set="Healing" />
    			<if SpellTargetHPPGT="95">
    				<changespell Spell="Cure" />
    			</if>
    			<elseif SpellTargetHPPGT="90">
    				<changespell Spell="Cure II" />
    			</elseif>
    			<elseif SpellTargetHPPGT="70">
    				<if MPGT="46"> <changespell Spell="Cure III" /> </if>
    				<elseif MPGT="24"> <changespell Spell="Cure II" /> </elseif>
    				<else> <changespell Spell="Cure" /> </else>
    			</elseif>
    			<elseif SpellTargetHPPGT="40">
    				<if MPGT="88"> <changespell Spell="Cure IV" /> </if>
    				<elseif MPGT="46"> <changespell Spell="Cure III" /> </elseif>
    				<elseif MPGT="24"> <changespell Spell="Cure II" /> </elseif>
    				<else> <changespell Spell="Cure" /> </else>
    				</elseif>
    			<elseif SpellTargetHPPGT="20">
    				<if MPGT="135"> <changespell Spell="Cure V" /> </if>
    				<elseif MPGT="88"> <changespell Spell="Cure IV" /> </elseif>
    				<elseif MPGT="46"> <changespell Spell="Cure III" /> </elseif>
    				<elseif MPGT="24"> <changespell Spell="Cure II" /> </elseif>
    				<else> <changespell Spell="Cure" /> </else>
    			</elseif>
    			<elseif MPGT="227"> <changespell Spell="Cure VI" /> </elseif>
    			<elseif MPGT="135"> <changespell Spell="Cure V" /> </elseif>
    			<elseif MPGT="88"> <changespell Spell="Cure IV" /> </elseif>
    			<elseif MPGT="46"> <changespell Spell="Cure III" /> </elseif>
    			<elseif MPGT="24"> <changespell Spell="Cure II" /> </elseif>
    			<else> <changespell Spell="Cure" /> </else>
    		</if>
    the gearswap code (in the precast function, I think its where it should go?)

    Code:
    if spell.name == 'Cure' then
    			equip(sets.MA.FC.Cure)
    			if spell.target.type == 'SELF' or spell.target.type == 'PLAYER' then
    			if spell.target.hpp >= 98 then
    				cancel_spell()
    				send_command('Cure')
    			elseif spell.target.hpp >= 95 then
    				cancel_spell()
    				send_command('Cure II')
    			elseif spell.target.hpp >= 85 then
    				if player.mp >= 46 then
    					cancel_spell()
    					send_command('Cure III')
    				elseif player.mp >= 24 then
    					cancel_spell()
    					send_command('Cure II')
    				else 
    					cancel_spell()
    					send_command('Cure')
    				end
    			elseif spell.target.hpp >= 65 then
    				if player.mp >= 88 then
    					cancel_spell()
    					send_command('Cure IV')
    				elseif player.mp >= 46 then
    					cancel_spell()
    					send_command('Cure III')
    				elseif player.mp >= 24 then
    					cancel_spell()
    					send_command('Cure II')
    				else 
    					cancel_spell()
    					send_command('Cure')
    				end
    			elseif spell.target.hpp >= 30 then
    				if player.mp >= 135 then
    					cancel_spell()
    					send_command('Cure V')
    				elseif player.mp >= 88 then
    					cancel_spell()
    					send_command('Cure IV')
    				elseif player.mp >= 46 then
    					cancel_spell()
    					send_command('Cure III')
    				elseif player.mp >= 24 then
    					cancel_spell()
    					send_command('Cure II')
    				else 
    					cancel_spell()
    					send_command('Cure')
    				end
    			elseif player.mp >= 227 then
    				cancel_spell()
    				send_command('Cure VI')
    			elseif player.mp >= 135 then
    				cancel_spell()
    				send_command('Cure V')
    			elseif player.mp >= 88 then
    				cancel_spell()
    				send_command('Cure IV')
    			elseif player.mp >= 46 then
    				cancel_spell()
    				send_command('Cure III')
    			elseif player.mp >= 24 then
    				cancel_spell()
    				send_command('Cure II')
    			else 
    				cancel_spell()
    				send_command('Cure')
    			end
    			end
    		end

  2. #1622
    Smells like Onions
    Join Date
    Mar 2010
    Posts
    5
    BG Level
    0
    FFXI Server
    Ramuh

    Using Mote's WHM GS, Is there a way to toggle curagas between full MND and enmity -?

  3. #1623
    BG Content
    Join Date
    Jul 2007
    Posts
    22,361
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Quote Originally Posted by Zerowone View Post
    Having an issue with this specific line of code:

    Code:
    elseif command == 'Barrage' then
    	Barrage_Index = Barrage_Index +1
    	if Barrage Index > #Barrage_Set_Names then Barrage_Index = 1 end
    	add_to_chat(8,'Barrage Set Changed to: '..Barrage_Set_Names[Barrage_Index]..'')
    error : "then" expected near "index".
    The specific line being called on console is:
    Code:
    if Barrage Index > #Barrage_Set_Names then Barrage_Index = 1 end
    If you didn't figure it out yet, the problem is that you have "Barrage Index" instead of "Barrage_Index"

  4. #1624
    BG Content
    Join Date
    Jul 2007
    Posts
    22,361
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Quote Originally Posted by Darkmagi View Post
    Is there another step other than just putting said augmented item in a gear set? I think that's what I'm missing.
    No, there shouldn't be. You should be able to just drop the whole table into a gearset.

  5. #1625
    Melee Summoner
    Join Date
    May 2014
    Posts
    36
    BG Level
    1
    FFXI Server
    Ragnarok

    Quote Originally Posted by Tronian View Post
    Thanks for the help, i will try it later tonight. hope it works.
    The changing of spells work now, thanks everyone for the help.

  6. #1626
    Fake Numbers
    Join Date
    Oct 2012
    Posts
    79
    BG Level
    2
    FFXI Server
    Lakshmi

    Quote Originally Posted by Byrthnoth View Post
    If you didn't figure it out yet, the problem is that you have "Barrage Index" instead of "Barrage_Index"
    Thanks! I noticed after posting it. Now the file is loading fine but I'm getting an error from Mote-Include.lua on line 1, unexpected symbol.

    Spoiler: show


    Code:
    -------------------------------------------------------------------------------------------------------------------
    -- Common variables and functions to be included in job scripts, for general default handling.
    --
    -- Include this file in the get_sets() function with the command:
    -- include('Mote-Include.lua')
    --
    -- It will then automatically run its own init_include() function.
    --
    -- IMPORTANT: This include requires supporting include files:
    -- Mote-Utility
    -- Mote-Mappings
    -- Mote-SelfCommands
    -- Mote-Globals
    --
    -- Place the include() directive at the start of a job's get_sets() function.
    --
    -- Included variables and functions are considered to be at the same scope level as
    -- the job script itself, and can be used as such.
    -------------------------------------------------------------------------------------------------------------------
    
    -------------------------------------------------------------------------------------------------------------------
    -- Initialization function that defines variables to be used.
    -- These are accessible at the including job lua script's scope.
    --
    -- Auto-initialize after defining this function.
    -------------------------------------------------------------------------------------------------------------------
    
    
    function init_include()
    	-- Used to define various types of data mappings.  These may be used in the initialization,
    	-- so load it up front.
    	include('Mote-Mappings')
    
    	-- Var for tracking misc info
    	info = {}
    
    	-- Var for tracking state values
    	state = {}
    
    	-- General melee offense/defense modes, allowing for hybrid set builds, as well as idle/resting/weaponskill.
    	state.OffenseMode     = 'Normal'
    	state.DefenseMode     = 'Normal'
    	state.RangedMode      = 'Normal'
    	state.WeaponskillMode = 'Normal'
    	state.CastingMode     = 'Normal'
    	state.IdleMode        = 'Normal'
    	state.RestingMode     = 'Normal'
    
    	-- All-out defense state, either physical or magical
    	state.Defense = {}
    	state.Defense.Active       = false
    	state.Defense.Type         = 'Physical'
    	state.Defense.PhysicalMode = 'PDT'
    	state.Defense.MagicalMode  = 'MDT'
    
    	state.Kiting               = false
    	state.MaxWeaponskillDistance = 0
    
    	state.SelectNPCTargets     = false
    	state.PCTargetMode         = 'default'
    
    	state.CombatWeapon = nil
    	state.CombatForm = nil
    
    	state.Buff = {}
    
    
    	-- Vars for specifying valid mode values.
    	-- Defaults here are just for example. Set them properly in each job file.
    	options = {}
    	options.OffenseModes = {'Normal'}
    	options.DefenseModes = {'Normal'}
    	options.RangedModes = {'Normal'}
    	options.WeaponskillModes = {'Normal'}
    	options.CastingModes = {'Normal'}
    	options.IdleModes = {'Normal'}
    	options.RestingModes = {'Normal'}
    	options.PhysicalDefenseModes = {'PDT'}
    	options.MagicalDefenseModes = {'MDT'}
    
    	options.TargetModes = {'default', 'stpc', 'stpt', 'stal'}
    I put the globals, mappings, self commands and utility files in the Gearswap/data folder. I've noticed this happen on every job template, so I figure I must be doing something wrong.

  7. #1627
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    i have been doing some reading would this be accurate??

    if spell.english == 'Indi-%.*' then -- this would be true for all spells starting with Indi- ??

    i found this info here
    http://www.lua.org/pil/20.2.html

  8. #1628
    RIDE ARMOR
    Join Date
    Jan 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Leviathan

    Do i have to manually unbind every job specific custom bind I make with something like " send_command('unbind ^`') " in the file_unload() call, or is there like an unbind all stuffs command or something?

  9. #1629
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by wigmasterflex View Post
    Do i have to manually unbind every job specific custom bind I make with something like " send_command('unbind ^`') " in the file_unload() call, or is there like an unbind all stuffs command or something?
    you can clearbinds but that will also unbind all windower default key binds like paste,etc.
    but other then that you would have to unbind each separately in function file_unload

  10. #1630
    Sea Torques
    Join Date
    Sep 2012
    Posts
    736
    BG Level
    5
    FFXI Server
    Leviathan

    Quote Originally Posted by dlsmd View Post
    i have been doing some reading would this be accurate??

    if spell.english == 'Indi-%.*' then -- this would be true for all spells starting with Indi- ??

    i found this info here
    http://www.lua.org/pil/20.2.html
    You'd have to use this if you wanna do it the pure Lua way:
    Code:
    if spell.english:match('Indi%-.*') then
    But this way is preferable:
    Code:
    if spell.english:startswith('Indi-') then

  11. #1631
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Arcon View Post
    You'd have to use this if you wanna do it the pure Lua way:
    Code:
    if spell.english:match('Indi%-.*') then
    But this way is preferable:
    Code:
    if spell.english:startswith('Indi-') then
    ok thats what i thought
    well there is another notch on my lua belt still learning

  12. #1632
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by dlsmd View Post
    i have been doing some reading would this be accurate??

    if spell.english == 'Indi-%.*' then -- this would be true for all spells starting with Indi- ??

    i found this info here
    http://www.lua.org/pil/20.2.html
    EDIT: Arcon beat me to it

    That won't work, since you need a function that supports patern matching on strings. (assuming spell.english is guaranteed to be a string)

    Either of these would work.
    Code:
    if string.find(spell.english, "^Indi%-%a+") then 
        print("We have a match!")
    end
    
    if spell.english:match("^Indi%-%a+") then
        print("We have a match!")
    end
    The pattern can be broken down.
    (^Indi)
    string that starts with the chars: Indi

    (%-)
    The "-" character is a magic character, so we have to escape it with "%" so that it's actually counted as a normal character.

    (%a+)
    %a matches any letter, and the "+" signals that we need at least 1 present. So, "Indi-" would fail, and "Indi-21" would fail, but "Indi-Torpor" would pass.

    This is probably overkill though, since you can likely get away with something simple like string:match("^Indi")

  13. #1633
    Melee Summoner
    Join Date
    Jan 2008
    Posts
    31
    BG Level
    1

    Noticed an update was downloaded for gearswap... but now, whenever I /ra <t> I get the following error message:

    GearSwap: Lua error (runtime) - ...gram files (x86)/Windower4//addons/GearSwap/flow.lua:276:
    GearSwap has detected an error in the user function pretarge:
    .../Program Files (x86)/Windower4//addons/libs/sets.lua:103: bad argument #1 to 'pairs' (table expected, got string)


    any idea what this is?

  14. #1634
    RIDE ARMOR
    Join Date
    Jan 2014
    Posts
    22
    BG Level
    1

    Any one had any luck running Bokuras RNG Lua? I has alsways worked perfectly until the last update. Now when i use my /ra macro it says out of range no matter how close i am to the mob.

    he says he used a lot of Moten features but i dont even see a RNG lua listed there. Here is a link if someone would be kind enough to help me troubleshoot it.

    http://pastebin.com/P8EmY3w0

  15. #1635
    BG Content
    Join Date
    Jul 2007
    Posts
    22,361
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Quote Originally Posted by Astaro View Post
    Noticed an update was downloaded for gearswap... but now, whenever I /ra <t> I get the following error message:

    GearSwap: Lua error (runtime) - ...gram files (x86)/Windower4//addons/GearSwap/flow.lua:276:
    GearSwap has detected an error in the user function pretarge:
    .../Program Files (x86)/Windower4//addons/libs/sets.lua:103: bad argument #1 to 'pairs' (table expected, got string)


    any idea what this is?
    This is probably related to the resources switch today. Could you pastebin your file please?

  16. #1636
    Melee Summoner
    Join Date
    Jan 2008
    Posts
    31
    BG Level
    1

    flow.lua = http://pastebin.com/hTibtGYN

    sets.lua = http://pastebin.com/q7iPKCA2

    was using this lua for my RNG getting the error: http://pastebin.com/tesCnHwZ

    hope this helps~

  17. #1637
    RIDE ARMOR
    Join Date
    Jan 2014
    Posts
    22
    BG Level
    1

    Dev Vs Non Dev

    Can someone tell me what is the difference between dev version of windower and non dev? Are there advantages of using one over the other?

    thanks

  18. #1638
    Sea Torques
    Join Date
    Sep 2012
    Posts
    736
    BG Level
    5
    FFXI Server
    Leviathan

    The dev version gets new features faster, but in return it's often less stable (because it's usually experimental when it gets released there). That's the only difference. Once initial bugs are ironed out, they're pushed to live (non-dev).

    It's a way for people to test things and report bugs faster, so that when we push them to live there'll be less bitching from the general public

  19. #1639
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by Byrthnoth View Post
    This is probably related to the resources switch today. Could you pastebin your file please?
    I looked at the addons git repo to try and figure out what resources were changed. (that was my RNG.lua Astaro is using, so I'm interested in fixing it as well)

    I found instances of spell.english changed to spell[language] and there's a new "res" table. Are these changes documented anywhere?

    For example, are there any other changes to the spell table?

    Thanks

  20. #1640
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Zerowone View Post
    Thanks! I noticed after posting it. Now the file is loading fine but I'm getting an error from Mote-Include.lua on line 1, unexpected symbol.

    I put the globals, mappings, self commands and utility files in the Gearswap/data folder. I've noticed this happen on every job template, so I figure I must be doing something wrong.
    That sounds like you managed to save your files as UTF (unicode). That adds a hidden byte-order mark in the first couple bytes of the file, which Lua chokes on. It's most likely due to a setting on your text editor. You need to save your files in a non-unicode encoding format (my default is 1252 ANSI Latin I).

    If you have difficulty finding it, tell us which editor you use, and someone can probably find where the setting is.

Page 82 of 302 FirstFirst ... 32 72 80 81 82 83 84 92 132 ... LastLast

Similar Threads

  1. Replies: 6547
    Last Post: 2014-07-08, 22:45