Heros Brew * New Param * Kinda :)

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

Moderator: MacroQuest Developers

robdawg
a ghoul
a ghoul
Posts: 114
Joined: Tue Mar 23, 2004 11:54 am
Contact:

Heros Brew * New Param * Kinda :)

Post by robdawg » Fri Apr 23, 2004 3:23 am

Here is my attempt to modify the old Hero's Brew with the new param.

BEFORE THIS CODE WILL WORK YOU MUST DOWNLOAD SERVICE PACK 5 OR 6 AND RECOMPILE MACROQUEST!

Goto google.com and type in "Visual C++ Service Pack" You will see service pack 6.0 so download it!

This was not my original code, but I refuse to raise trade skill by clicking and hope to help everyone else avoid that.

This code works for me. I have run it for a couple hours now and works good. Of course I do not expect everyone to have the same success.

Code: Select all

| - HerosBrew.mac - 
| - By: Onezero 
| - v0.0.6 
| 
| This is a simple script that will walk your character around Shadow Haven 
| and purchase the components to make Minotaur Hero's Brew.  Once components 
| have been purchased, your character will do as many combines as possible and 
| then go resupply. 
| 
| Usage: 
| /mac HerosBrew <Destroy, 0 or 1> <Reply, 0 or 1> <ReplyMessage, text> <Skip, 0 or 1> <Skill Alert, 0 or 1> 
| 
| NOTE: Be sure you are standing near Bilkel Biddinight.  He is in a tent-like 
|   little building near loc: pos184, pos917 (EQClient format, not X,Y) 
| 
| NOTE: Open up all eight of your bags (this macro assumes you have bags in all 
|   eight slots..dont think it would mess any thing up if you dont.) and make 
|   sure they are NOT overlapping!  As well as the brewing barrel window!  Make 
|   sure no bag/tradeskill windows are overlapping, otherwise this macro will NOT work! 
| 
| NOTE: Items can now be destroyed after a combine is complete, but for this to work 
|   you MUST turn on "Fast Item Destroy" in the options menu! 
| 
| When "destroy" is set to 1, all resulting items from the combine will be 
|   destroyed. 
| 
| When reply is set to 1, the macro will automatically reply to the person who sent 
|   you a tell and will NOT interrupt the macro.  You must use this in combination 
|   with <reply message> 
| 
| When you tell the macro to autoreply, you must set the reply message and BE SURE TO 
|   ENCLOSE IT IN QUOTES! 
| 
| When "skip" is set to 1, the macro will go directly to the Combine portion 
|   then continue on once it has finished with combines.  This was added for 
|   testing mostly, but if you get messed up and need to restart combines, this 
|   makes it easier. 
| 
| When "Skill Alert" is set to 1, the macro will alert the user and end itself when your 
|   brewing skill reaches 200. 

#turbo 
#include advpath.inc 

#event SkillUp "You have become better at Brewing!" 
#event InUse "Someone else is using that. Try again later." 

#chat tell 

Sub Main(Destroy,Reply,ReplyMessage,Skip,SkillAlert) 

/declare TellReply global 
/varset TellReply @Reply 

/declare TellReplyMessage global 
/varset TellReplyMessage @ReplyMessage 

/newif (${Defined[Destroy]}==FALSE) { 
    /echo Usage: /mac HerosBrew <Destroy, 0 or 1> <Reply, 0 or 1> <ReplyMessage, text> <Skip, 0 or 1> <Skill Alert, 0 or 1> 
    /endmacro 
} 

| Initialize advpath 
    /call InitAPFVars 1 15 20 

| Set advpath to silent 
    /call SilentFunction 

| Notify the user of the settings they have chosen. 
    /newif (@Skip==1) /echo You have chosen to skip to combining! 
    /newif (@Destroy==1) /echo All items from combines will be DESTROYED! 
    /newif (@Reply==1) /echo Auto-replying if given a tell. 
    /newif (${Defined[ReplyMessage]}==TRUE) /echo Reply message: @ReplyMessage 
    /newif (${Defined[SkillAlert]}==TRUE) /echo Alerting and exiting macro when skill reaches 200. 

| Skip to combine if flag is set 
    /newif (@Skip==1) /goto :Combine 

:MainLoop 

/doevents 

| Walk to the Short Beer vendor. 
| -------------------------------------------------------------------------------- 
    /call PlayFunction "to_short_beer 1 cf nopp noz" 
    /call WaitTilThere 

| Buy the short beers. Two stacks. 
| -------------------------------------------------------------------------------- 
    /target Bilkel 

    /click right target 
    /delay 2s 

    /mouseto 40 60
    /click left
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s

    /keypress esc 
    /keypress esc 


| Walk to Cask, Malt, Yeast merchant 
| -------------------------------------------------------------------------------- 
    /call PlayFunction "short_beer_to_cask_malt_yeast 1 cf nopp noz" 
    /call WaitTilThere 

| Buy the Cask, Malt, and Yeast 
| -------------------------------------------------------------------------------- 
    /target Lander 

    /click right target 
    /delay 2s 

    | Buy the Casks 
    /mouseto 80 220
    /click left
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s

    | Buy the Malts 
    /mouseto 80 100
    /click left
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s

    | Buy the Yeast 
    /mouseto 40 140
    /click left
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s

    /keypress esc 
    /keypress esc 


| Walk to water merchant 
| -------------------------------------------------------------------------------- 
    /call PlayFunction "cask_malt_yeast_to_water 1 cf nopp noz" 
    /call WaitTilThere 

| Buy Water Flasks 
| -------------------------------------------------------------------------------- 
    /target Sanderson 

    /click right target 
    /delay 2s 

    /mouseto 80 150
    /click left
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s
    /buyitem 20
    /delay 2s

    /keypress esc 
    /keypress esc 


| Walk to barrel and do combines 
| -------------------------------------------------------------------------------- 
    /call PlayFunction "water_to_barrel 1 cf nopp noz" 
    /call WaitTilThere 

    :Combine 
    /call DoCombine @Destroy 


| Walk to starting point 
| -------------------------------------------------------------------------------- 
    /call PlayFunction "barrel_to_start 1 cf nopp noz" 
    /call WaitTilThere 

/goto :MainLoop 
/return 

Sub WaitTilThere 
    :LoopTilThere 

    /newif (@PathingFlag==1) { 
        /call AdvPathPoll 
        /delay 0 
        /doevents 
        /goto :LoopTilThere 
    } 
/return 

Sub DoCombine(Destroy) 
    /declare Counter local 

    /itemtarget Brew Barrel 
    /face item 
    /click left item 
    /delay 2s 
    /mouseto 680 120
    /click left
    /delay 2s

    /doevents 

    | Open up entire inventory 
    /keypress i 
    /for Counter 0 to 7 
        /delay 2 
        /click right inventory @Counter 
    /next Counter 

    :MakeBrew 

        /if (${FindItem[Water].InvSlot}==NULL) /goto :Done 
        /delay 2 
        /ctrl /itemnotify ${FindItem[=Water Flask].InvSlot} leftmouseup
        /delay 2 
        /click left enviro 0 
        /delay 5 

        /if (${FindItem[Water].InvSlot}==NULL) /goto :Done 
        /delay 2 
        /ctrl /itemnotify ${FindItem[=Water Flask].InvSlot} leftmouseup
        /delay 2 
        /click left enviro 1 
        /delay 5 

        /if (${FindItem[Short].InvSlot}==NULL) /goto :Done 
        /delay 2 
	/ctrl /itemnotify ${FindItem[Short].InvSlot} leftmouseup
        /delay 2 
        /click left enviro 2 
        /delay 5 

        /if (${FindItem[Short].InvSlot}==NULL) /goto :Done 
        /delay 2 
	/ctrl /itemnotify ${FindItem[Short].InvSlot} leftmouseup
        /delay 2 
        /click left enviro 3 
        /delay 5 

        /if (${FindItem[Malt].InvSlot}==NULL) /goto :Done 
        /delay 2 
	/ctrl /itemnotify ${FindItem[Malt].InvSlot} leftmouseup
        /delay 2 
        /click left enviro 4 
        /delay 5 

        /if (${FindItem[Malt].InvSlot}==NULL) /goto :Done 
        /delay 2 
	/ctrl /itemnotify ${FindItem[Malt].InvSlot} leftmouseup
        /delay 2 
        /click left enviro 5 
        /delay 5 

        /if (${FindItem[Malt].InvSlot}==NULL) /goto :Done 
        /delay 2 
	/ctrl /itemnotify ${FindItem[Malt].InvSlot} leftmouseup
        /delay 2 
        /click left enviro 6 
        /delay 5 

        /if (${FindItem[Yeast].InvSlot}==NULL) /goto :Done 
        /delay 2 
	/ctrl /itemnotify ${FindItem[Yeast].InvSlot} leftmouseup
        /delay 2 
        /click left enviro 7 
        /delay 5 

        /if (${FindItem[Cask].InvSlot}==NULL) /goto :Done 
        /delay 2 
	/ctrl /itemnotify ${FindItem[Cask].InvSlot} leftmouseup
        /delay 2 
        /click left enviro 8 
        /delay 5 

        /click left enviro combine 
        /delay 5 

        /doevents 

    | Empty cursor 
    :WaitCombine 
        /if (!${Cursor.ID}) /goto :WaitCombine 

    :ClearCursor 
        /newif (@Destroy==1) { 
            /destroy 
        } else { 
            /autoinventory 
        } 
        /delay 5 

        /if (!${Cursor.ID}) { 
            /goto :MakeBrew 
        } 

        /goto :ClearCursor 

    :Done 

        /click left enviro done 

        /for Counter 1 to 9 
            /keypress esc 
        /next Counter 
/return 

Sub Event_SkillUp 
    /echo Your skill has increased to $char(skill,"Brewing") 
/return 

Sub Event_InUse 
    /echo Container busy.  Retrying in 3 seconds... 
    /delay 3s 
    /call DoCombine @Destroy 
/return 

Sub Event_Chat(ChatType,Sender,ChatText)
    /return
    
    /newif ("@Sender"~~"Bilkel") /return 
    /newif ("@Sender"~~"Lander") /return 
    /newif ("@Sender"~~"Sanderson") /return 
    /newif ("@Sender"~~"Merchant") /return 

    /beep 

    /newif (@TellReply==1) { 
        /reply @TellReplyMessage 
    } else { 
        /echo Received a tell!  Pausing macro! 
        /echo Type /mqpause to resume. 

        /press down down 

        /mqpause 
    } 
/return
As you can see I have taken out some of the code that I can not figure out how to convert.

Part 1 that I have not converted:

Code: Select all

Sub ClearContainer(Destroy) 

    /declare Counter local 

    /sendkey down shift 

    /for Counter 0 to 9 
        /click left enviro @Counter 
        /delay 2 
        /if n @Destroy!=1 { 
            /autoinventory 
        } else { 
            /destroy 
        } 
        /delay 2 
    /next Counter 

    /sendkey up shift 

/return
Part 2 that I have not converted yet:

Code: Select all

Sub GMCheck 
    /declare Counter local 

    /if $gm=="TRUE" { 
        /echo GM in zone!!! Camping! 

        /beep 
        /beep 
        /beep 

        /press down down 

        /for Counter 0 to 9 
            /press esc 
        /next Counter 

        /if $char(state)!="SIT" /sit 
        /camp 
        /endmacro 
    } 
/return
As you can see part 1 is the code that goes through everyslot of the brew barrel and SHIFT clicks every spot and deletes anything in those spots.

Part 2 is a simple GM check, but again it is LATE!!!

NOW as you can see everything that is bought from merchants is done with mouse LOC. YOUR WILL BE DIFFERENT! So what I suggest is to make a little test macro so you can see where your item LOC's are!

So if anyone wants to post fixes or updates, PLEASE DO! :)
ROBDAWG

[url=http://www.seathound.com]Seat Hound[/url]
[url=http://www.sportsrumormill.com]Sports Rumor Mill[/url]
[url=http://www.packerforum.com]Packer Forum[/url]