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

