PowerArrows *2*

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

Zxeses
a ghoul
a ghoul
Posts: 103
Joined: Tue Jan 07, 2003 4:17 pm

PowerArrows *2*

Post by Zxeses » Tue Jul 29, 2003 3:53 pm

I played around with the powerarrows macro, and the fixes that came out after it. Since none of them actually worked most of the time, and thinking I could improve the situation, here's what I have:


--Combines reasonably fast, without "missing" or skipping

--Will not create more arrows after you've reached an important skill level, 1 arrow per round, then skillcheck.

--Sell Arrows will wait until the arrows are actually sold

--Uses event checking to speed up delays

--Doesnt attempt to do uneeded steps (could improve on this later)

--WILL NOT BUY ITEMS YOU ALREADY HAVE, if you stop the macro half way thru a combine, you can start again and it will finish the half done one before starting the next.

Code: Select all

|  PowerArrows.mac
|  Original by macrotoon

| 1. Put your fletching kit in your FIRST inventory slot
| 2. Click open the merchant you wish to use
|
|   Notes: If this fails in ShadowHaven, try the POK or another vendor
|          An unfixed locations bug causes it to fail to sell the arrows
|          on certain merchants.
|
|   DO NOT AFK MACRO
|

#turbo

#define CurFletchSkill v1
#define LastFail v4
#define LastSuc v5
#define CombinerID v88

#event ErrorCombine "You cannot combine these items in this container type!"
#event FailedCombine "You lacked the skills to fashion the items together."
#event SuccessCombine "You have fashioned the items together to create something new!"


Sub Main

/varset CombinerID 99
/if "$pack(0,combine)"=="Fletching" /varset CombinerID 0
/if n $CombinerID==99 {
   /echo The Fletching kit *MUST* be in the first inventory slot
   /return
   /endmacro
   }


:SkillCheck
| /skill Fletch
/varset CurFletchSkill $char(skill,"fletching")
/if n $CurFletchSkill<30 /call MedGroveNock
/if n $CurFletchSkill<65 /if n $CurFletchSkill>=30 /call BoneShaft
/if n $CurFletchSkill<100 /if n $CurFletchSkill>=65 /call HookedArrowHead
/if n $CurFletchSkill<130 /if n $CurFletchSkill>=100 /call CeramicShaft
/if n $CurFletchSkill<160 /if n $CurFletchSkill>=130 /call BoneVanes
/if n $CurFletchSkill<195 /if n $CurFletchSkill>=160 /call CeramicVanes
/if n $CurFletchSkill>=195 {
   /echo Your skill cannot be increased more than 195 with this script If you wish to raise skill higher you can change the script to do so.
   /cleanup
   /endmacro
   }
/goto :SkillCheck

Sub MedGroveNock
      /call BuyItemSingle "Field Point Arrowheads" 0
      /call BuyItemSingle "Bundled Wooden Arrow Shafts" 1
      /call BuyItemSingle "Several Round Cut Fletchings" 2
      /call BuyItemSingle "Medium Groove Nocks" 3
      /call MakeArrows
      /call SellItem class
      /return

Sub BoneShaft
      /call BuyItemSingle "Field Point Arrowheads" 0
      /call BuyItemSingle "Bundled Bone Arrow Shafts" 1
      /call BuyItemSingle "Several Round Cut Fletchings" 2
      /call BuyItemSingle "Large Groove Nocks" 3
      /call MakeArrows
      /call SellItem class
      /return

Sub HookedArrowHead
      /call BuyItemSingle "Hooked Arrowheads" 0
      /call BuyItemSingle "Bundled Wooden Arrow Shafts" 1
      /call BuyItemSingle "Several Round Cut Fletchings" 2
      /call BuyItemSingle "Large Groove Nocks" 3
      /call MakeArrows
      /call SellItem class
      /return

Sub CeramicShaft
      /call BuyItemSingle "Field Point Arrowheads" 0
      /call BuyItemSingle "Bundled Ceramic Arrow Shafts" 1
      /call BuyItemSingle "Several Round Cut Fletchings" 2
      /call BuyItemSingle "Large Groove Nocks" 3
      /call MakeArrows
      /call SellItem class
      /return

Sub BoneVanes
      /call BuyItemSingle "Field Point Arrowheads" 0
      /call BuyItemSingle "Bundled Wooden Arrow Shafts" 1
      /call BuyItemSingle "Set of Bone Arrow Vanes" 2
      /call BuyItemSingle "Large Groove Nocks" 3
      /call MakeArrows
      /call SellItem class
      /return

Sub CeramicVanes
      /call BuyItemSingle "Field Point Arrowheads" 0
      /call BuyItemSingle "Bundled Wooden Arrow Shafts" 1
      /call BuyItemSingle "Set of Ceramic Arrow Vanes" 2
      /call BuyItemSingle "Large Groove Nocks" 3
      /call MakeArrows
      /call SellItem class
      /return

Sub BuyitemSingle
      /delay 1
      /if "$item($CombinerID,$p1,name)"=="$p0" /return
      /selectitem "$p0"
      /delay 1
      /sendkey up shift
      /buyitem 1
    :WaitBuy
      /delay 1
      /if "$item($CombinerID,$p1,name)"!="$p0" /goto :WaitBuy
/return

Sub MakeArrows
      /if $pack($CombinerID,closed)==TRUE {
        /echo You *MUST* have your fletching kit open..
        /endmacro
        }

      /varset LastFail 0
      /varset LastSuc 0
      /click left pack $CombinerID combine

      :WaitForCombine
         /delay 1
         /if $pack($CombinerID,empty)==FALSE /goto :WaitForCombine

      /for v75 1 to 10
         /delay 1
         /doevents
         /if n $LastFail==1 /return
         /if $cursor()==TRUE /goto :PutAwayArrows
      /next v75

      :PutAwayArrows
         /click left auto
      :WaitDrop
         /delay 1
         /if $cursor()==TRUE /goto :WaitDrop
      /return



Sub SellItem
   /doevents
   /if n $LastFail==1 /return
   /finditem similar "Arrow"
   /for v75 1 to 10
      /delay 1
      /doevents
      /if n $LastFail==1 /return
      /if n $LastSuc==1 /goto :DoSellItem
   /next v75

   /if $getlasterror==FIND_NOTFOUND /return
 :DoSellItem
   /sendkey down shift
   /delay 1
  | This check is to make sure the arrows actually landed in the inventory and not 
   | in the range supply (ammo) slot. 
   /if "$item($CombinerID,0,name)"~~"Arrow" /click left merchant buy 
   | 
   | 

 :WaitForSale
   /if "$item($CombinerID,0,name)"~~"Arrow" {
       /delay 1
       |/echo $item($CombinerID,0,name)
       /goto :WaitForSale
       }
   /sendkey up shift
/return

Sub Event_ErrorCombine
   /endmacro
/return

Sub Event_FailedCombine
   /varset LastFail 1
   |/echo Detected Fail
/return

Sub Event_SuccessCombine
   /varset LastSuc 1
   |/echo Detected Combine
/return
-Zx
Last edited by Zxeses on Tue Jul 29, 2003 6:53 pm, edited 1 time in total.

Zxeses
a ghoul
a ghoul
Posts: 103
Joined: Tue Jan 07, 2003 4:17 pm

Notes:

Post by Zxeses » Tue Jul 29, 2003 6:52 pm

Changed:

Code: Select all

   /click left merchant buy
to

Code: Select all

   | This check is to make sure the arrows actually landed in the inventory and not
   | in the range supply (ammo) slot.
   /if "$item($CombinerID,0,name)"~~"Arrow" /click left merchant buy
   |
   |
This is in Section "SellItem"

Also note: If you move your Merchant, Inventory or Fletching windows around on your screen, you will either need to:

-camp, re-enter
or
-/loadskin default 1

since I use a custom UI, I use /loadskin myskin 1

-Zx

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Shouldn't need to camp ...

Post by MacroFiend » Tue Jul 29, 2003 7:07 pm

as long as you exit out of all moved windows and re-open them. I'm guessing that MQ updates the window positions when they are written to the UI_charname_servnum.INI file which happens when you close the moved window. Running a /cleanup would let MQ update it's window positions as long as you re-opened any windows you needed.

macrotoon
a ghoul
a ghoul
Posts: 106
Joined: Wed Sep 18, 2002 4:38 pm

Post by macrotoon » Tue Jul 29, 2003 7:24 pm

I loved this macro back in the day. Now that verant screwed the bow making combine so i loose plat per attempt i guess i'll leave my fletcher at 235, but then again. I closed that account a month ago. I might have to get my main account a fletcher on it soon.

Nice work on the update. I like it, and will try it out soon.

di28889
a hill giant
a hill giant
Posts: 296
Joined: Sat Jul 12, 2003 11:36 pm

Post by di28889 » Wed Jul 30, 2003 11:36 pm

It works just fine, I noticed that you need to have the fletching kit open also! :)

User avatar
Clone39
a ghoul
a ghoul
Posts: 91
Joined: Mon Jul 07, 2003 7:26 pm
Location: Montreal, Canada

Post by Clone39 » Fri Aug 01, 2003 10:42 am

that macro is just awesome.. very good work!!


Clone39

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Fri Aug 01, 2003 9:45 pm

couple changes for those with all 3 merchant commands...

(in Sub Sellitem)

Code: Select all

[b]|   /sendkey down shift [/b]
   /delay 1 
  | This check is to make sure the arrows actually landed in the inventory and not 
   | in the range supply (ammo) slot. 
   /if "$item($CombinerID,0,name)"~~"Arrow" [b]/sellitem $item($CombinerID,0,stack) [/b]
oh, and if you have the full selectitem (e.g. the one that will also select items in your own inventory.. but random CTD)

(in Sub BuyitemSingle)

Code: Select all

      /selectitem "$p0" [b]merchant[/b]
other than that, wonderful macro, love it, it saved me the trouble of re-re-editing mine to work with the new stuff.

Zxeses
a ghoul
a ghoul
Posts: 103
Joined: Tue Jan 07, 2003 4:17 pm

Post by Zxeses » Mon Aug 04, 2003 11:21 am

Great idea on the Sell change, I cant wait to try it out.

Regarding your other proposed change, you have the word Merchant out after /selectitem "$p0", could you explain this?

Does this make it only select the item on the merchant in the off chance you may have that item in your inventory somewhere?

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Mon Aug 04, 2003 9:30 pm

format of the full /selectitem command is (will be)

/selectitem [similar] <slot N|"name"|list> <self|merchant>

e.g.
/selectitem similar "milk" merchant
/selectitem list merchant
/selectitem "Fish Rolls" self
/selectitem slot 5 merchant

MegaHertz
a lesser mummy
a lesser mummy
Posts: 35
Joined: Mon Dec 16, 2002 5:13 pm

Post by MegaHertz » Sun Aug 10, 2003 3:43 pm

nm figured it out.
Last edited by MegaHertz on Mon Aug 11, 2003 11:49 am, edited 1 time in total.

macrotoon
a ghoul
a ghoul
Posts: 106
Joined: Wed Sep 18, 2002 4:38 pm

Post by macrotoon » Sun Aug 10, 2003 3:51 pm

Got my chanter from 160 to 195 in a couple hours using this. Great work!

MegaHertz
a lesser mummy
a lesser mummy
Posts: 35
Joined: Mon Dec 16, 2002 5:13 pm

Post by MegaHertz » Sun Aug 10, 2003 4:25 pm

Nm again found the info I needed.. (search is great if you know what you are searching for)
Last edited by MegaHertz on Mon Aug 11, 2003 11:49 am, edited 2 times in total.

MegaHertz
a lesser mummy
a lesser mummy
Posts: 35
Joined: Mon Dec 16, 2002 5:13 pm

Post by MegaHertz » Sun Aug 10, 2003 7:56 pm

ok here is a question. I had the macro working but now it wont I run xp. now it buys 2 arrow points and stops. any ideas?

also how do I get container id? looks like the macro is hard coded with 99 which if for a normal fletching kit I would assume.

it seems to be a issue with buyitemsingle is ther another way to buy items?

for some reason does not look like selectitem is workin with item name for me.

ok figurd it out had to add merchant at the end of /selectitem

Code: Select all

/selectitem "$p0" [b]Merchant[/b]
seems the problem is deeper then that select item does not work for me in shadowhaven.
Last edited by MegaHertz on Mon Aug 11, 2003 11:51 am, edited 2 times in total.

macrotoon
a ghoul
a ghoul
Posts: 106
Joined: Wed Sep 18, 2002 4:38 pm

Post by macrotoon » Mon Aug 11, 2003 4:00 am

Shadowhaven vendors worked fine for me, both of them did actually.

Make sure you have the vendor and your fletching kit open before you start. And you cant move the windows after you start either. You will have to /load default 1 or camp and come back.

If your using EQW you have to have the mouse locked in the window.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Mon Aug 11, 2003 5:44 am

MegaHertz wrote: ok figurd it out had to add merchant at the end of /selectitem

Code: Select all

/selectitem "$p0" [b]Merchant[/b]
seems the problem is deeper then that select item does not work for me n shadowhaven campin and reloggin to see if that fixes it. anyone know of any bugs with it?
bugs... well /selectitem is not 100% but you shouldnt see anything from the end user perspective... as a developer, I mess with alot of things pertaining to slot selection and stuff, and I know how to crash eq, using /selectitem, maybe someone will clean up that code for me, at least thats what I hope...

BUT to answer you question.

Code: Select all

/selectitem "Iron Ration" merchant
will work. If it does not, you have an offset or source problem... or both. (or the merchant doesnt sell Iron Rations...)
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.