Moderator: MacroQuest Developers
Code: Select all
| Name:
| -----
| Forage.mac
|
| Authors:
| --------
| GrimJack, Kagonis
|
| Description:
| ------------
| This forage macro is optimized for druids (or rangers) that
| have the AA called Innate Camouflage.
|
| The following variables can be changed to suit your needs:
| /varset DestroyX <int> = The X position of your destroy
| button, since this is not working correct at the moment.
| /varset DestroyY <int> = The Y position of your destroy
| button, since this is not working correct at the moment.
| /varset UseCamo <TRUE|FALSE> = Use Innate Camouflage AA
| between forages? Good for foraging places where there are
| roamers.
| /varset DefKeep <TRUE|FALSE> = Keep or Destroy the items
| listed in the array, per default, ie:
| - /varset DefKeep TRUE : If you wish to keep the items
| listed in the array, and destroy the rest (risky: read warning).
| - /varset DefKeep FALSE : If you wish to destroy the items
| listed in the array, and keep the rest (safest: read warning).
|
| To add new items that you wish to keep or destroy, to your array
| you simply add a new line like these:
| /varset a(1,0) "Roots"
| /varset a(1,1) "Tuft of Dire Wolf Fur"
| /varset a(1,2) "Dragon Egg"
|
| Remember to update the ArraySize accordingly to the number of
| items in your array:
| /varset ArraySize 3
|
| ** WARNING WARNING **
| If you decide to use the KEEP list, then you will have to make
| sure that you don't put something on your cursor that you would
| not risk to loose.
| ** WARNING WARNING **
#define LoopCount v40
#define ArraySize v41
#define MouseX v42
#define MouseY v43
#define DestroyX v44
#define DestroyY v45
#define DefKeep v46
#define UseCamo v47
sub Main
/varset a(1,0) "Roots"
/varset a(1,1) "Tuft of Dire Wolf Fur"
/varset a(1,2) "Dragon Egg"
/varset a(1,3) "Drake Egg"
/varset a(1,4) "Wurm Egg"
/varset a(1,5) "Morning Dew"
/varset a)1,6) "Branch of Planar Oak"
/varset ArraySize 7
/varset LoopCount 0
/varset DestroyX 1018
/varset DestroyY 805
/varset UseCamo "FALSE"
/varset DefKeep "TRUE"
/cleanup
:Loop
/varset MouseX $mouse(X)
/varset MouseY $mouse(Y)
/delay 5
/if n $char(ability,"Forage")>0 {
/if "$cursor()"!="NULL" /call ItemSort
/delay 5
/doability forage
/if "$UseCamo"=="TRUE" /alt activate 80
/delay 5
/if "$cursor()"!="NULL" /call ItemSort
}
/goto :Loop
/return
sub ItemSort
:itemchecker
/if "$cursor(name)"~~"$a(1,$LoopCount)" {
/if "$DefKeep"=="TRUE" {
/echo Keeping: << $cursor(name) >>
/click left auto
} else {
/echo Destroying: << $cursor(name) >>
/mouseto $DestroyX $DestroyY
/click left
}
/delay 5
}
/varadd LoopCount 1
/if "$cursor()"!="NULL" {
/if n $LoopCount<$ArraySize /goto :itemchecker
}
/if "$cursor()"!="NULL" {
/if "$DefKeep"=="TRUE" {
/echo Destroying: << $cursor(name) >>
/mouseto $DestroyX $DestroyY
/click left
} else {
/echo Keeping: << $cursor(name) >>
/click left auto
}
/delay 5
}
/mouseto $MouseX $MouseY
/varset LoopCount 0
/returnCode: Select all
#event NoPole "You need to put your fishing pole in your primary hand."
#event NoBait "You can't fish without fishing bait, go buy some."
#event BrokePole "Your fishing pole broke!"
#define LoopCount v40
#define ArraySize v41
#define MouseX v42
#define MouseY v43
#define DestroyX v44
#define DestroyY v45
#define PrimaryX v46
#define PrimaryY v47
#define InvSlot8X v48
#define InvSlot8Y v49
#define UseCamo v50
#define NoBait v51
sub Main
/varset a(1,0) "Roots"
/varset a(1,1) "Tuft of Dire Wolf Fur"
/varset a(1,2) "Dragon Egg"
/varset a(1,3) "Drake Egg"
/varset a(1,4) "Wurm Egg"
/varset a(1,5) "Fresh Fish"
/varset a(1,6) "Cobalt Cod"
/varset a(1,7) "Dragon Bay Snapper"
/varset a(1,8) "Morning Dew"
/varset a(1,9) "Branch of Planar Oak"
/varset ArraySize 10
/varset LoopCount 0
/varset NoBait "FALSE"
/varset UseCamo "FALSE"
/varset DestroyX 1018
/varset DestroyY 805
/varset PrimaryX 836
/varset PrimaryY 725
/varset InvSlot8X 1091
/varset InvSlot8Y 730
/cleanup
/doevents flush
:Loop
/varset MouseX $mouse(X)
/varset MouseY $mouse(Y)
/delay 5
/if n $char(ability,"Forage")>0 {
/if "$cursor()"!="NULL" /call ItemSort
/delay 5
/doability forage
/if "$UseCamo"=="TRUE" /alt activate 80
/delay 5
/if "$cursor()"!="NULL" /call ItemSort
}
/doevents NoBait
/if n $char(ability,fishing)>0 /if "$NoBait"!="TRUE" {
/if "$equip(primary,name)"!="Brell's Fishin' Pole" /call SummonPole
/if "$cursor()"!="NULL" /call ItemSort
/delay 5
/doability fishing
/delay 5
/if "$cursor()"!="NULL" /call ItemSort
}
/goto :Loop
/return
sub ItemSort
:itemchecker
/if "$cursor(name)"~~"$a(1,$LoopCount)" {
/echo Keeping: << $cursor(name) >>
/click left auto
/delay 5
}
/varadd LoopCount 1
/if "$cursor()"!="NULL" {
/if n $LoopCount<$ArraySize /goto :itemchecker
}
/if "$cursor()"!="NULL" {
/echo Destroying: << $cursor(name) >>
/mouseto $DestroyX $DestroyY
/click left
/delay 5
}
/mouseto $MouseX $MouseY
/varset LoopCount 0
/return
sub SummonPole
/mouseto $InvSlot8X $InvSlot8Y
/click right
/delay 11s
/if "$cursor()"!="NULL" /if "$cursor(name)"~~"Brell's Fishin' Pole" {
/mouseto $PrimaryX $PrimaryY
/delay 5
/click left
/delay 5
/if "$cursor()"!="NULL" /click left auto
} else {
/varset NoBait "TRUE"
}
/return
Sub Event_NoPole
/call SummonPole
/return
Sub Event_BrokePole
/call SummonPole
/return
Sub Event_NoBait
/varset NoBait "TRUE"
/returnI would say your question is most likely answered in the post directly above yours. On UI's with titlebars it will miss the destroy button. If it misses the destroy button it will run through the rest of the array (it keeps checking against the next item in the array untill there is nothing on the cursor or nothing left in the array) then decide you want to keep it. To be sure though I would need better information. More accurate information on what the mouse is doing would be helpful. "warps around the screen" doesn't give me much to work with. Where does it warp to the first movement, second movement, ect? Is it the same places every time?Ayla wrote:Whenever I run this macro it tells me "Destroying: xxx" then the mouse warps around the screen a couple of times, then it quickly says "Keeping: xxx" and puts it in my bag, even though I set it up so it's supposed to destroy instead of saving it. Any thoughts?
Code: Select all
|if we catch a rusty dagger destroy it
/if "$cursor(name)"~~"rusty" /click left destroy
|pause briefly to make sure it's destroyed
/delay 1s
|keep everything else
/if $cursor()==TRUE /click left autoCode: Select all
/mouseto $DestroyX $DestroyY
/click left Code: Select all
/click left destroyCode: Select all
| Name:
| -----
| Forage.mac
|
| Authors:
| --------
| GrimJack, Kagonis
|
| Description:
| ------------
| This forage macro is optimized for druids (or rangers) that
| have the AA called Innate Camouflage.
|
| The following variables can be changed to suit your needs:
|
| /varset UseCamo <TRUE|FALSE> = Use Innate Camouflage AA
| between forages? Good for foraging places where there are
| roamers.
| /varset DefKeep <TRUE|FALSE> = Keep or Destroy the items
| listed in the array, per default, ie:
| - /varset DefKeep TRUE : If you wish to keep the items
| listed in the array, and destroy the rest (risky: read warning).
| - /varset DefKeep FALSE : If you wish to destroy the items
| listed in the array, and keep the rest (safest: read warning).
|
| To add new items that you wish to keep or destroy, to your array
| you simply add a new line like these:
| /varset a(1,0) "Roots"
| /varset a(1,1) "Tuft of Dire Wolf Fur"
| /varset a(1,2) "Dragon Egg"
|
| Remember to update the ArraySize accordingly to the number of
| items in your array:
| /varset ArraySize 3
|
| ** WARNING WARNING **
| If you decide to use the KEEP list, then you will have to make
| sure that you don't put something on your cursor that you would
| not risk to loose.
| ** WARNING WARNING **
#define LoopCount v40
#define ArraySize v41
#define MouseX v42
#define MouseY v43
#define DefKeep v46
#define UseCamo v47
sub Main
/varset a(1,0) "Plant Shoot"
/varset a(1,1) "Tuft of Dire Wolf Fur"
/varset a(1,2) "Dragon Egg"
/varset a(1,3) "Drake Egg"
/varset a(1,4) "Wurm Egg"
/varset a(1,5) "Morning Dew"
/varset a(1,6) "Branch of Planar Oak"
/varset ArraySize 7
/varset LoopCount 0
/varset UseCamo "FALSE"
/varset DefKeep "TRUE"
/cleanup
:Loop
/varset MouseX $mouse(X)
/varset MouseY $mouse(Y)
/delay 5
/if n $char(ability,"Forage")>0 {
/if "$cursor()"!="NULL" /call ItemSort
/delay 15
/doability forage
/if "$UseCamo"=="TRUE" /alt activate 80
/delay 15
/if "$cursor()"!="NULL" /call ItemSort
}
/goto :Loop
/return
sub ItemSort
:itemchecker
/if "$cursor(name)"~~"$a(1,$LoopCount)" {
/if "$DefKeep"=="TRUE" {
/click left auto
} else {
/click left destroy
}
/delay 15
}
/varadd LoopCount 1
/if "$cursor()"!="NULL" {
/if n $LoopCount<$ArraySize /goto :itemchecker
}
/if "$cursor()"!="NULL" {
/if "$DefKeep"=="TRUE" {
/click left destroy
} else {
/click left auto
}
/delay 15
}
/mouseto $MouseX $MouseY
/varset LoopCount 0
/return
Code: Select all
| Name:
| -----
| Forage.mac
|
| Authors:
| --------
| GrimJack, Kagonis
|
| Description:
| ------------
| This forage macro is optimized for druids (or rangers) that
| have the AA called Innate Camouflage.
|
| The following variables can be changed to suit your needs:
| /varset DestroyX <int> = The X position of your destroy
| button, since this is not working correct at the moment.
| /varset DestroyY <int> = The Y position of your destroy
| button, since this is not working correct at the moment.
| /varset UseCamo <TRUE|FALSE> = Use Innate Camouflage AA
| between forages? Good for foraging places where there are
| roamers.
| /varset DefKeep <TRUE|FALSE> = Keep or Destroy the items
| listed in the array, per default, ie:
| - /varset DefKeep TRUE : If you wish to keep the items
| listed in the array, and destroy the rest (risky: read warning).
| - /varset DefKeep FALSE : If you wish to destroy the items
| listed in the array, and keep the rest (safest: read warning).
|
| To add new items that you wish to keep or destroy, to your array
| you simply add a new line like these:
| /varset a(1,0) "Roots"
| /varset a(1,1) "Tuft of Dire Wolf Fur"
| /varset a(1,2) "#Egg"
| All items will be EXACT matches, except if it is prepended by a #
| Ie: "Roots" will ONLY match "Roots", and not "Lichen Roots",
| "#Roots" on the other hand will match any item containing "Roots",
| Ie: "#Roots" matches both "Roots" and "Lichen Roots".
|
| Remember to update the ArraySize accordingly to the number of
| items in your array:
| /varset ArraySize 3
|
| ** WARNING WARNING **
| If you decide to use the KEEP list, then you will have to make
| sure that you don't put something on your cursor that you would
| not risk to loose.
| ** WARNING WARNING **
|Enabling #turbo makes the client lag for some reason.
|#turbo
#define LoopCount v1
#define ArraySize v2
#define MousePos v3
#define DefKeep v4
#define UseCamo v5
#define thisItem v6
#define beExact v7
sub Main
/varset a(1,0) "#Egg"
/varset a(1,1) "Tuft of Dire Wolf Fur"
/varset a(1,2) "Roots"
/varset a(1,3) "Morning Dew"
/varset a(1,4) "Branch of Planar Oak"
/varset a(1,5) "Plant Shoot"
/varset ArraySize 6
/varset UseCamo "FALSE"
/varset DefKeep "TRUE"
/cleanup
:Loop
/call doForage
| /if "$cursor()"!="NULL" /call itemSort
/goto :Loop
/return
sub doForage
/if n $char(ability,"Forage")>0 {
/if "$cursor()"!="NULL" /call ItemSort
/delay 5
/doability forage
/if "$UseCamo"=="TRUE" /alt activate 80
/delay 5
/if "$cursor()"!="NULL" /call ItemSort
}
/return
sub itemSort
/varset MousePos "$mouse(X) $mouse(Y)"
/delay 5
/varset LoopCount 0
:itemchecker
/if "$a(1,$LoopCount)"~~"#" {
/varset thisItem "$right($calc($strlen("$a(1,$LoopCount)")-1),"$a(1,$LoopCount)")"
/varset beExact 0
} else {
/varset thisItem "$a(1,$LoopCount)"
/varset beExact 1
}
/if n $beExact==0 /if "$cursor(name)"~~"$thisItem" {
/if "$DefKeep"=="TRUE" {
/echo Keeping: << $cursor(name) >>
/click left auto
} else {
/echo Destroying: << $cursor(name) >>
/click left destroy
}
/delay 5
} else /if n $beExact==1 /if "$cursor(name)"=="$thisItem" {
/if "$DefKeep"=="TRUE" {
/echo Keeping: << $cursor(name) >>
/click left auto
} else {
/echo Destroying: << $cursor(name) >>
/click left destroy
}
/delay 5
}
/varadd LoopCount 1
/if "$cursor()"!="NULL" {
/if n $LoopCount<$ArraySize /goto :itemchecker
}
/if "$cursor()"!="NULL" {
/if "$DefKeep"=="TRUE" {
/echo Destroying: << $cursor(name) >>
/click left destroy
} else {
/echo Keeping: << $cursor(name) >>
/click left auto
}
/delay 5
}
/mouseto $MousePos
/return