• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • [Quest Behavior]CODMail

    Discussion in 'Uncataloged' started by AknA, Apr 13, 2013.

    1. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      FAQ!

      What is CODMail?
      CODMail is a Quest Behavior that gives you the ability to send selected items to selected people (with or without COD).

      What does CODMail do?
      CODMail will first find the nearest mailbox, if you have one close to you, it will move to it.
      Then it will stack all your items you have in your bags.
      After that it will split one stack (if needed) to the amount it should send.
      It will then open the mailbox, fill in the information (name/subject/cod) and add the item and send it.

      How do I use this?
      In a quest profile use these commands.
      Name = Name of the one you want to send the mail to (REQUIRED)
      ItemID = The itemID of the item you want to send (REQUIRED)
      Amount = Amount of the item you want to send (OPTIONAL, default = 1)
      CodGold = Gold for the COD (OPTIONAL, default = 0)
      CodSilver = Silver for the COD (OPTIONAL, default = 0)
      CodCopper = Copper for the COD (OPTIONAL, default = 0)
      Note that the COD you set is for everything you send in that mail, it's NOT / stack.

      Examples:
      This would send 1 full stack of Windwool Cloth with COD 1 gold, 2 silver, 3 copper to AknA
      PHP:
      <CustomBehavior File="Misc\CODMail" Name="AknA" ItemID="72988" Amount="20" CodGold="1" CodSilver="2" CodCopper="3" />
      This would send 1 stack of 1 Windwool Cloth without COD to AknA
      PHP:
      <CustomBehavior File="Misc\CODMail" Name="AknA" ItemID="72988" />
      This would send 2 full stacks and one stack of 7 of Windwool Cloth without COD to AknA
      PHP:
      <CustomBehavior File="Misc\CODMail" Name="AknA" ItemID="72988" Amount="47" />
      This doesn't work?
      Then please write a post and include a log and explain what isn't working.

      I love this, do you accept donations?
      Yes, at the bottom of the post you can see a link if you have a coin to spare.

      Special thanks?
      HighVoltz for the stacking method, it was more clean than the one I made.
      chinajade for all the help with Behavior Tree programming questions.

      Current issues?
      None that I know of.

      How do I install this?
      You either download the file included in this post and copy it to your 'HB\Quest Behaviors\Misc' library.
      Or you can use this SVN Link
       

      Attached Files:

      Last edited: Apr 20, 2013
      perryjo17 and fertzi like this.
    2. Sowsix

      Sowsix New Member

      Joined:
      Jan 15, 2010
      Messages:
      73
      Likes Received:
      2
      Trophy Points:
      0
      Thanks a looooooooot for creating it AknA !!!!

      I test it now

      EDIT: Okay, after 1st test here is my result :

      It moves perfectly to the nearest mailbox

      I have 11 stack of 20 Ghost Iron Ore in my bags

      I use this line

      <CustomBehavior File="Misc\CODMail" Name="Sowsix" ItemID="72092" Amount="20" CodGold="35"/>

      It sending the 11 stack in one mail for 35 Gold ^^ So it is not sending item one stack at a time

      Testing now with 22 x 20 ghost iron .. same line

      He try to send all the stack in one mail, i've a red message like "you can't sent more than 12 stack in 1 mail" but it has successfully sending the 12 stacks
       
      Last edited: Apr 15, 2013
      perryjo17 likes this.
    3. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      Hmm ??? it shouldn't attach more than one item / mail, have to check the code then.
       
    4. fertzi

      fertzi New Member

      Joined:
      Oct 21, 2011
      Messages:
      87
      Likes Received:
      2
      Trophy Points:
      0
      mabey a stupid question, but can i use this in profession-buddy profiles?

      btw, nice work and thanks for the share :)
       
    5. Stormchasing

      Stormchasing Community Developer

      Joined:
      Jan 15, 2011
      Messages:
      4,029
      Likes Received:
      48
      Trophy Points:
      48
      the issue is in your lua

      Code:
                  Lua.DoString(
                      string.Format(
                      "local item = {0} ", ItemID) +
                      string.Format(
                      "local amount = {0} ", Amount) +
                      "attachDone = 0 " +
                      "for b=0,4 do " +
                          "for s=1,GetContainerNumSlots(b) do " +
                              "if ((GetContainerItemID(b,s) == item) and (select(2, GetContainerItemInfo(b,s)) == amount)) then " +
                                  "UseContainerItem(b,s) " +
                                  "attachDone = 1 " +
                              "end " +
                          "end " +
                      "end"
      
      this iterate through all your bags and attach everything with the correct item (id) and the correct stackcount (stacked by amount number), without counting how much items are attached and so on...
      for example u have 14 stacks of an ore with an StackSize of 20 ... it loops through all your 14 stacks and attach'em (well wow denies the last 3, but the code will try it^^), u need a bit more failsafety here .... for example at the place where u do attachDone=1, u also need to raise a var as multiplier for the COD-Value, or something like that
       
    6. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      Thanks Stormchasing :)
      Yes, that would work. But then it wouldn't work as I intend it to.
      Actually, how it works now was a thing I didn't think of but still a good thing, simple way to only attach 1 item would be to add "and attachDone ~= 1" to the if case to use the item. But as it worked in a way I didn't think of I think I might as well change it so it uses one more local variable in the lua that is amount, then just have a "amount = amount - GetStackinfo()" yes, I know I can't call that C# method in the code, but you get the point :)
       
    7. Stormchasing

      Stormchasing Community Developer

      Joined:
      Jan 15, 2011
      Messages:
      4,029
      Likes Received:
      48
      Trophy Points:
      48
      u could also precalc how many stacks u have and calc the amount of mails u will need, the amount of COD and so on within the c# code aswell
      there are of course multiple possible solutions possible :)
       
    8. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      Well, I'm working on so you can set any amount you want to send now instead, hopefully I get it done tomorrow.
       
    9. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      Fully working now, however, I couldn't upload the file due to issues with webserver, use SVN to get the file.
       
    10. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      There, file uploaded to main post again :)
       
    11. tantrim

      tantrim New Member

      Joined:
      Mar 14, 2013
      Messages:
      13
      Likes Received:
      0
      Trophy Points:
      0
      Does this c.o.d. work with profession buddy or gather buddy?
       
    12. Sharpmaxim

      Sharpmaxim New Member

      Joined:
      Oct 27, 2013
      Messages:
      56
      Likes Received:
      0
      Trophy Points:
      0
      I am sorry, but I can't find what does COD abbreviation mean?
       
    13. sevaa

      sevaa Member

      Joined:
      Apr 28, 2010
      Messages:
      327
      Likes Received:
      0
      Trophy Points:
      16
      Cash On Delivery
       
    14. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      For some reason the file was corrupted, dunno when that happend, I reuploaded the file again, should be fine now :)
       
    15. Thumped

      Thumped New Member

      Joined:
      Nov 1, 2010
      Messages:
      266
      Likes Received:
      3
      Trophy Points:
      0
      Akna, is there a way to send all of what you have in your bags of a specific id? Something like "Amount="*" " or all?
       
    16. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      When I have time, I'll look into adding that.
       
    17. Eddga

      Eddga New Member

      Joined:
      Jan 26, 2014
      Messages:
      13
      Likes Received:
      0
      Trophy Points:
      0
      Sorry for asking this again, but I can't find a working alternative cod plugin (except for MailMan which in turn only works with combat-botbase). So does this work with Profession/Gatherbuddy? Maybe it hasn't been answered because of really being a dumb question. But me not knowing if these botbases also use the Quest Behaviours :<
      Thanks in advance!

      P.S.:
      Upvote! :>
       
    18. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      QuestBehaviors work with Questing botbase and a profile that calls the behavior, can't swear on any other botbases, Gatherbuddy I'm 99% sure it won't work with as it's only locations in that and I'm not sure you can call QB's in Professionbuddy.

      And I haven't had time to look at adding a * ammount (actually forgot about that) but I'll try to look into it after work tonight (just home for lunch atm)
       
    19. Eddga

      Eddga New Member

      Joined:
      Jan 26, 2014
      Messages:
      13
      Likes Received:
      0
      Trophy Points:
      0
      Sadly that's what I expected and so the plugin is useless for me. Unless I could make the bot gather in questing botbase.. Hm I can't be the only one looking for such an plugin making the bot sending gathered things via cod to others..
      Thanks anyway!
       
    20. gyldson

      gyldson New Member

      Joined:
      Aug 7, 2014
      Messages:
      4
      Likes Received:
      0
      Trophy Points:
      0
      On what line do I put this code?
      <CustomBehavior File = "Misc \ CODMail" Name = "Gaulêz" ItemID = "72092" Amount = "5" CodGold = "35" />
      You could add 1 picture for best view I?
       

    Share This Page