dye.mac. Make Vials of Prismatic Dye - 7.4.04

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

EQBot_man
a ghoul
a ghoul
Posts: 111
Joined: Mon May 17, 2004 6:35 pm

dye.mac. Make Vials of Prismatic Dye - 7.4.04

Post by EQBot_man » Sun Jul 04, 2004 5:43 pm

This Macro will Continually make you Vials of Prismatic Dye until you run out of money. Read header of macro:

Code: Select all

| dye.mac
|	By: EQBot_Man 7.4.04
|
| Syntax:   /Macro dye
|
|	Move your character to Gunthak with like 5000pp on him/her and put him/her
|		in front of the merchant where you buy everything from.
|
| Your Character will makes you Vials of Prismatic Dye until you run out of money.
| So make sure you have plenty of space for the amount of money you have
| I suggest putting 5000pp and having 2 bags empty.
|

Event create "You have fashioned#*#"
#Event faildye "You lacked the skills#*#"
#Event nomore "#*#you don't have everything you need for this recipe#*#"
#Event NoMoney "#*#you can't afford to buy#*#"

#include move.inc

Sub Main
/deletevar finish
/deletevar failure

/declare finish int global
/declare failure int global

/varset failure 0
/varset finish 0

|/call GMCheck
|/call GunthakToBanker
|/call GetMoney
|/call MoveToMerchantAfterBank


:MainLoop
/call BuyFromMerchant
/varset failure 0
/call GMCheck
/call OpenKiln
/call CombineKiln
/call GMCheck
/call OpenBrew1
/call Combinebrew1
/call OpenBrew2
/call Combinebrew2
/call GMCheck
/call MoveToMerchantAfterCombines

/goto :Mainloop
/return
|------------------------------
Sub OpenBrew1
/call MoveToLoc 1411 -64
/call MoveToLoc 1621 -88
/itemtarget brew
/face fast
/click left item
/delay 2s
/notify COMBW_RecipeListArea COMBW_RecipeList listselect ${Window[COMBW_RecipeListArea].Child[COMBW_RecipeList].List[=Prismatic Dye]}
/return
|------------------------------------
Sub Combinebrew1
:CombineLoop
/notify COMBW_CombineArea COMBW_CombineButton leftmouseup
/delay 5
/autoinventory
/doevents
/if (${finish}==1) {
	/varset finish 0
	/return
}
/goto :CombineLoop

/return
|------------------------------
Sub Event_nomore

/varset finish 1
/return
|------------------------------
Sub Event_fail

/varset create 2
/return
|----------------------------
Sub GunthakToBanker

/call MoveToLoc 1606 -942
/call MoveToLoc 1459 -933
/call MoveToLoc 1465 -425
/call MoveToLoc 1342 -184
/call MoveToLoc 1452 -160
/call MoveToLoc 1479.5 -279


/return
|-------------------------------------
Sub GetMoney
/target bido
/face
/click right target
/delay 2
/notify BigBankWnd BIGB_Money0 leftmouseup
/delay 10s
/autoinventory
/return
|--------------------------------------
Sub MoveToMerchantAfterBank
/call MoveToLoc 1518 -242
/return
|------------------------------------------
Sub MoveToMerchantAfterCombines
/call MoveToLoc 1463 -156
/call MoveToLoc 1452 -196
/call MoveToLoc 1518 -242


/return
|----------------------------------------
Sub BuyFromMerchant
/target cada
/face fast
/click right target
/delay 2s
/itemnotify Merchant1 leftmouseup
/delay 1s
/buyitem 20
/delay 1s
/doevents
/itemnotify Merchant2 leftmouseup
/delay 1s
/buyitem 20
/delay 1s
/doevents
/itemnotify Merchant3 leftmouseup
/delay 1s
/buyitem 20
/delay 1s
/doevents
/itemnotify Merchant4 leftmouseup
/delay 1s
/buyitem 20
/delay 1s
/doevents
/return
|-----------------------------------------
Sub OpenKiln
/call MoveToLoc 1452 -170
/call MoveToLoc 1427 3
/call MoveToLoc 1441 156
/itemtarget kiln
/face fast
/click left item

/delay 2s
/notify COMBW_RecipeListArea COMBW_RecipeList listselect ${Window[COMBW_RecipeListArea].Child[COMBW_RecipeList].List[=Dye Vial]}
/return
|------------------------------------
Sub CombineKiln
:CombineLoop
/notify COMBW_CombineArea COMBW_CombineButton leftmouseup
/delay 5
/autoinventory
/doevents
/if (${finish}==1) {
	/varset finish 0
	/return
}
/goto :CombineLoop

/return
|------------------------------
Sub OpenBrew2
/notify COMBW_RecipeListArea COMBW_RecipeList listselect ${Window[COMBW_RecipeListArea].Child[COMBW_RecipeList].List[=A Vial of Prismatic Dye]}

/return
|------------------------------------

Sub Combinebrew2
:CombineLoop
/notify COMBW_CombineArea COMBW_CombineButton leftmouseup
/delay 5
/autoinventory
/doevents
/if (${finish}==1) {
	/varset finish 0
	/return
}
/goto :CombineLoop

/return
|------------------------------------
Sub GMCheck

   /if (${Spawn[gm].ID}) {
      /beep
      /beep
      /beep

      /echo GM has entered the zone! ..

      /keypress forward
      /keypress back


      /endmacro
   }

/return
|----------------------------------
Sub Event_fail
/varcalc failure ${failure}+1
/return
|----------------------------------
Sub Event_NoMoney
/echo You are out of Money. Ending Macro. . .
/endmacro
/return




And you'll need move.inc:


Code: Select all

|===================================================|
|- move.inc                                         |
|                                                   |
|Simple moving and object-avoidance routines        |
|                                                   |
|Originally by beatnik007 (Who credits Mckorr)      |
|                                                   |
|Revised and converted to MQ2Data by Terramantian   |
|						    |
|Improved upon by EQBot_Man   7.4.04		    |
|===================================================|


| Sub MoveToLoc                                     |
|---------------------------------------------------|
|This simply moves the player to within 10 units of |
|the requested location, while avoiding obstacles   |
|                                                   |
|This is beatnik007's original sub, with a few minor|
|changes and rewritten in MQ2Data format            |
|                                                   |
|SYNTAX: /call MoveToLoc Y X                        |


Sub MoveToLoc(MoveToY, MoveToX)
    |/echo Moving to Location: ${MoveToY}, ${MoveToX}.
    |/echo Distance: ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}

    /declare running int local
    /declare MaxSpeed int local
    /declare StopDistance int local
    /declare distanceNow float local
    /declare distanceBefore float local
    /declare distanceModifier int local
    /varset running 0
    /declare distanceTimer timer 15
    /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
    /varset distanceModifier 1
    /varset MaxSpeed 0
    :moveToLocation

	/if (${Me.Speed}>=${MaxSpeed}) /varset MaxSpeed ${Me.Speed}
	/if (${MaxSpeed}<=151) {
		/varset StopDistance 3
	} else {
		/varset StopDistance 10
	}

    /face fast nolook loc ${MoveToY},${MoveToX}

    /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<${StopDistance}) {
        /keypress forward
        /return
    }

    /if (${distanceTimer}==0) {
        /if (${Me.Sneaking}) {
            /varset distanceModifier 2
        } else {
            /varset distanceModifier 1
    	}

        /varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
        /if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
      		/call strafePastObstacle
        }

        /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
        /varset distanceTimer 15
    }

    /if (${running}==0) {
        /keypress forward
        /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>${StopDistance}) {
            /varset running 1
            /keypress forward hold
        }
    } else {
        /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<${StopDistance}) {
            /varset running 0
            /keypress forward
        }
    }
    /goto :moveToLocation
/return


| Sub MoveToSpawn                                   |
|---------------------------------------------------|
|This moves the player to within a provided distance|
|of the provided spawn, while avoiding obstacles    |
|                                                   |
|I "wrote" this, but as you can see, it's the same  |
|as MoveToLoc with a few variable replacements.     |
|                                                   |
|The second parameter, Distance, allows for the     |
|player to stop short of the target by a certain    |
|amount, to provide for different aggro radii, etc. |
|                                                   |
|SYNTAX: /call MoveToSpawn ID Distance              |

Sub MoveToSpawn(MoveToID, StopDistance)

    /if (!(${Defined[MoveToID]})||(${Spawn[MoveToID].ID})) {
        /echo Spawn ID not found or no ID provided. Aborting...
        /return
    }
    /if (!(${Defined[StopDistance]})) {
   /echo Stopping point not defined, using default distance of 70
        /declare StopDistance int local
        /varset StopDistance 70
    }

    /echo Moving to Spawn: ${MoveToID} (${Spawn[${MoveToID}].CleanName}).
    /echo Current Location: ${Spawn[${MoveToID}].Y}, ${Spawn[${MoveToID}].X}
    /echo Current Distance: ${Spawn[${MoveToID}].Distance}

    /declare running int local
    /declare distanceNow float local
    /declare distanceBefore float local
    /declare distanceModifier int local
    /varset running 0
    /declare distanceTimer timer 15
    /varset distanceBefore ${Spawn[${MoveToID}].Distance}
    /varset distanceModifier 1

    :moveToSpawn

    /squelch /face fast nolook id ${MoveToID}

    /if (${Spawn[${MoveToID}].Distance}<${StopDistance}) {
        /keypress forward
        /return
    }

    /if (${distanceTimer}==0) {
        /if (${Me.Sneaking}) {
            /varset distanceModifier 2
        } else {
            /varset distanceModifier 1
        }

        /varset distanceNow ${Spawn[${MoveToID}].Distance}
        /if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
      /call strafePastObstacle
        }
        /varset distanceBefore ${Spawn[${MoveToID}].Distance}
        /varset distanceTimer 15
    }

    /if (${running}==0) {
        /keypress forward
        /if (${Spawn[${MoveToID}].Distance}>=${StopDistance}) {
            /varset running 1
            /keypress forward hold
        }
    } else {
        /if (${Spawn[${MoveToID}].Distance}<${StopDistance}) {
            /varset running 0
            /keypress forward
        }
    }
    /goto :moveToSpawn
/return

| Only to be used by the previous functions - It's obvious what it does. |

sub strafePastObstacle
    /keypress forward
    /keypress back hold
    /delay 2
    /keypress back
    /if (${Math.Rand[99]}>50) {
        /keypress strafe_right hold
    } else {
        /keypress strafe_left hold
    }
    /delay 5
    /keypress strafe_right
    /keypress strafe_left
    /keypress forward hold
/return

Sub Turn(THeadingY,THeadingX)
   /declare PHeading outer 0
   /declare THeading outer 0
   /declare Bearing outer 0
   /declare IsTurning outer 0
   /declare TurnKey outer NULL

:TurnLoop
   /delay 0
   /if (${Me.Sitting}) /sit off
   /varset PHeading ${Me.Heading.Degrees}
   /if (${Defined[THeadingX]}) {
      /varset THeading ${Heading[${THeadingY},${THeadingX}].Degrees}
   } else {
      /varset THeading ${Target.HeadingTo.Degrees}
   }

   /varset Bearing ${Math.Calc[(${PHeading}-${THeading}+540)%360-180]}

   /if (${Bearing}>=-7 && ${Bearing}<=7) {
      /if (${String[${TurnKey}].NotEqual[NULL]}) /keypress ${TurnKey}
      /face heading ${Heading[${THeading}].Degrees} nolook
      /return
   } else /if (${Bearing}>=-180 && ${Bearing}>=7) {
      /if (${String[${TurnKey}].NotEqual[LEFT]}) /varset TurnKey LEFT
   } else /if (${Bearing}<=180 && ${Bearing}<=7) {
      /if (${String[${TurnKey}].NotEqual[RIGHT]}) /varset TurnKey RIGHT
   }

   /if (!${IsTurning}) {
      /keypress ${TurnKey} hold
      /varset IsTurning 1
   }
   /goto :TurnLoop

/return

Hamner
a lesser mummy
a lesser mummy
Posts: 47
Joined: Wed Aug 04, 2004 9:30 am

Post by Hamner » Sun Mar 19, 2006 11:44 pm

Anyone interested in updating this? Im not a coder, but have made what changes I can...the move.inc seems to be ok, but am getting errors. Which I can detail if needed.
| dye.mac
| By: EQBot_Man 7.4.04
|
| Syntax: /Macro dye
|
| Move your character to Gunthak with like 5000pp on him/her and put him/her
| in front of the merchant where you buy everything from.
|
| Your Character will makes you Vials of Prismatic Dye until you run out of money.
| So make sure you have plenty of space for the amount of money you have
| I suggest putting 5000pp and having 2 bags empty.
|

Event create "You have fashioned#*#"
#Event faildye "You lacked the skills#*#"
#Event nomore "#*#you don't have everything you need for this recipe#*#"
#Event NoMoney "#*#you can't afford to buy#*#"

#include move.inc

Sub Main
/deletevar finish
/deletevar failure

/declare finish int global
/declare failure int global

/varset failure 0
/varset finish 0

|/call GMCheck
|/call GunthakToBanker
|/call GetMoney
|/call MoveToMerchantAfterBank


:MainLoop
/call BuyFromMerchant
/varset failure 0
/call GMCheck
/call OpenKiln
/call CombineKiln
/call GMCheck
/call OpenBrew1
/call Combinebrew1
/call OpenBrew2
/call Combinebrew2
/call GMCheck
/call MoveToMerchantAfterCombines

/goto :Mainloop
/return
|------------------------------
Sub OpenBrew1
/call MoveToLoc 1411 -64
/call MoveToLoc 1621 -88
/itemtarget brew
/face fast
/click left item
/delay 2s
/notify COMBW_RecipeListArea COMBW_RecipeList listselect ${Window[COMBW_RecipeListArea].Child[COMBW_RecipeList].List[=Prismatic Dye]}
/return
|------------------------------------
Sub Combinebrew1
:CombineLoop
/notify TradeskillWnd CombineButton leftmouseup
/delay 5
/autoinventory
/doevents
/if (${finish}==1) {
/varset finish 0
/return
}
/goto :CombineLoop

/return
|------------------------------
Sub Event_nomore

/varset finish 1
/return
|------------------------------
Sub Event_fail

/varset create 2
/return
|----------------------------
Sub GunthakToBanker

/call MoveToLoc 1606 -942
/call MoveToLoc 1459 -933
/call MoveToLoc 1465 -425
/call MoveToLoc 1342 -184
/call MoveToLoc 1452 -160
/call MoveToLoc 1479.5 -279


/return
|-------------------------------------
Sub GetMoney
/target bido
/face
/click right target
/delay 2
/notify BigBankWnd BIGB_Money0 leftmouseup
/delay 10s
/autoinventory
/return
|--------------------------------------
Sub MoveToMerchantAfterBank
/call MoveToLoc 1518 -242
/return
|------------------------------------------
Sub MoveToMerchantAfterCombines
/call MoveToLoc 1463 -156
/call MoveToLoc 1452 -196
/call MoveToLoc 1518 -242


/return
|----------------------------------------
Sub BuyFromMerchant
/target cada
/face fast
/click right target
/delay 2s
/itemnotify Merchant1 leftmouseup
/delay 1s
/buyitem 20
/delay 1s
/doevents
/itemnotify Merchant2 leftmouseup
/delay 1s
/buyitem 20
/delay 1s
/doevents
/itemnotify Merchant3 leftmouseup
/delay 1s
/buyitem 20
/delay 1s
/doevents
/itemnotify Merchant4 leftmouseup
/delay 1s
/buyitem 20
/delay 1s
/doevents
/return
|-----------------------------------------
Sub OpenKiln
/call MoveToLoc 1452 -170
/call MoveToLoc 1427 3
/call MoveToLoc 1441 156
/itemtarget kiln
/face fast
/click left item

/delay 2s
/notify COMBW_RecipeListArea COMBW_RecipeList listselect ${Window[COMBW_RecipeListArea].Child[COMBW_RecipeList].List[=Dye Vial]}
/return
|------------------------------------
Sub CombineKiln
:CombineLoop
/notify TradeskillWnd CombineButton leftmouseup
/delay 5
/autoinventory
/doevents
/if (${finish}==1) {
/varset finish 0
/return
}
/goto :CombineLoop

/return
|------------------------------
Sub OpenBrew2
/notify COMBW_RecipeListArea COMBW_RecipeList listselect ${Window[COMBW_RecipeListArea].Child[COMBW_RecipeList].List[=A Vial of Prismatic Dye]}

/return
|------------------------------------

Sub Combinebrew2
:CombineLoop
/notify TradeskillWnd CombineButton leftmouseup
/delay 5
/autoinventory
/doevents
/if (${finish}==1) {
/varset finish 0
/return
}
/goto :CombineLoop

/return
|------------------------------------
Sub GMCheck

/if (${Spawn[gm].ID}) {
/beep
/beep
/beep

/echo GM has entered the zone! ..

/keypress forward
/keypress back


/endmacro
}

/return
|----------------------------------
Sub Event_fail
/varcalc failure ${failure}+1
/return
|----------------------------------
Sub Event_NoMoney
/echo You are out of Money. Ending Macro. . .
/endmacro
/return

3djoker
a hill giant
a hill giant
Posts: 167
Joined: Thu Jun 24, 2004 11:19 pm

Post by 3djoker » Mon Mar 20, 2006 5:43 pm

what errors you getting. i don't mind trying to help ya figure out whats going on and what needs to be fixed. i'm starting to get into writing my own .mac's myself and would like to try to figure out whats wrong to better my knowledge on this kind of stuff for future .macs.

Hamner
a lesser mummy
a lesser mummy
Posts: 47
Joined: Wed Aug 04, 2004 9:30 am

Post by Hamner » Mon Mar 20, 2006 6:21 pm

Below is the list, doesnt buy anything, also doesnt pick the recipes to make the items, if you dont click them manually, it just sits with no error messages.

Code: Select all

[Mon Mar 20 17:18:13 2006] Could not send notification to merchant1 leftmouseup
[Mon Mar 20 17:18:14 2006] Cadale Brohat says 'Hi there , just browsing?  Have you seen the Fungus Sap I just got in?'
[Mon Mar 20 17:18:15 2006] Could not send notification to merchant2 leftmouseup
[Mon Mar 20 17:18:17 2006] Could not send notification to merchant3 leftmouseup
[Mon Mar 20 17:18:19 2006] Could not send notification to merchant4 leftmouseup
[Mon Mar 20 17:18:30 2006] Item 'Kiln' targeted.
[Mon Mar 20 17:18:30 2006] There were no matches for: (0-100) any
[Mon Mar 20 17:18:30 2006] dye.mac@154 (OpenKiln): /face fast
[Mon Mar 20 17:18:30 2006] dye.mac@41 (Main): /call OpenKiln
[Mon Mar 20 17:18:31 2006] Requesting favorite recipes...
[Mon Mar 20 17:18:35 2006] Sorry, but you don't have everything you need for this recipe in your general inventory.
[Mon Mar 20 17:18:35 2006] You are missing a Quality Firing Sheet.
[Mon Mar 20 17:18:35 2006] You are missing a Unfired Dye Vial.
[Mon Mar 20 17:18:45 2006] Item 'Brew Barrel' targeted.
[Mon Mar 20 17:18:45 2006] There were no matches for: (0-100) any
[Mon Mar 20 17:18:45 2006] dye.mac@58 (OpenBrew1): /face fast
[Mon Mar 20 17:18:45 2006] dye.mac@44 (Main): /call OpenBrew1
[Mon Mar 20 17:18:45 2006] Requesting favorite recipes...
[Mon Mar 20 17:18:48 2006] Sorry, but you don't have everything you need for this recipe in your general inventory.
[Mon Mar 20 17:18:48 2006] You are missing a Dye Vial.
[Mon Mar 20 17:18:48 2006] You are missing a Prismatic Dye.
[Mon Mar 20 17:18:51 2006] Sorry, but you don't have everything you need for this recipe in your general inventory.
[Mon Mar 20 17:18:51 2006] You are missing a Dye Vial.
[Mon Mar 20 17:18:51 2006] You are missing a Prismatic Dye.
[Mon Mar 20 17:18:59 2006] Could not send notification to merchant1 leftmouseup
[Mon Mar 20 17:18:59 2006] Cadale Brohat says 'Greetings, . You look like you could use a Human Blood.'
[Mon Mar 20 17:19:01 2006] Could not send notification to merchant2 leftmouseup
[Mon Mar 20 17:19:03 2006] Could not send notification to merchant3 leftmouseup
[Mon Mar 20 17:19:05 2006] Could not send notification to merchant4 leftmouseup
[Mon Mar 20 17:19:09 2006] The current macro has ended.