Jump to content
  • Conjure Food/Conjure Water


    bonsai
    • Version: All Product: Fight Classes Type: Bug Status: Not a Bug

    Hi, I have conjure food and water set to be cast whenever the "item count" of the water and/or food reaches zero. I'm using the correct item ID and checked both with a bag property dump and on a website. The problem is, the bot repeatedly casts conjure food and conjure water even though I've got a significant amount of both in my inventory. Based on the rule, it should only ever cast when there is zero in my inventory. The specific level of the spell is conjure food rank 3 andthe conjured rye and conjured purified water. Any help/suggestions to correct the issue would be appreciated as it tends to fill my inventory up unnecessarily.



    User Feedback

    Recommended Comments

    bonsai

    Posted

    33 minutes ago, Droidz said:

     

    Do I add that lua check to the conditions in the same way that I would the item count?

    Droidz

    Posted

    3 minutes ago, bonsai said:

    Do I add that lua check to the conditions in the same way that I would the item count?

    The condition "itemcount" is using lua, and he can happen that lua return bad value (when game is loading by sample).

    bonsai

    Posted

    I'm sorry if I'm being dense. I'm not a programmer, but this is what the XML currently looks like:

     

    <SpellName>Conjure Water</SpellName>
         <Priority>13</Priority>
         <CombatOnly>false</CombatOnly>
       </FightClassSpell>
       <FightClassSpell>
         <FightClassConditions>
           <FightClassCondition>
             <ContionType>ItemCount</ContionType>
             <Param xsi:type="FightClassConditionItemNumber">
               <Id>1114</Id>
             </Param>
           </FightClassCondition>
         </FightClassConditions>
         <SpellName>Conjure Food</SpellName>
         <Priority>12</Priority>
       </FightClassSpell>
       <FightClassSpell>
         <FightClassConditions>
           <FightClassCondition>
             <ContionType>HealthPercent</ContionType>
             <Param xsi:type="FightClassConditionNumber">
               <Type>SmallerOrEqual</Type>
               <Value>90</Value>
             </Param>
           </FightClassCondition>

     

    bonsai

    Posted

    Whoa, my conditions were all deleted out. Hold on, let me fix that and see what it does.

    bonsai

    Posted

    Okay, full code. Sorry.

     

    <FightClassSpell>
          <FightClassConditions>
            <FightClassCondition>
              <ContionType>ItemCount</ContionType>
              <Param xsi:type="FightClassConditionItemNumber">
                <Number>1</Number>
                <Type>SmallerOrEqual</Type>
                <Id>2136</Id>
              </Param>
            </FightClassCondition>
            <FightClassCondition>
              <ContionType>LuaScript</ContionType>
              <Param xsi:type="FightClassConditionLua">
                <LuaScript>local count = GetItemCount(2136); 
    if (count &lt;= 1) { local name = GetSpellInfo(29975); 
    RunMacroText("/cast " .. name) }</LuaScript>
              </Param>
            </FightClassCondition>
          </FightClassConditions>
          <SpellName>Conjure Water</SpellName>
          <Priority>13</Priority>
          <CombatOnly>false</CombatOnly>
        </FightClassSpell>
        <FightClassSpell>
          <FightClassConditions>
            <FightClassCondition>
              <ContionType>ItemCount</ContionType>
              <Param xsi:type="FightClassConditionItemNumber">
                <Id>1114</Id>
              </Param>
            </FightClassCondition>
          </FightClassConditions>
          <SpellName>Conjure Food</SpellName>
          <Priority>12</Priority>
        </FightClassSpell>

     

    bonsai

    Posted

    Thanks. I'll give this a look.

    bonsai

    Posted

    I've implemented with the lua check as suggested. Is there any way to do that within the fightclass editor? Or do I have to do it in an xml editor?

    Droidz

    Posted

    To add easily these in your fightclass, download and move this fightclasses in folder "WRobot\Fightclass\", and:

     2017-02-08_11-05-32.gif

    bonsai

    Posted

    Does that work for all conjure water and conjure food? I've been editing the XML to reflect my specific conjured food IDs. I copied and pasted and revised the numbers to check the correct item id's based on a property dump.

    Here is my current script that doesn't appear to be working:

     

    <FightClassSpell>
          <FightClassConditions>
            <FightClassCondition>
              <ContionType>ItemCount</ContionType>
              <Param xsi:type="FightClassConditionItemNumber">
                <Number>1</Number>
                <Type>SmallerOrEqual</Type>
                <Id>2136</Id>
              </Param>
            </FightClassCondition>
            <FightClassCondition>
              <ContionType>IsSpellUsable</ContionType>
              <Param xsi:type="FightClassConditionStringBool">
                <Name>Conjure Water</Name>
                <Need>true</Need>
              </Param>
            </FightClassCondition>
          </FightClassConditions>
          <SpellName>local count = GetItemCount(2136);
    if (count &lt;= 1)
    {
    	local name = GetSpellInfo(29975);
    	RunMacroText("/cast " .. name) 
    }</SpellName>
          <Priority>18</Priority>
          <IsBuff>true</IsBuff>
          <CombatOnly>false</CombatOnly>
          <Timer>2000</Timer>
          <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
        </FightClassSpell>
        <FightClassSpell>
          <FightClassConditions>
            <FightClassCondition>
              <ContionType>ItemCount</ContionType>
              <Param xsi:type="FightClassConditionItemNumber">
                <Number>1</Number>
                <Type>SmallerOrEqual</Type>
                <Id>1114</Id>
              </Param>
            </FightClassCondition>
            <FightClassCondition>
              <ContionType>IsSpellUsable</ContionType>
              <Param xsi:type="FightClassConditionStringBool">
                <Name>Conjure Food</Name>
                <Need>true</Need>
              </Param>
            </FightClassCondition>
          </FightClassConditions>
          <SpellName>local count = GetItemCount(1114);
    if (count &lt;= 1)
    {
    	local name = GetSpellInfo(42955);
    	RunMacroText("/cast " .. name) 
    }
    </SpellName>
          <Priority>17</Priority>
          <IsBuff>true</IsBuff>
          <CombatOnly>false</CombatOnly>
          <Timer>2000</Timer>
          <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
        </FightClassSpell>

     



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...