PowerArrows, an attempt

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

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

PowerArrows, an attempt

Post by Elric » Sat Jun 19, 2004 8:21 am

I'm so damned tired.. it's so late, and I stayed up all night. Not sure what I have done, not sure what I don't. Someone mind helping me out in converting the rest of this?

Code: Select all

#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 
:SkillCheck 
/varset CurFletchSkill ${Me.Skill[Fletching]} 
/if (${Me.Skill[Fletching]}<16) /call ClassOneWoodPoint
/if (${Me.Skill[Fletching]}<36 && ${Me.Skill[Fletching]}>=16) /call MedGrooveNock 
/if (${Me.Skill[Fletching]}<46 && ${Me.Skill[Fletching]}>=36) /call ParabolicFletch 
/if (${Me.Skill[Fletching]}<56 && ${Me.Skill[Fletching]}>=46) /call SmallGrooveNock 
/if (${Me.Skill[Fletching]}<68 && ${Me.Skill[Fletching]}>=56) /call BoneShaft 
/if (${Me.Skill[Fletching]}<82 && ${Me.Skill[Fletching]}>=68) /call ShieldFletch 
/if (${Me.Skill[Fletching]}<102 && ${Me.Skill[Fletching]}>=82) /call HookedArrowHead 
/if (${Me.Skill[Fletching]}<122 && ${Me.Skill[Fletching]}>=102) /call WoodVane 
/if (${Me.Skill[Fletching]}<135 && ${Me.Skill[Fletching]}>=122) /call CeramicShaft 
/if (${Me.Skill[Fletching]}<162 && ${Me.Skill[Fletching]}>=135) /call BoneVanes 
/if (${Me.Skill[Fletching]}<182 && ${Me.Skill[Fletching]}>=162) /call SilverArrowHead 
/if (${Me.Skill[Fletching]}<202 && ${Me.Skill[Fletching]}>=182) /call CeramicVanes 
/if (${Me.Skill[Fletching]}>=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 (${InvSlot[pack${Math.Calc[1+${CombinerID}]}].Item.Item[${Param2}].Name.Equal[${Param0}]}) /return
      /itemnotify ${Param0} merchant 
      /delay 1 
      /ctrlkey /notify MerchantWnd MW_Buy_Button leftmouseup 
    :WaitBuy 
      /delay 1 
      /if (${InvSlot[pack${Math.Calc[1+${CombinerID}]}].Item.Item[${Param2}].Name.NotEqual[${Param0}]}) /goto :WaitBuy 
/return 

Sub MakeArrows 
    /varset LastFail 0 
     /varset LastSuc 0 
     /combine pack${8}

      :WaitForCombine 
         /delay 1 
         /if (!${Item[pack${CombinerID}].Items})  /goto :WaitForCombine 

      /declare count local 
      /for count 1 to 10 
         /delay 1 
         /doevents 
         /if (${LastFail}==1) /return 
         /if (${Cursor.ID}) /goto :PutAwayArrows 
      /next count 

      :PutAwayArrows 
	/notify InventoryWindow IW_CharacterView leftmouseup
	/delay 4
	/notify InventoryWindow IW_CharacterView leftmouseup
	/delay 2
      :WaitDrop 
         /delay 2 
         /if (${Cursor.ID}) /goto :WaitDrop 
      /return 



Sub SellItem 
   /doevents 
   /if (${LastFail}==1) /return 
   /${FindItem[Arrow]}
   /declare count local 
   /for count 1 to 10 
      /delay 1 
      /doevents 
      /if (${LastFail}==1) /return 
      /if (${LastSuc}==1) /goto :DoSellItem 
   /next count 

 |  /if $getlasterror==FIND_NOTFOUND /return 
:DoSellItem 
   /shift /notify MerchantWnd MW_Sell_Button leftmouseup
   /delay 20 

:WaitForSale 
   | Until the arrows disappear from inventory, we loop... 
/if (${Item[pack${CombinerID}].Item.Item[0].Name.Find[Arrow]}) { 
       /delay 20 
       /goto :WaitForSale 
       } 
  /shift /notify MerchantWnd MW_Sell_Button leftmouseup 
/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
-Elric

gumper
orc pawn
orc pawn
Posts: 16
Joined: Thu Jul 10, 2003 6:35 pm

Post by gumper » Mon Jul 12, 2004 10:40 pm

has anyone got this working? Would love to skill up my warrior!

thanks

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Mon Jul 12, 2004 11:24 pm

Code needs to be edited and corrected for the BBCode change that made all the old codes with < and > signs turn into the HTML equivilents < and > respectively.

If you have copied this reciently, you will need to go through and make the changes yourself. This can be done via notepad using CTRL H and using the replace feature.

gumper
orc pawn
orc pawn
Posts: 16
Joined: Thu Jul 10, 2003 6:35 pm

Post by gumper » Tue Jul 13, 2004 8:24 am

I have done this now, but when I run this macro (in this post) all that happens is the macro name appears in red in my MQ2 dialog box. If I run the one from the other post (and replace all the < & > with LT GT) I get these error messages...

Code: Select all

Varset Failed, variable v88not found
SK1.mac @28 (Main): /V88 99

Failed to parse /if command. Expected () around conditions.
SK1.mac @29 (main): /if "$pack(0,combine)"=="fletching" /varset v88 0

Usage: /if (<conditions>) <commands>
any help would be greatly appreciated

gumper

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Tue Jul 13, 2004 8:52 am

Why are you reversing that stuff to show as HTML?

Of course you'll get errors of you purposely change < and > to html, which is exactly what you did.

If the above code doesn't work, I can't help you. I'm still learning myself. But I do know enough to look for simple things that need to be fixed, like the fix I noted above.