Page 1 of 2

Blacksmithing Macro from 1 to 115 (Version 2.2) 8/3/04

Posted: Tue Aug 03, 2004 8:18 pm
by Override
Well, I have decided to start releasing some of my Tradeskills Macros. I have them for pretty much for all tradeskills, but I want to work out a few bugs on some before I release a few. Here is a Link that has all the updated macros:

http://www.soc-music.com/mq2/

Below is the Smithing one I have made. This is to be used in the Abysmal Sea and you can go from 1 to 115. You will have to be sure not to have SOE or levi on cause you will get stuck on doors. Plus BE SURE to place the .inc files into the common directory in your macros directory (if there isn't one.....create it).

smithing.mac

Code: Select all

 | 
| smithing.mac
| Takes you from 1 to 115 in smithing
| Version 2.2
| Date: August 3, 2004
|
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/index.htm
|
| Before are the settings you need to change for you.
| This Macro can take you up to 115 in Blacksmithing. 
| SkillMaxWanted can be change to what skill you want to stop at.
| MerchantNameA is which merchant has the sheet metals.
| MerchantNameB is which merchant has the molds.
| MerchantNamec is which merchant has the water.
|
| This Macro works best in the Abysmal Sea since all the components are there.
| You WILL need to be behind Snokin Breaksteel for this macro to work.
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
| This macro may not work any other place then the Abysmal Sea.
| 


#event CombineError "#*#There was no place to put that#*#" 
#event CombineError "#*#You cannot combine these items in this container type!#*#" 
#event CombineError "#*#did not accept these items#*#" 
#event ContUsed "#*#Someone else is using that. Try again later.#*#"
#include common/sell.inc
#include common/buy.inc
#include common/packs.inc

Sub Main
    /declare OldSkill int outer
    /declare SkillMaxWanted int outer
    /declare PackCode string outer 
    /declare Component[10] string outer 
    /declare i int outer
    /declare MerchantNameA string Outer
    /declare MerchantNameB string Outer
    /declare MerchantNameC string Outer
    /declare CompA item outer
    /declare CompB item outer
    /declare CompC item outer
    /declare CombItemName string outer
    /declare ItemTo string outer
    /declare EndingVar int outer
    /declare Levelname int outer
    /varset OldSkill ${Me.Skill[Blacksmithing]}

| ************************************************
| *   Change these settings to what you want.    *
| ************************************************

    /varset MerchantNameA "Snokin Breaksteel"
    /varset MerchantNameB "Cevroy Sharpaxe"
    /varset MerchantNameC "Dray Cuves"
    /varset SkillMaxWanted 115

| ************************************************
| ************************************************

    :start
    /echo Blacksmithing is at ${Me.Skill[Blacksmithing]}

    /if (${Me.Skill[Blacksmithing]}>=${SkillMaxWanted}) {
      /echo Blacksmithing is at ${SkillMaxWanted}. Quiting!
      /endmacro
    }

    /if (${Me.Skill[Blacksmithing]}<92) {
      /varset CompA "gorget mold"
      /varset CompB "sheet metal"
      /varset CompC "water flask"
      /varset CombItemName "BG"
      /varset ItemTo "Banded Gorget"
    }
    /if (${Me.Skill[Blacksmithing]}>=92 && ${Me.Skill[Blacksmithing]}<102) {
      /varset CompA "cloak sectional mold"
      /varset CompB "sheet metal"
      /varset CompC "water flask"
      /varset CombItemName "BC"
      /varset ItemTo "Banded Cloak"
    }
    /if (${Me.Skill[Blacksmithing]}>=102 && ${Me.Skill[Blacksmithing]}<115) {
      /varset CompA "mail sectional mold"
      /varset CompB "sheet metal"
      /varset CompC "water flask"
      /varset CombItemName "BM"
      /varset ItemTo "Banded Mail"
    }


    /varset EndingVar 1
    /delay 1s
    /target ${MerchantNameA}
    /face
    /delay 1s
    /click right target
    /delay 1s
    /call Buy ${CompB} 30
    /delay 1s
    /notify MerchantWnd DoneButton leftmouseup
    /delay 1s

    /look
    /call GoToMerchantB
    /delay 2s
    /target ${MerchantNameB}
    /face
    /delay 1s
    /click right target
    /delay 1s
    /call Buy ${CompA} 10
    /delay 1s
    /notify MerchantWnd DoneButton leftmouseup
    /delay 1s

    /look
    /call GoToMerchantC
    /delay 2s
    /target ${MerchantNameC}
    /face
    /delay 1s
    /click right target
    /delay 1s
    /call Buy ${CompC} 20
    /delay 1s
    /notify MerchantWnd DoneButton leftmouseup
    /delay 1s


    /call GotoForge
    /look
    /delay 1s
    /click left item
    /delay 2s
    /doevents
    /delay 1s
    /notify TradeskillWnd ExperimentButton leftmousehold
    /notify TradeskillWnd ExperimentButton leftmouseup
    /delay 2s
    /call OpenPacks

    /call readIni "${CombItemName}" 
    :Begin 
       /if (${EndingVar}==1) /call ClearCursor 
       /for i 1 to 10 
             /if (${EndingVar}==1) /call AddComp "${Component[${i}]}" ${i} 
       /next i 
       /if (${EndingVar}==1) /call DoCombine 
       /if (${EndingVar}==1) /goto :Begin
 
    /delay 1s
    /call ClosePacks
    /keypress esc
    /keypress esc

    /call GoToMerchantA
    /delay 1s
    /target ${MerchantNameA}
    /face
    /delay 1s
    /click right target
    /delay 1s
    /call OpenPacks
    /delay 2s
    /call Sell ${ItemTo}
    /delay 1s
    /call Sell ${CompA}
    /delay 1s
    /call ClosePacks
    /keypress esc
    /keypress esc

    /goto :start

    /return

Sub readIni(RecipeName) 
    /declare Container string 

    /echo Running ${RecipeName} recipe 

   /if (${Ini["smithing.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) { 
        /echo Recipe ${RecipeName} not found 
        /endmacro 
    } 

   /varset Container ${Ini[smithing.ini,${RecipeName},Cont,Enviro]} 

   /if (${Container.Equal[Enviro]}) { 
        /varset PackCode Enviro 
   } else { 
        /varset PackCode ${FindItem[=${Container}].InvSlot} 
       
      /if (${PackCode.Equal[NULL]}) { 
         /echo Could not find container ${Container} 
         /varset EndingVar 2
         /return
      } 
      | pack1 = 22, ... , pack8 = 29 
      /varset PackCode pack${Math.Calc[${PackCode}-21].Int} 
   }  

    /for i 1 to 10 
        /varset Component[${i}] ${Ini[smithing.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]} 
    /next i 
    /return 

sub ClearCursor 
    :Loop 
      /if (!${Cursor.ID}) /return 
      /autoinv 
|      /destroy	
      /delay 5 
      /doevents 
      /goto :Loop 
    /return 

sub DoCombine 
    :Loop 
      /combine ${PackCode} 
      /delay 1s 
      /if (${PackCode.Equal[Enviro]}) /delay 1s 
       /doevents 
      /if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop 
      /delay 5 
      /if (${Me.Skill[Blacksmithing]}>${OldSkill}) {
        /echo Your Blacksmithing Went Up!! It's now ${Me.Skill[Blacksmithing]}!
        /varset OldSkill ${Me.Skill[Blacksmithing]}
      }
    /return 

sub AddComp(CompName, PackSlot) 
   /if (${CompName.Equal[NOTFOUND]}) /return 

   /if (!${FindItem[=${CompName}].ID}) { 
      /echo Could not find ${CompName} in inventory 
      /beep 
      /varset EndingVar 2
      /return 
    } 

   :Loop 
      /ctrl /itemnotify ${FindItem[=${CompName}].InvSlot} leftmouseup 

      /if (!${Cursor.ID}) { 
         /delay 1 
         /goto :Loop 
      } 

   /if (${PackCode.Equal[Enviro]}) { 
      /itemnotify ${InvSlot[enviro${PackSlot}]} leftmouseup 
   } else { 
      /itemnotify in ${PackCode} ${PackSlot} leftmouseup 
   }    
   /return 

Sub Event_CombineError 
    /varset EndingVar 2
/return 

Sub Event_ContUsed
    /echo Container in use. Waiting 30 seconds and trying again.
    /delay 30s
    /itemtarget "Forge"
    /delay 1s
    /click left item
    /delay 2s
    /doevents
/return 

Sub GoToMerchantA
  /echo Going to ${MerchantNameA}.
  :PullMoveLoopa
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc 18.59,221.98
  /if (${Math.Distance[18.59,221.98]}>2) /keypress forward hold 
  /if (${Math.Distance[18.59,221.98]}<=2) {
    /keypress forward
    /goto :PullMoveLoopb
  }
  /goto :PullMoveLoopa
  /delay 1s
  :PullMoveLoopb
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc 126.89,236.86
  /if (${Math.Distance[126.89,236.86]}>2) /keypress forward hold 
  /if (${Math.Distance[126.89,236.86]}<=2) {
    /keypress forward
    /goto :doora
  }
  /goto :PullMoveLoopb
  :doora
  /delay 1s
  /face nolook loc 130.49,259.22
  /delay 1s
  /keypress u
  /delay 1s
  :PullMoveLoopc
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc 130.49,259.22
  /if (${Math.Distance[130.49,259.22]}>2) /keypress forward hold 
  /if (${Math.Distance[130.49,259.22]}<=2) {
    /keypress forward
    /goto :PullMoveLoopd
  }
  /goto :PullMoveLoopc
  /delay 1s
  :PullMoveLoopd
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc 92.71,259.21
  /if (${Math.Distance[92.71,259.21]}>2) /keypress forward hold 
  /if (${Math.Distance[92.71,259.21]}<=2) {
    /keypress forward
    /goto :end
  }
  /goto :PullMoveLoopd
  :end
/return

Sub GoToMerchantB
  /echo Going to ${MerchantNameB}.
  :PullMoveLoopa
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc 130.49,259.22
  /if (${Math.Distance[130.49,259.22]}>2) /keypress forward hold 
  /if (${Math.Distance[130.49,259.22]}<=2) {
    /keypress forward
    /goto :doora
  }
  /goto :PullMoveLoopa
  :doora
  /delay 1s
  /face nolook loc 129.65,235.06
  /delay 1s
  /keypress u
  /delay 1s
  :PullMoveLoopb
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc 129.65,235.06
  /if (${Math.Distance[129.65,235.06]}>2) /keypress forward hold 
  /if (${Math.Distance[129.65,235.06]}<=2) {
    /keypress forward
    /goto :PullMoveLoopc
  }
  /goto :PullMoveLoopb
  :PullMoveLoopc
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc 35.36,235.70
  /if (${Math.Distance[35.36,235.70]}>2) /keypress forward hold 
  /if (${Math.Distance[35.36,235.70]}<=2) {
    /keypress forward
    /goto :PullMoveLoopd
  }
  /goto :PullMoveLoopc
  :PullMoveLoopd
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc 58.49,263.19
  /if (${Math.Distance[58.49,263.19]}>2) /keypress forward hold 
  /if (${Math.Distance[58.49,263.19]}<=2) {
    /keypress forward
    /goto :end
  }
  /goto :PullMoveLoopd
  :end
/return

Sub GoToMerchantC
  /echo Going to ${MerchantNameC}.
  :PullMoveLoopc
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -17.97,242.28
  /if (${Math.Distance[-17.97,242.28]}>2) /keypress forward hold 
  /if (${Math.Distance[-17.97,242.28]}<=2) {
    /keypress forward
    /goto :PullMoveLoopd
  }
  /goto :PullMoveLoopc
  /delay 1s
  :PullMoveLoopd
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -56.90,285.24
  /if (${Math.Distance[-56.90,285.24]}>2) /keypress forward hold 
  /if (${Math.Distance[-56.90,285.24]}<=2) {
    /keypress forward
    /goto :PullMoveLoope
  }
  /goto :PullMoveLoopd
  /delay 1s
  :PullMoveLoope
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -240.09,285.24
  /if (${Math.Distance[-240.09,285.24]}>2) /keypress forward hold 
  /if (${Math.Distance[-240.09,285.24]}<=2) {
    /keypress forward
    /goto :PullMoveLoopf
  }
  /goto :PullMoveLoope
  /delay 1s
  :PullMoveLoopf
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -242.62,215.95
  /if (${Math.Distance[-242.62,215.95]}>2) /keypress forward hold 
  /if (${Math.Distance[-242.62,215.95]}<=2) {
    /keypress forward
    /goto :doorb
  }
  /goto :PullMoveLoopf
  :doorb
  /delay 1s
  /face nolook loc -155.54,209.45
  /delay 1s
  /keypress u
  /delay 1s
  :PullMoveLoopg
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -155.54,209.45
  /if (${Math.Distance[-155.54,209.45]}>2) /keypress forward hold 
  /if (${Math.Distance[-155.54,209.45]}<=2) {
    /keypress forward
    /goto :PullMoveLooph
  }
  /goto :PullMoveLoopg
  :PullMoveLooph
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -155.54,189.52
  /if (${Math.Distance[-155.54,189.52]}>2) /keypress forward hold 
  /if (${Math.Distance[-155.54,189.52]}<=2) {
    /keypress forward
    /goto :end
  }
  /goto :PullMoveLooph
  :end
/return 

Sub GoToForge
  /echo Going to Forge.
  :PullMoveLoopa
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -55.54,189.52
  /if (${Math.Distance[-155.54,189.52]}>2) /keypress forward hold 
  /if (${Math.Distance[-155.54,189.52]}<=2) {
    /keypress forward
    /goto :PullMoveLoopb
  }
  /goto :PullMoveLoopa
  /delay 1s
  :PullMoveLoopb
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -155.54,209.45
  /if (${Math.Distance[-155.54,209.45]}>2) /keypress forward hold 
  /if (${Math.Distance[-155.54,209.45]}<=2) {
    /keypress forward
    /goto :PullMoveLoopc
  }
  /goto :PullMoveLoopb
  /delay 1s
  :PullMoveLoopc
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -215.14,215.85
  /if (${Math.Distance[-215.14,215.85]}>2) /keypress forward hold 
  /if (${Math.Distance[-215.14,215.85]}<=2) {
    /keypress forward
    /goto :doora
  }
  /goto :PullMoveLoopc
  :doora
  /delay 1s
  /face nolook loc -242.62,215.95
  /delay 1s
  /keypress u
  /delay 1s
  :PullMoveLoopd
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -242.62,215.95
  /if (${Math.Distance[-242.62,215.95]}>2) /keypress forward hold 
  /if (${Math.Distance[-242.62,215.95]}<=2) {
    /keypress forward
    /goto :PullMoveLoope
  }
  /goto :PullMoveLoopd
  /delay 1s
  :PullMoveLoope
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -240.09,285.24
  /if (${Math.Distance[-240.09,285.24]}>2) /keypress forward hold 
  /if (${Math.Distance[-240.09,285.24]}<=2) {
    /keypress forward
    /goto :PullMoveLoopf
  }
  /goto :PullMoveLoope
  /delay 1s
  :PullMoveLoopf
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -56.90,285.24
  /if (${Math.Distance[-56.90,285.24]}>2) /keypress forward hold 
  /if (${Math.Distance[-56.90,285.24]}<=2) {
    /keypress forward
    /goto :forge
  }
  /goto :PullMoveLoopf
  :forge
  /itemtarget "Forge"
  :PullMoveLoopg
  /if (${Me.State.Equal[SIT]}) /stand
  /face
  /if (${Target.Distance}>10) /keypress forward hold 
  /if (${Target.Distance}<=10) {
    /keypress forward
    /goto :end
  }
  /goto :PullMoveLoopg
  :end
/return 
smithing.ini

Code: Select all

[BM]
Cont=Enviro
Comp0=mail sectional mold
Comp1=sheet metal
Comp2=sheet metal
Comp3=sheet metal
Comp4=water flask

[BG]
Cont=Enviro
Comp0=gorget mold
Comp1=sheet metal
Comp2=water flask

[BC]
Cont=Enviro
Comp0=cloak sectional mold
Comp1=sheet metal
Comp2=sheet metal
Comp3=water flask
buy.inc

Code: Select all

| 
| buy.inc
| Buy Include File needed for macros
| Version 1.3
| Date: August 1, 2004
|
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/index.htm
|
| These file MUST be in the common directory in your macros directory.
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
| 


#event Broke "#*#can't afford to buy them#*#" 

Sub Buy(item ItemToBuy, int amount)

/echo Buying ${ItemToBuy}

/declare TotalMItems int Inner
/varset TotalMItems ${Merchant.Items}
/declare x int Inner
/declare ItemSlotNum int Inner
/varset ItemSlotNum 0

/for x 1 to ${TotalMItems}
  /if (${ItemToBuy.Equal[${Merchant.Item[${x}]}]}) {
    /varset ItemSlotNum ${x}
  }
/next x

/if (${ItemSlotNum}==0) {
  /echo Not on Merchant
  /return
}

/itemnotify merchant${ItemSlotNum} leftmouseup


:Buy 
   /if (${FindItemCount[=${SelectedItem}]}>=${amount}) {
     /echo Done!
     /return
   }        

:StackLoop 
   /if (${Math.Calc[${amount}-${FindItemCount[=${SelectedItem}]}]}<=20) /goto :RegLoop 
   /buyitem ${If[${SelectedItem.Stackable},20,1]} 
   /delay 5 
   /doevents 
   /goto :StackLoop 

:RegLoop 
   /if (${Math.Calc[${amount}-${FindItemCount[=${SelectedItem}]}]}<=0) {
     /echo Done!
     /return
   }        
   /buyitem ${If[${SelectedItem.Stackable},${Math.Calc[${amount}-${FindItemCount[=${SelectedItem}]}]},1]} 
   /delay 5 
   /doevents 
   /goto :RegLoop 

/return

Sub Event_Broke 
   /echo Error: You are out of money! 
   /beep
   /endmacro
/return 
packs.inc

Code: Select all

| 
| packs.inc
| Open and Close Packs Include File needed for macros
| Version 1.1
| Date: August 1, 2004
|
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/index.htm
|
| These file MUST be in the common directory in your macros directory.
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
| 

Sub OpenPacks 
   /declare bag int local 0 

   /newif (!${Window[InventoryWindow].Open}) /keypress inventory 
   /delay 1 
   /for bag 1 to 8 step 1 
      /newif (!${Window[pack${bag}].Open}) /itemnotify pack${bag} rightmouseup 
   /next bag 
   /delay 1 
/return 

Sub ClosePacks 
   /declare bag int local 0 
|   /newif (!${Window[InventoryWindow].Open}} /keypress inventory 
   /delay 1 
   /for bag 1 to 8 step 1 
      /newif (${Window[pack${bag}].Open}) /itemnotify pack${bag} rightmouseup 
   /next bag 
   /delay 1 
/return 
sell.inc

Code: Select all

| 
| sell.inc
| Selling Include File needed for macros
| Version 1.2
| Date: August 1, 2004
|
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/index.htm
|
| These file MUST be in the common directory in your macros directory.
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
| 


Sub Sell(string ItemToSell)
   /declare OldMoney int Inner    
   /declare NewMoney int Inner
 
   /autoinv 

   /if (${ItemToSell.Equal[NULL]}) {
     /echo Usage: /macro sell "Item"
     /return
   }

   :Finding 
      /if (${FindItemCount[=${ItemToSell}]}==0) /goto :Done 
      /itemnotify ${FindItem[=${ItemToSell}].InvSlot} leftmouseup 

   :WaitFind 
      /if (${Bool[${SelectedItem}]}==FALSE) /goto :WaitFind 

   :Selling
      /delay 1s 
      /varset OldMoney ${Me.Cash} 
      /shift /notify MerchantWnd MW_Sell_Button leftmouseup 

   :WaitSell 
      /varset NewMoney $(Me.Cash} 
      /if (${NewMoney}==${OldMoney}) /goto :WaitSell 
      /goto :Finding 

   :Done 
      /echo No more ${ItemToSell} to sell!!!      
/return 

Posted: Tue Aug 10, 2004 1:49 am
by Goofmester1
Something people should correct for themselves but could be missed. In the current download of you Smithing macro the SkillMaxWanted value is default to 116 however the last combine setup will only get you to 115 so the macro will infinatly continue to make Banded Mail until the money is gone since the skill can never reach 116.

Posted: Tue Aug 10, 2004 2:23 am
by ascii38
It might be worthwhile putting in an event for "cannot gain more skill making that item" (or whatever the actual phrase is) as an out for problems resulting from errors in trivial levels. Since the macro changes recipes when trivial is met, it should never see the trivial message. If it does see it, there could be bug in the code (or SOE change the trivials, which has been known to happen). Having an event that ends the macro when the trivial message is seen could save people some money.

Posted: Tue Aug 10, 2004 12:26 pm
by aChallenged1
You can no longer advance your skill from making this item.
This is the exact wording.

Posted: Tue Aug 10, 2004 4:04 pm
by Override
Goofmester1 wrote:Something people should correct for themselves but could be missed. In the current download of you Smithing macro the SkillMaxWanted value is default to 116 however the last combine setup will only get you to 115 so the macro will infinatly continue to make Banded Mail until the money is gone since the skill can never reach 116.
Sorry about that, this is how I test the code out on my toons now, all my toons are over 115 in blacksmithing, so i set it to 116 so i can use it on a toon with only 115. I meant to change it before I released it and forgot. But I am looking into changing my macros to use events instead of max skills for items.

help

Posted: Fri Aug 20, 2004 8:57 pm
by siberian007
i tried to modify this smithing macro to just combine items past the 115 mark so i could just buy a lot and let it combine em for me. but i keep getting the message

flow ran into another subroutine
smithing.mac@75 (readini(RecipeName)): sub readini(RecipeName)
the current macro has ended


here is my macro

Code: Select all

   

#event CombineError "#*#There was no place to put that#*#" 
#event CombineError "#*#You cannot combine these items in this container type!#*#" 
#event CombineError "#*#did not accept these items#*#" 
#event ContUsed "#*#Someone else is using that. Try again later.#*#"
#include common/sell.inc
#include common/buy.inc
#include common/packs.inc
#include common/cleanpacks.inc

Sub Main
    /declare OldSkill int outer
    /declare SkillMaxWanted int outer
    /declare PackCode string outer 
    /declare Component[10] string outer 
    /declare i int outer
    /declare CompA item outer
    /declare CompB item outer
    /declare CompC item outer
    /declare CombItemName string outer
    /declare ItemTo string outer
    /declare EndingVar int outer
    /declare Levelname int outer
    /varset OldSkill ${Me.Skill[Blacksmithing]}

  /varset SkillMaxWanted 210

 :start
    /echo Blacksmithing is at ${Me.Skill[Blacksmithing]}

    /if (${Me.Skill[Blacksmithing]}>=${SkillMaxWanted}) {
      /echo Blacksmithing is at ${SkillMaxWanted}. Quiting!
      /endmacro
    }


/if (${Me.Skill[Blacksmithing]}<210) {
      /varset CompA "coldain velium temper"
      /varset CompB "small piece of velium"
      /varset CompC "spell: enchant velium"
      /varset CombItemName "EV"
      /varset ItemTo "enchanted velium bits"
    }



    /call GotoForge
    /look
    /delay 1s
    /nomodkey /click left item
    /delay 2s
    /doevents
    /delay 1s
    /call OpenPacks
    /delay 2s



    /call readIni "${CombItemName}" 
    :Begin 
       /if (${EndingVar}==1) /call ClearCursor 
       /for i 1 to 10 
             /if (${EndingVar}==1) /call AddComp "${Component[${i}]}" ${i} 
       /next i 
       /if (${EndingVar}==1) /call DoCombine 
       /if (${EndingVar}==1) /goto :Begin
 
    /delay 1s
    /call ClosePacks
    /nomodkey /keypress esc



Sub readIni(RecipeName) 
    /declare Container string 

    /echo Running ${RecipeName} recipe 

   /if (${Ini["smithing.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) { 
        /echo Recipe ${RecipeName} not found 
        /endmacro 
    } 

   /varset Container ${Ini[smithing.ini,${RecipeName},Cont,Enviro]} 

   /if (${Container.Equal[Enviro]}) { 
        /varset PackCode Enviro 
   } else { 
        /varset PackCode ${FindItem[=${Container}].InvSlot} 
       
      /if (${PackCode.Equal[NULL]}) { 
         /echo Could not find container ${Container} 
         /varset EndingVar 2
         /return
      } 
      | pack1 = 22, ... , pack8 = 29 
      /varset PackCode pack${Math.Calc[${PackCode}-21].Int} 
   }  

   /call cleanPack ${Container}

    /for i 1 to 10 
        /varset Component[${i}] 

${Ini[smithing.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]} 
    /next i 
    /return 

sub ClearCursor 
    :Loop 
      /if (!${Cursor.ID}) /return 
 |     /autoinv 
     /destroy	
      /delay 5 
      /doevents 
      /goto :Loop 
    /return 

sub DoCombine 
    :Loop 
      /combine ${PackCode} 
      /delay 1s 
      /if (${PackCode.Equal[Enviro]}) /delay 1s 
      /doevents 
      /if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop 
      /delay 5 
      /if (${Me.Skill[Blacksmithing]}>${OldSkill}) {
        /echo Your Blacksmithing Went Up!! It's now ${Me.Skill[Blacksmithing]}!
        /varset OldSkill ${Me.Skill[Blacksmithing]}
      }
    /return 

sub AddComp(CompName, PackSlot) 
   /if (${CompName.Equal[NOTFOUND]}) /return 

   /if (!${FindItem[=${CompName}].ID}) { 
      /echo Could not find ${CompName} in inventory 
      /beep 
      /varset EndingVar 2
      /return 
    } 

   :Loop 
      /nomodkey /ctrl /itemnotify ${FindItem[=${CompName}].InvSlot} leftmouseup 

      /if (!${Cursor.ID}) { 
         /delay 1 
         /goto :Loop 
      } 

   /if (${PackCode.Equal[Enviro]}) { 
      /nomodkey /itemnotify ${InvSlot[enviro${PackSlot}]} leftmouseup 
   } else { 
      /nomodkey /itemnotify in ${PackCode} ${PackSlot} leftmouseup 
   }    
   /return 

Sub Event_CombineError 
    /varset EndingVar 2
/return 

Sub Event_ContUsed
    /echo Container in use. Waiting 30 seconds and trying again.
    /delay 30s
    /itemtarget "Forge"
    /delay 1s
    /nomodkey /click left item
    /delay 2s
    /doevents
/return 



Sub GoToForge
  :forge
  /itemtarget "Forge"
  
  /if (${Me.State.Equal[SIT]}) /stand
  /face
  /if (${Target.Distance}>10) /nomodkey /keypress forward hold 
  /if (${Target.Distance}<=10) {
    /nomodkey /keypress forward
    /goto :end
  }
 :end
/return 
and here is my .ini file

Code: Select all

[BM]
Cont=Enviro
Comp0=mail sectional mold
Comp1=sheet metal
Comp2=sheet metal
Comp3=sheet metal
Comp4=water flask

[BG]
Cont=Enviro
Comp0=gorget mold
Comp1=sheet metal
Comp2=water flask

[BC]
Cont=Enviro
Comp0=cloak sectional mold
Comp1=sheet metal
Comp2=sheet metal
Comp3=water flask

[EV]
Cont=Enviro
Comp0=coldain velium temper
Comp1=small piece of velium
Comp2=small piece of velium
Comp3=spell: enchant velium
any help will be appreciated

Posted: Fri Aug 20, 2004 11:29 pm
by Override
It is probably having a problem reading the colon in the recipe, that is the only thing I can see right off hand, did you change anything else but the recipe?

Posted: Sat Aug 21, 2004 6:29 pm
by siberian007
i found what i did wrong i had taken out a block of code that was apparently needed :P got it to work great :) up to 189 now !


awesome macros btw man... BIG NICE JOB

Posted: Sat Aug 21, 2004 6:35 pm
by Dadelot
can we have the working macro please Siberian?

Posted: Sat Aug 21, 2004 8:23 pm
by Override
Thanks, and if you want to post the new macro, or send it to me, i will add it to the old one and put it on the site too, thanks.

Posted: Sat Aug 21, 2004 9:41 pm
by siberian007
aye lol sorry about that was omw to work when i posted. here it is.




Code: Select all

| Modified version of overrides smithing macro
|This combines items already in your inventory
| smithing2.mac
| 
|



#event CombineError "#*#There was no place to put that#*#" 
#event CombineError "#*#You cannot combine these items in this container type!#*#" 
#event CombineError "#*#did not accept these items#*#" 
#event ContUsed "#*#Someone else is using that. Try again later.#*#"
#include common/packs.inc
#include common/cleanpacks.inc

Sub Main
    /declare OldSkill int outer
    /declare SkillMaxWanted int outer
    /declare PackCode string outer 
    /declare Component[10] string outer 
    /declare i int outer
    /declare CompA item outer
    /declare CompB item outer
    /declare CompC item outer
    /declare CompD item outer
    /declare CombItemName string outer
    /declare ItemTo string outer
    /declare EndingVar int outer
    /declare Levelname int outer
    /varset OldSkill ${Me.Skill[Blacksmithing]}

| ************************************************
| *   Change these settings to what you want.    *
| ************************************************

    /varset SkillMaxWanted 210

| ************************************************
| ************************************************

    :start
    /echo Blacksmithing is at ${Me.Skill[Blacksmithing]}

    /if (${Me.Skill[Blacksmithing]}>=${SkillMaxWanted}) {
      /echo Blacksmithing is at ${SkillMaxWanted}. Quiting!
      /endmacro
    }

      /if (${Me.Skill[Blacksmithing]}>=115 && ${Me.Skill[Blacksmithing]}<188) {
      /varset CompA "file"
      /varset CompB "mark of karana"
      /varset CompC "small brick of steel"
      /varset CompD "water flask"
      /varset CombItemName "SA"
      /varset ItemTo "Steel Arrowheads"
    }
    
      /if (${Me.Skill[Blacksmithing]}<210) {
      /varset CompA "coldain velium temper"
      /varset CompB "small piece of velium"
      /varset CompC "spell: enchant velium"
      /varset CombItemName "EV"
      /varset ItemTo "enchanted velium bits"
    }

    /varset EndingVar 1


    /call GotoForge
    /look
    /delay 1s
    /nomodkey /click left item
    /delay 2s
    /doevents
    /delay 1s
    /call OpenPacks
    /delay 2s

    /call readIni "${CombItemName}" 
    :Begin 
       /if (${EndingVar}==1) /call ClearCursor 
       /for i 1 to 10 
             /if (${EndingVar}==1) /call AddComp "${Component[${i}]}" ${i} 
       /next i 
       /if (${EndingVar}==1) /call DoCombine 
       /if (${EndingVar}==1) /goto :Begin
 
    /delay 1s
    /call ClosePacks
    /nomodkey /keypress esc


    /goto :start

    /return

Sub readIni(RecipeName) 
    /declare Container string 

    /echo Running ${RecipeName} recipe 

   /if (${Ini["smithing.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) { 
        /echo Recipe ${RecipeName} not found 
        /endmacro 
    } 

   /varset Container ${Ini[smithing.ini,${RecipeName},Cont,Enviro]} 

   /if (${Container.Equal[Enviro]}) { 
        /varset PackCode Enviro 
   } else { 
        /varset PackCode ${FindItem[=${Container}].InvSlot} 
       
      /if (${PackCode.Equal[NULL]}) { 
         /echo Could not find container ${Container} 
         /varset EndingVar 2
         /return
      } 
      | pack1 = 22, ... , pack8 = 29 
      /varset PackCode pack${Math.Calc[${PackCode}-21].Int} 
   }  

   /call cleanPack ${Container}

    /for i 1 to 10 
        /varset Component[${i}] 

${Ini[smithing.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]} 
    /next i 
    /return 

sub ClearCursor 
    :Loop 
      /if (!${Cursor.ID}) /return 
      /autoinv 
 |     /destroy	
      /delay 5 
      /doevents 
      /goto :Loop 
    /return 

sub DoCombine 
    :Loop 
      /combine ${PackCode} 
      /delay 1s 
      /if (${PackCode.Equal[Enviro]}) /delay 1s 
      /doevents 
      /if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop 
      /delay 5 
      /if (${Me.Skill[Blacksmithing]}>${OldSkill}) {
        /echo Your Blacksmithing Went Up!! It's now ${Me.Skill[Blacksmithing]}!
        /varset OldSkill ${Me.Skill[Blacksmithing]}
      }
    /return 

sub AddComp(CompName, PackSlot) 
   /if (${CompName.Equal[NOTFOUND]}) /return 

   /if (!${FindItem[=${CompName}].ID}) { 
      /echo Could not find ${CompName} in inventory 
      /beep 
      /varset EndingVar 2
      /return 
    } 

   :Loop 
      /nomodkey /ctrl /itemnotify ${FindItem[=${CompName}].InvSlot} leftmouseup 

      /if (!${Cursor.ID}) { 
         /delay 1 
         /goto :Loop 
      } 

   /if (${PackCode.Equal[Enviro]}) { 
      /nomodkey /itemnotify ${InvSlot[enviro${PackSlot}]} leftmouseup 
   } else { 
      /nomodkey /itemnotify in ${PackCode} ${PackSlot} leftmouseup 
   }    
   /return 

Sub Event_CombineError 
    /varset EndingVar 2
/return 

Sub Event_ContUsed
    /echo Container in use. Waiting 30 seconds and trying again.
    /delay 30s
    /itemtarget "Forge"
    /delay 1s
    /nomodkey /click left item
    /delay 2s
    /doevents
/return 



Sub GoToForge
  /echo Going to Forge.

  :forge
  /itemtarget "Forge"
  :PullMoveLoopg
  /if (${Me.State.Equal[SIT]}) /stand
  /face
  /if (${Target.Distance}>10) /nomodkey /keypress forward hold 
  /if (${Target.Distance}<=10) {
    /nomodkey /keypress forward
    /goto :end
  }
  /goto :PullMoveLoopg
  :end
/return 


all you need to do is change your recipe numbers and components for the recipe you want to combine

Code: Select all

      /if (${Me.Skill[Blacksmithing]}>=115 && ${Me.Skill[Blacksmithing]}<188) {
      /varset CompA "file"
      /varset CompB "mark of karana"
      /varset CompC "small brick of steel"
      /varset CompD "water flask"
      /varset CombItemName "SA"
      /varset ItemTo "Steel Arrowheads"
    }

Posted: Sun Aug 22, 2004 4:21 am
by siberian007
override i also have an update to your pottery mac to get to 199, and i posted a not so fully automated tailoring to 158 macro in the depot if ya wanna snag it and add whatever godly skill it is you add to it to make it automatic


do you want me to post em somewhere? or send em to you and let you post em.

Posted: Sun Aug 22, 2004 10:18 am
by Override
I am currently working on the pottery to 199 to make it automatic too, I am almost done with that, I will probably be posting that soon actually, thanks.

Posted: Sun Aug 22, 2004 7:07 pm
by siberian007
great ill just wait on yours to be posted then.. thanks again for all of them

Posted: Sat Nov 13, 2004 10:17 pm
by p00n
Anyone do any more mods to this post 115?