Powerarrows.mac The original. Use powerarrows2

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

Moderator: MacroQuest Developers

User avatar
BlueSkies
a ghoul
a ghoul
Posts: 132
Joined: Tue Oct 01, 2002 6:22 pm

Post by BlueSkies » Thu Jul 10, 2003 10:39 pm

Not to mention the fact that click doesn't work anywhere NEAR as well as it used to.

Once all is said and done, and things like this are possible again, it's very likely that it'll be done in a very different way.
Live your dreams! Blue Skies everyone

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

Updated PowerArrows.mac

Post by MacroFiend » Mon Jul 28, 2003 11:37 pm

I took the original PowerArrows.mac and fixed it to work with the most current version of MQ (taking in to account the current features and bugs). Any arrow merchant will work, just make sure that the fletching kit is in slot 1 (as the original version required) and that the merchant window is open prior to starting the script. It uses the new /selecthitem and /buyitem commands for the heavy lifting of the old macro and doesn't use the routines.mac (which was causing my crash to desktop).

PowerArrows.mac

Code: Select all

|  POWERARROWS.MAC 
|  Original by macrotoon
| 
| 
| 
#turbo

Sub Main 

      /call FindCombiner Fletching 
      /if $return==99 /return 
      /varset v80 $return 

| Make sure the merchant window is open before calling the macro.
|      /target arrowsmith 
|      /face 
|
|   :WaitMerchant 
|      /press u 
|      /if $merchant()==FALSE /goto :WaitMerchant 

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

Sub MedGroveNock 
      /for v2 1 to 20 
      /selectitem "Field Point Arrowheads"
      /call BuyItemSingle 

      /selectitem "Bundled Wooden Arrow Shafts"
      /call BuyItemSingle 

      /selectitem "Several Round Cut Fletchings"
      /call BuyItemSingle 
      
      /selectitem "Medium Groove Nocks"
      /call BuyItemSingle 

      /call MakeArrows 
      /call SellItem class 
      /next v2 
      /return 

Sub BoneShaft 
      /for v2 1 to 20 
      /selectitem "Field Point Arrowheads"
      /call BuyItemSingle 

      /selectitem "Bundled Bone Arrow Shafts"
      /call BuyItemSingle 

      /selectitem "Several Round Cut Fletchings"
      /call BuyItemSingle 
      
      /selectitem "Large Groove Nocks"
      /call BuyItemSingle 

      /call MakeArrows 
      /call SellItem class 
      /next v2 
      /return 

Sub HookedArrowHead 
      /for v2 1 to 20 
      /selectitem "Hooked Arrowheads"
      /call BuyItemSingle 

      /selectitem "Bundled Wooden Arrow Shafts"
      /call BuyItemSingle 

      /selectitem "Several Round Cut Fletchings"
      /call BuyItemSingle 

      /selectitem "Large Groove Nocks"
      /call BuyItemSingle 

      /call MakeArrows 
      /call SellItem class 
      /next v2 
      /return 

Sub CeramicShaft 
      /for v2 1 to 20 
      /selectitem "Field Point Arrowheads"
      /call BuyItemSingle 

      /selectitem "Bundled Ceramic Arrow Shafts"
      /call BuyItemSingle 

      /selectitem "Several Round Cut Fletchings"
      /call BuyItemSingle 

      /selectitem "Large Groove Nocks"
      /call BuyItemSingle 

      /call MakeArrows 
      /call SellItem class 
      /next v2 
      /return 

Sub BoneVanes 
      /for v2 1 to 20 
      /selectitem "Field Point Arrowheads"
      /call BuyItemSingle 

      /selectitem "Bundled Wooden Arrow Shafts"
      /call BuyItemSingle 

      /selectitem "Set of Bone Arrow Vanes"
      /call BuyItemSingle 

      /selectitem "Large Groove Nocks"
      /call BuyItemSingle 

      /call MakeArrows 
      /call SellItem class 
      /next v2 
      /return 

Sub CeramicVanes 
      /for v2 1 to 20 
      /if n $v1>=199 /return 
      /selectitem "Field Point Arrowheads"
      /call BuyItemSingle 

      /selectitem "Bundled Wooden Arrow Shafts"
      /call BuyItemSingle 

      /selectitem "Set of Ceramic Arrow Vanes"
      /call BuyItemSingle 

      /selectitem "Large Groove Nocks"
      /call BuyItemSingle 

      /call MakeArrows 
      /call SellItem class 
      /next v2 
      /return 

Sub MakeArrows 
      /if $pack($v80,closed)==TRUE /click right inv $v80 
      :MakeArrows 
         /click left auto 
         /delay 3
         /click left pack $v80 combine 
      :WaitArrows 
         /delay 0
         /if $pack($v80,empty)==FALSE /goto :WaitArrows 
      /delay 3 
      :waitdrop 
         /delay 0
         /click left auto 
      /if $cursor()==TRUE /goto :waitdrop 
      /return 

Sub BuyitemSingle 
   :BuyItem
      /varset v99 $char(cash) 
      /delay 2 
      /buyitem 1
      /delay 3

   | If we have the same amount of money, we didn't buy it so try again.
   /if n $v99==$char(cash) /goto :BuyItem 
/return 

Sub FindCombiner 
   /varset p2 99 
   /for v99 0 to 7 
      /if "$pack($v99,combine)"=="$p0" /varset p2 $v99 
   /next v99 
/return $p2 

Sub SellItem 
   /sendkey down shift 
   :SellItem 
      /varset v99 $char(cash) 

      /finditem similar "arrow" 
      /if $find()==FALSE /goto :DoneSellItem 
      /delay 5 

      /click left merchant buy 
      /delay 5 
      
   /goto :SellItem 
   :DoneSellItem 
   /sendkey up shift 
/return
Last edited by MacroFiend on Tue Jul 29, 2003 9:28 am, edited 1 time in total.

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

Post by Valerian » Tue Jul 29, 2003 8:57 am

Good job! I haven't re-modded mine to work since modding it for the BASIC /mouseto loc and /click functionality. Glad to see someone taking the initiative to actually do this... great macro, this. It could be expanded slightly to work bows to 250, but that would require some user intervention at 202 skill.... (changing merchants)

oh... and the part that checks your money would be SO much cleaner if modded to use $char(cash) instead of the separate coinage.

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

$char(cash) is a new one ...

Post by MacroFiend » Tue Jul 29, 2003 9:19 am

for me anyway. Just started really playing with MQ a week or so ago and took the old code and updated it. If $char(cash) returns a double of currency on hand, then I agree and that's an easy fix. That block of code is there to ensure you actually bought/sold something when you told it to. I'll update it to use that instead.

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

Post by Valerian » Tue Jul 29, 2003 6:10 pm

yes, $char(cash) returns a single value indicating all cash on hand... 1pp 5gp 4sp 3cp would return "1543"

Rahn
orc pawn
orc pawn
Posts: 12
Joined: Tue Mar 18, 2003 7:22 pm

could't parse

Post by Rahn » Mon Aug 04, 2003 4:27 am

all i get when i run this mac is
Couldn't parse '/selectitem "Field Point Arrowheads"'
Counld't parse '/buyitem 1'
repeats last line till i stop the macro
any ideas ?
(vendor window is open)

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

Post by EqMule » Mon Aug 04, 2003 5:28 am

can you manually run thoose commands? try opening a merchant that has water flask to sell, then type /selectitem "Water Flask" does it select it? I havent checked cvs, but there is 2 versions of /selectitem, and one (the latest) will need /selectitem "Water Flask" merchant

if this doesnt work, you have a version of MQ that lacks the commands...
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.

Dantuss
decaying skeleton
decaying skeleton
Posts: 9
Joined: Sun Aug 03, 2003 3:21 pm

Post by Dantuss » Mon Aug 11, 2003 7:26 pm

NT