Page 3 of 28

Posted: Thu Aug 05, 2004 1:11 am
by Override
loadingpleasewait wrote:No, yer all wrong.. hehe, I meant the smithing macro.. hehe, oops.. :D
I haven't added in a check for if the door is open or not yet, didn't think about it actually, but I will fix that. :)

Posted: Thu Aug 05, 2004 1:28 am
by Override
I forgot to add, I have only added the cleanPacks function and the "pre-sell" to the brewing and baking macros, once I test the others I will add them to the site too. :)

Posted: Thu Aug 05, 2004 6:23 pm
by Pytte
one thing i noticed while i was having lag is that when it wants to buy from merchants it says.. merchant doesn't have item .. because it doesn't give it enough time to open up ..

maybe you should have a bigger timer or a simple check to see if merchant window is open before buying ..

keep up the good work btw ;)

Posted: Thu Aug 05, 2004 6:29 pm
by Override
Pytte wrote:one thing i noticed while i was having lag is that when it wants to buy from merchants it says.. merchant doesn't have item .. because it doesn't give it enough time to open up ..

maybe you should have a bigger timer or a simple check to see if merchant window is open before buying ..

keep up the good work btw ;)

I can add a little more time to the delay before it starts buying, i have had to fix a few already cause a few people were lagging a little more then i thought on parts.

I may not get to the other fixs tonight, ends up I have a few things I have to do tonight, but I will try to get it up tomorrow.

Posted: Thu Aug 05, 2004 8:40 pm
by The Overmind
These Macro's are awesome. I've maxed Brewing, JC, and Fletching via these macro's so far to their limits. In only 2 days. They are own.

The JC one isn't that bad though for cost. I had about 145ish when I started already. And getting to 145 is pretty cheap. But going from 145 to 250 cost me around 20-25k in plat. Which really isn't all that bad considering the cost of the materials. Great job.

Posted: Thu Aug 05, 2004 9:48 pm
by mekaniak
if only the poor people (Me) had 20-25k to spend on jc. Guess I'll have to stick to the cheap tradeskills still. :?

Posted: Fri Aug 06, 2004 12:30 am
by Override
I have updated the smithing macro (v2.3) to add in the Combine Container check to make sure there are no components in it before it started putting items in the container and added in the "pre-sell" lines of code in too.

Posted: Fri Aug 06, 2004 5:45 am
by mekaniak
I dont know if its just me or what, but when I run the fletching macro it opens up a blank window instead of the fletching kit...I have it in the 8 slot, but it just echos out an error saying "No container at 'pack8'....after further testing though, it only happens sometimes. hhhmmm odd. oh well, guess i'll just have to run the macro when its not 4:45am and im not trying to sleep. pretty fast and nice though for skillups. excellent work override, now if only there was a way to get smithing up to 200 with out having to zone or farm stuff.

Posted: Fri Aug 06, 2004 5:51 pm
by showme1
Can thank Rusty~ for this, but I have updated the brewing and include files so that alt tabbing or hitting the shift key wont mess it up. Before if alt tabbing or shifting while buying or combining it would mess the macro up. I added the /nomodkey line where it was needed on the brewing macro and the 3 include files. Something you might want to add to the other macros. These are very well done BTW. Thank you very much for them! Here is the new code...

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 
      /nomodkey /itemnotify ${FindItem[=${ItemToSell}].InvSlot} leftmouseup 

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

   :Selling
      /delay 1s 
      /varset OldMoney ${Me.Cash} 
      /nomodkey /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 

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
}

/nomodkey /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}) /nomodkey /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}) /nomodkey /itemnotify pack${bag} rightmouseup 
   /next bag 
   /delay 1 
/return 

brewing.mac

Code: Select all

| 
| brewing.mac
| Takes you from 1 to 248 in Brewing
| Version 2.5
| 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 248 in brewing. 
| SkillMaxWanted can be change to what skill you want to stop at.
| MerchantNameA is which merchant has the brewing components.
| MerchantNameB is which merchant has the water and short beer components.
|
| This Macro works best in the Abysmal Sea since all the components are there.
| You WILL need to be between both merchants to be able to use this macro.
|
| 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 CompA item outer
    /declare CompB item outer
    /declare CompC item outer
    /declare CompD item outer
    /declare CompE item outer
    /declare CombItemName string outer
    /declare ItemToA string outer
    /declare ItemToB string outer
    /declare ItemToC string outer
    /declare EndingVar int outer
    /declare Levelname int outer
    /varset OldSkill ${Me.Skill[Brewing]}

| ************************************************
| *   Change these settings to what you want.    *
| ************************************************
  
    /varset MerchantNameA "Galidnus Corkpopper"
    /varset MerchantNameB "Dray Cuves"
    /varset SkillMaxWanted 248

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

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

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

    /if (${Me.Skill[Brewing]}<${SkillMaxWanted}) {
      /varset CompA "cask"
      /varset CompB "malt"
      /varset CompC "short beer"
      /varset CompD "water flask"
      /varset CompE "yeast"
      /varset CombItemName "MHB"
      /varset ItemToA "Minotaur Hero's Brew"
      /varset ItemToB "bottle"
      /varset ItemToC "cask"
    }


    /varset EndingVar 1
    /call GoToMerchant
    /delay 1s
    /target ${MerchantNameA}
|    /face
    /delay 1s
    /click right target
    /delay 1s
    /call Buy ${CompA} 40
    /delay 1s
    /call Buy ${CompB} 120
    /delay 1s
    /call Buy ${CompE} 40
    /delay 1s
    /nomodkey /notify MerchantWnd DoneButton leftmouseup

    /delay 2s
    /target ${MerchantNameB}
|    /face
    /delay 1s
    /click right target
    /delay 1s
    /call Buy ${CompC} 80
    /delay 1s
    /call Buy ${CompD} 100
    /delay 1s
    /nomodkey /notify MerchantWnd DoneButton leftmouseup
    /delay 1s

    /call GoToBarrel
    /look
    /delay 1s
    /click left item
    /delay 2s
    /doevents
    /delay 1s
    /nomodkey /notify TradeskillWnd ExperimentButton leftmousehold
    /nomodkey /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 GoToMerchant
    /delay 1s
    /target ${MerchantNameA}
|    /face
    /delay 1s
    /click right target
    /delay 1s
    /call OpenPacks
    /delay 2s
    /call Sell ${ItemToA}
    /delay 1s
    /call Sell ${ItemToB}
    /delay 1s
    /call Sell ${ItemToC}
    /delay 1s
    /call ClosePacks
    /keypress esc
    /keypress esc

    /goto :start

    /return

Sub readIni(RecipeName) 
    /declare Container string 

    /echo Running ${RecipeName} recipe, which makes ${ItemToA}.

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

   /varset Container ${Ini[brewing.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[brewing.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[Brewing]}>${OldSkill}) {
        /echo Your Brewing Went Up!! It's now ${Me.Skill[Brewing]}!
        /varset OldSkill ${Me.Skill[Brewing]}
      }
    /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 "Brew Barrel"
    /delay 1s
    /click left item
    /delay 2s
    /doevents
/return 


Sub GoToMerchant
  /echo Going to Merchants.
  :PullMoveLoop
  /if (${Me.State.Equal[SIT]}) /stand 
  /face nolook loc -165.30,178.83
  /if (${Math.Distance[-165.30,178.83]}>2) /keypress forward hold 
  /if (${Math.Distance[-165.30,178.83]}<=2) {
    /keypress forward
    /return
  }
  /goto :PullMoveLoop 
/return 

Sub GoToBarrel
  /echo Going to Brewing Barrel.
  /itemtarget "Brew Barrel"
  :PullMoveLoop
  /if (${Me.State.Equal[SIT]}) /stand
  /face fast
  /if (${Target.Distance}>10) /keypress forward hold 
  /if (${Target.Distance}<=10) {
    /keypress forward
    /return
  }
  /goto :PullMoveLoop 
/return 

Posted: Fri Aug 06, 2004 6:55 pm
by Override
I did not even know about the /nomodkey, lol. I will have to update all the macros to include it. You were actually using an older version of the brewing macro too that doesn't have the cleanPack function. But I will update it with the /nomodkey to the new version. Thanks.

Posted: Sat Aug 07, 2004 6:13 pm
by Override
Ok, I have made a big update to the macros. This the text on the site:
Alright, big update. I have updated all the macros (baking (v2.3), brewing (v2.7), fletching (v2.6), jcrafting (v2.3), and smithing (v 2.4) to include the combine container check and it also checks if the new tradeskill window is up before it clicks the experiment button now, before if you had it open up as a regular bag instead of opening the new tradeskill window and it clicked the "non-existed" experiment button it would go crazy and pop up a new non-named bag with one slot and not do the combines. Also, I have added the /nomodkey to pretty much anything that clicks on the screen so it doesn't mess up if you wanted to SHIFT + ALT + R out and do other stuff.
Hopefully this will help out a few people with some of the problems they have been having.

Posted: Tue Aug 10, 2004 12:33 am
by Roodoodog
Real nice work Override, great mac. Just wondering when it buys from a vendor it only buys 2 of the items as opposed to a stack, everything works fine just the amount bought seems off or is that the set buy amount?? Am still relatively new to mac's so after perusing the files I couldnt really see how I could change it.....hence the question :)

Thanks in advance,

Roo

Posted: Tue Aug 10, 2004 4:07 pm
by Override
LOL, i'm sorry about that, I was having it buy 2 for testing pruposes instead of 20 so it wouldnt waste that much money while testing. I meant to put it back to 20 before I released it and forgot. I will be sure to fix that on next release.

Gnome getting stuck on table on the way to forge.

Posted: Thu Aug 12, 2004 2:13 pm
by Stix2basics
Gnome getting stuck on table on the way to forge.

Dunno why.

Posted: Thu Aug 12, 2004 3:17 pm
by loadingpleasewait
Buy a grow potion.. = ) I noticed on me shammy that if I was shrunk, I would get stuck as well.. I just stopped shrinking myself.. :P