Updated PowerArrows2

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Updated PowerArrows2

Post by Mckorr » Wed Jan 28, 2004 11:49 am

I've updated this with the correct trivials. This will carry you to 202 in fletching. Total cost to go from 0 to 202 is approximately 2500 pp, less with good CHA.

Code: Select all

|
|  PowerArrows.mac
|  Original by macrotoon
|  Updated & Updated again by Zxeses
|  And updated again by CircuitFlux
|
| 1. Put your fletching kit in your FIRST inventory slot
| 2. Click open the merchant you wish to use
|
|   Do not move any windows around after you zone in
|
|   DO NOT AFK MACRO
|

#turbo

#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

/declare CurFletchSkill global
/declare LastFail global
/declare LastSuc global
/declare CombinerID global

/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<36 /call MedGroveNock
/if n @CurFletchSkill<68 /if n @CurFletchSkill>=36 /call BoneShaft
/if n @CurFletchSkill<102 /if n @CurFletchSkill>=68 /call HookedArrowHead
/if n @CurFletchSkill<135 /if n @CurFletchSkill>=102 /call CeramicShaft
/if n @CurFletchSkill<162 /if n @CurFletchSkill>=135 /call BoneVanes
/if n @CurFletchSkill<202 /if n @CurFletchSkill>=162 /call CeramicVanes
/if n @CurFletchSkill>=202 {
   /echo Your skill cannot be increased more than 202 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,@Param1,name)"=="@Param0" /return
      /selectitem "@Param0" merchant
      /delay 1
      /sendkey up shift
      /buyitem 1
    :WaitBuy
      /delay 1
      /if "$item(@CombinerID,@Param1,name)"!="@Param0" /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

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

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



Sub SellItem
   /doevents
   /if n @LastFail==1 /return
   /finditem similar "Arrow"
   /declare count local
   /for count 1 to 10
      /delay 1
      /doevents
      /if n @LastFail==1 /return
      /if n @LastSuc==1 /goto :DoSellItem
   /next count

   /if $getlasterror==FIND_NOTFOUND /return
:DoSellItem
   /sendkey down shift
   /delay 20
   | 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
   | Until the arrows disappear from inventory, we loop...
   /if "$item(@CombinerID,0,name)"~~"Arrow" {
       /delay 20
       |/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
Last edited by Mckorr on Wed Jan 28, 2004 12:38 pm, edited 2 times in total.

User avatar
Elric
Cheese Whore
Cheese Whore
Posts: 466
Joined: Sun Nov 23, 2003 12:31 am
Location: Tampa, Fl
Contact:

Post by Elric » Wed Jan 28, 2004 11:51 am

Gah. Disable dem smilies, mang.
-Elric

Onezero
a ghoul
a ghoul
Posts: 95
Joined: Thu Jan 01, 2004 1:19 pm
Location: Normal, IL
Contact:

Post by Onezero » Wed Jan 28, 2004 12:10 pm

Not causing the macro to die, but giving an error message every time, so remove the red hightlighted line.

Code: Select all

:SkillCheck 
| /skill Fletch 
/varset CurFletchSkill $char(skill,"fletching") 
/if n @CurFletchSkill<36 /call MedGroveNock 
/if n @CurFletchSkill<68 /if n @CurFletchSkill>=36 /call BoneShaft 
/if n @CurFletchSkill<102 /if n @CurFletchSkill>=68 /call HookedArrowHead 
/if n @CurFletchSkill<135 /if n @CurFletchSkill>=102 /call CeramicShaft 
/if n @CurFletchSkill<162 /if n @CurFletchSkill>=135 /call BoneVanes 
/if n @CurFletchSkill<202 /if n @CurFletchSkill>=162 /call CeramicVanes 
[color=red]/if n @CurFletchSkill<202[/color] 
/if n @CurFletchSkill>=202 { 
   /echo Your skill cannot be increased more than 202 with this script If you wish to raise skill higher you can change the script to do so. 
   /cleanup 
   /endmacro 
   }
.[b].[/b]:[b]:[/b] Onezero
"[i]Health is merely the slowest rate at which you can die.[/i]"

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Wed Jan 28, 2004 12:37 pm

Yeah, forgot about that. I removed that line on my game machine, but not on my dev machine. Will edit the post.

And I already went back and disabled smilies on it.

Onezero
a ghoul
a ghoul
Posts: 95
Joined: Thu Jan 01, 2004 1:19 pm
Location: Normal, IL
Contact:

Post by Onezero » Wed Jan 28, 2004 12:38 pm

And by the way, thanks for updating this mac :) It rules
.[b].[/b]:[b]:[/b] Onezero
"[i]Health is merely the slowest rate at which you can die.[/i]"

TheWarden
a hill giant
a hill giant
Posts: 253
Joined: Sat Dec 27, 2003 3:51 pm
Location: In your bushes...

Post by TheWarden » Wed Jan 28, 2004 4:07 pm

Yeah, I LOVE this macro, you're the greatest!

seph_yaro
a lesser mummy
a lesser mummy
Posts: 72
Joined: Sat Jul 26, 2003 1:12 pm

Post by seph_yaro » Thu Jan 29, 2004 6:38 am

Mckorr, I love you.
This is my fave tradeskill script, as I like to do fletching on all of my melee char's as it yields arrows with better range that most store bought.

Besides which, I just like fletching.

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Thu Jan 29, 2004 9:10 am

heh, all I did was fix the trivials... after I'd already run it for a while and realized something was wrong. I'm still not convinced this is the most cost efficient way to do this, but it works :)

DyvimTvar
orc pawn
orc pawn
Posts: 16
Joined: Wed Oct 22, 2003 1:21 pm

Getting Error

Post by DyvimTvar » Thu Jan 29, 2004 10:31 am

I am getting the following error when I run the macro, perhaps someone can tell me in what way I am being a moron. ;)

The merchant, Jaren Cloudchaser in PoK in this instance, is telling me he will offer me nothing for my Vorshars Circlet of the Blight, a fact I'm thankful of, and the script halts.

The only MQ message is:

"Field Point Arrowheads' Found in slot '-5997'

Then the scrip hangs. I assume I am getting caught in this portion:

Code: Select all

Sub BuyitemSingle 
      /delay 1 
      /if "$item(@CombinerID,@Param1,name)"=="@Param0" /return 
      /selectitem "@Param0" merchant 
      /delay 1 
      /sendkey up shift 
      /buyitem 1 
    :WaitBuy 
      /delay 1 
      /if "$item(@CombinerID,@Param1,name)"!="@Param0" /goto :WaitBuy 
/return 
But I am not clever enough to figgure the problem. Suggestions anyone?
DyvimTvar

Ustke Pathwalker
decaying skeleton
decaying skeleton
Posts: 1
Joined: Thu Jan 29, 2004 11:03 am

Just a thought.

Post by Ustke Pathwalker » Thu Jan 29, 2004 11:12 am

VERY well written code. I hope someday my code can be this clean :shock:

((Hey, had to do SOMETHING for my first post))
Last edited by Ustke Pathwalker on Thu Jan 29, 2004 12:49 pm, edited 1 time in total.

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Thu Jan 29, 2004 12:24 pm

Make sure your fletching kit is in the first slot. Make sure it does not overlap anything when it is open, including the merchant window or your inventory window. This macro keeps all three of those windows (merchant, fletching, and inventory) open while it runs. Make sure your fletching kit is completely empty when you start.

TheWarden
a hill giant
a hill giant
Posts: 253
Joined: Sat Dec 27, 2003 3:51 pm
Location: In your bushes...

Post by TheWarden » Thu Jan 29, 2004 1:34 pm

This is a little cheaper, but not by too much:

Code: Select all

| 
|  PowerArrows.mac 
|  Original by macrotoon 
|  Updated & Updated again by Zxeses 
|  And updated again by CircuitFlux
|  And again by Mckorr
|  And again by TheWarden
| 
| 1. Put your fletching kit in your FIRST inventory slot 
| 2. Click open the merchant you wish to use 
| 
|   Do not move any windows around after you zone in 
| 
|   DO NOT AFK MACRO 
| 

#turbo 

#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 

/declare CurFletchSkill global 
/declare LastFail global 
/declare LastSuc global 
/declare CombinerID global 

/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<16 /call ClassOneWoodPoint
/if n @CurFletchSkill<36 /if n @CurFletchSkill>=16 /call MedGrooveNock 
/if n @CurFletchSkill<46 /if n @CurFletchSkill>=36 /call ParabolicFletch
/if n @CurFletchSkill<56 /if n @CurFletchSkill>=46 /call SmallGrooveNock
/if n @CurFletchSkill<68 /if n @CurFletchSkill>=56 /call BoneShaft 
/if n @CurFletchSkill<82 /if n @CurFletchSkill>=68 /call ShieldFletch
/if n @CurFletchSkill<102 /if n @CurFletchSkill>=82 /call HookedArrowHead 
/if n @CurFletchSkill<122 /if n @CurFletchSkill>=102 /call WoodVane
/if n @CurFletchSkill<135 /if n @CurFletchSkill>=122 /call CeramicShaft 
/if n @CurFletchSkill<162 /if n @CurFletchSkill>=135 /call BoneVanes 
/if n @CurFletchSkill<182 /if n @CurFletchSkill>=162 /call SilverArrowHead
/if n @CurFletchSkill<202 /if n @CurFletchSkill>=182 /call CeramicVanes
/if n @CurFletchSkill>=202 { 
   /echo Your skill cannot be increased more than 202 with this script. If you wish to raise skill higher you can change the script to do so. 
   /cleanup 
   /endmacro 
   } 
/goto :SkillCheck 

Sub ClassOneWoodPoint
      /call BuyItemSingle "Field Point 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 MedGrooveNock 
      /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 ParabolicFletch 
      /call BuyItemSingle "Field Point Arrowheads" 0 
      /call BuyItemSingle "Bundled Wooden Arrow Shafts" 1 
      /call BuyItemSingle "Several Parabolic Cut Fletchings" 2 
      /call BuyItemSingle "Large Groove Nocks" 3 
      /call MakeArrows 
      /call SellItem class 
      /return 

Sub SmallGrooveNock 
      /call BuyItemSingle "Field Point Arrowheads" 0 
      /call BuyItemSingle "Bundled Wooden Arrow Shafts" 1 
      /call BuyItemSingle "Several Round Cut Fletchings" 2 
      /call BuyItemSingle "Small 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 ShieldFletch 
      /call BuyItemSingle "Field Point Arrowheads" 0 
      /call BuyItemSingle "Bundled Wooden Arrow Shafts" 1 
      /call BuyItemSingle "Several Shield 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 WoodVane
      /call BuyItemSingle "Field Point Arrowheads" 0 
      /call BuyItemSingle "Bundled Wooden Arrow Shafts" 1 
      /call BuyItemSingle "Set of Wooden Arrow Vanes" 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 SilverArrowHead
      /call BuyItemSingle "Silver Tipped 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 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,@Param1,name)"=="@Param0" /return 
      /selectitem "@Param0" merchant 
      /delay 1 
      /sendkey up shift 
      /buyitem 1 
    :WaitBuy 
      /delay 1 
      /if "$item(@CombinerID,@Param1,name)"!="@Param0" /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 

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

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



Sub SellItem 
   /doevents 
   /if n @LastFail==1 /return 
   /finditem similar "Arrow" 
   /declare count local 
   /for count 1 to 10 
      /delay 1 
      /doevents 
      /if n @LastFail==1 /return 
      /if n @LastSuc==1 /goto :DoSellItem 
   /next count 

   /if $getlasterror==FIND_NOTFOUND /return 
:DoSellItem 
   /sendkey down shift 
   /delay 20 
   | 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 
   | Until the arrows disappear from inventory, we loop... 
   /if "$item(@CombinerID,0,name)"~~"Arrow" { 
       /delay 20 
       |/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

DyvimTvar
orc pawn
orc pawn
Posts: 16
Joined: Wed Oct 22, 2003 1:21 pm

Problems still

Post by DyvimTvar » Fri Jan 30, 2004 9:54 am

Mckorr wrote:Make sure your fletching kit is in the first slot. Make sure it does not overlap anything when it is open, including the merchant window or your inventory window. This macro keeps all three of those windows (merchant, fletching, and inventory) open while it runs. Make sure your fletching kit is completely empty when you start.
Well I did all that to start with and I am ready to call myself a complete moron. I have made and run several scripts, but I can't get this one to work. I'd really appreciate it if someone could tell me the name and general location of a vendor they have gotten this to work with, just to give me one more thing to test.

It's not the end of the world if I can't get it to work, it just bothers me at this point.
DyvimTvar

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Fri Jan 30, 2004 10:05 am

I used the same guy you did in PoK.

You could try switching to the Default UI, at least for EQUI_Containers.XML. Could be a click problem.

DyvimTvar
orc pawn
orc pawn
Posts: 16
Joined: Wed Oct 22, 2003 1:21 pm

crappola

Post by DyvimTvar » Fri Jan 30, 2004 12:33 pm

Well, that sucks. I always switch to default UI when I macro tradeskills, so no luck there.

I have a general yen to gm all my tradeskills eventually, and I was hoping this would let me grab fletching easily. Oh well, I guess not.

If anyone thinks of anything else that could be causing my problems, feel free to chime in. I appreciate the macro anyway Mckorr, I always learn a bit from your efforts at least.
DyvimTvar