sub main
/declare druid string outer druid
/autoaccept add druid
| tradin.mac, by amml
| modified by tms
| full automation added by fuzzymelon
| Buy function courtesy of RedGuides.com
:top
| *** Increase the destroydelay ONE by ONE until every item on your cursor gets destroyed.
/declare destroydelay int local 1
/declare chips int local
/declare done int local 0
/echo Opening Bags
/keypress OPEN_INV_BAGS
/delay 5
/target clear
/target Gunlok Jure
/delay 5
/face fast
/if (${Target.Type.Equal[npc]}) {
/if (${Me.Grouped}) {
/echo You are grouped - Disbanding
/bct druid //keypress ctrl+d
}
:Loop
/if (!${FindItem[=Bone Chips].InvSlot}) {
/echo backpacks empty go get more stuff
/goto :EmptyBags
}
/if (!${FindItem[=Bone Chips].InvSlot}) /goto :EmptyBags
/echo Handing in Chips.
/for chips 1 to 4
/shift /itemnotify ${FindItem[=Bone Chips].InvSlot} leftmouseup
/delay 5
/click left target
/click left target
/delay 5
/next chips
/delay 8
/notify GiveWnd GVW_Give_Button leftmouseup
/delay 2s
/echo Clearing Cursor
:cursorclear
/if (${Cursor.ID} && ${Cursor.ID} != 13073) {
/destroy
/delay ${destroydelay}
/goto :cursorclear
}
/if (!${FindItem[=Bone Chips].InvSlot}) /goto :EmptyBags
/goto :Loop
:EmptyBags
/if (!${done}) {
/varset done 1
/goto :cursorclear
}
/echo Clearing up your bags, this will take a moment.
/delay 8
/while (${FindItem[=Rusty Axe].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Axe].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Rusty Broad Sword].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Broad Sword].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Rusty Mace].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Mace].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Rusty Short Sword].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Short Sword].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Rusty Two Handed Sword].InvSlot}) {
/shift /itemnotify ${FindItem[=Rusty Two Handed Sword].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Lantern].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Lantern].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Tattered Gloves].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Tattered Gloves].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Torch].InvSlot}) {
/shift /itemnotify ${FindItem[=Torch].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Patchwork Tunic].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Patchwork Tunic].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Tattered Skullcap].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Tattered Skullcap].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Patchwork Sleeves].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Patchwork Sleeves].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
/while (${FindItem[=Small Patchwork Pants].InvSlot}) {
/shift /itemnotify ${FindItem[=Small Patchwork Pants].InvSlot} leftmouseup
/delay 5
/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
/delay ${destroydelay}
}
:Done
/delay 8
/notify GiveWnd GVW_Give_Button leftmouseup
/delay 8
/echo Closing Bags
/keypress CLOSE_INV_BAGS
/echo Done .. Have fun..
/goto :port
} else {
/delay 2s
/goto :top
}
:port
/target clear
/target ${druid}
/if (${Target.Type.Equal[pc]}) {
/bct ${druid} //invite ${Me.Name}
/delay 5s
/bct ${druid} //cast "Brell's Rest Portal"
/delay 60s
/goto :buy
} else {
/delay 2s
/goto :port
}
:buy
/target clear
/target "Marie Fay"
/if (${Target.Type.Equal[npc]}) {
/navigate target
/delay 30s
/face fast
/delay 5
/call npc "Marie Fay"
/call Buy "bone chips" 26000
/goto :bind
} else {
/delay 2s
/goto :buy
}
:bind
/target clear
/target ${druid}
/if (${Target.Type.Equal[pc]}) {
/navigate target
/delay 30s
/bct ${druid} //alt activate 7009
|/bct ${druid} //cast Teleport
/delay 60s
/goto :top
} else {
/delay 2s
/goto :bind
}
/goto :top
/return
Sub NPC(NPCName)
/target npc ${NPCName}
/delay 1s
/if (!${Select[${Target.Type},npc,pet]} || !${Target.ID} || ${Target.Type.Equal[pet]} && !${Target.CleanName.Find[familiar]}) {
/echo Please target a vendor or guildbanker
/return
}
/echo Doing business with ${NPCName}
/target id ${Spawn[${NPCName}].ID}
/delay 3s ${Target.ID}==${Spawn[${NPCName}].ID}
/if (${Target.Distance}>15) {
/moveto id ${Spawn[${NPCName}].ID}
/delay 250 ${MoveTo.Stopped}
}
/face nolook
/delay 1s
/echo Opening merchant/guildbank window
/nomodkey /click right target
/echo Waiting 5s for merchant/guildbank window to populate
/delay 5s
/return
Sub Buy(string ItemToBuy, int amount)
/declare i int local
| /echo Buying ${ItemToBuy}!
/declare QTY int local
/declare ListItem int local
/varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]}
/delay 1s
/if (${FindItemCount[${ItemToBuy}]}>= ${amount}) {
/echo I have enough ${ItemToBuy}.
/return
}
/varset ListItem ${Window[MerchantWnd].Child[ItemList].List[=${ItemToBuy},2]}
/if (!${ListItem}) {
/echo couldn't find ${ItemToBuy}
/return
} else {
/notify MerchantWnd ItemList listselect ${ListItem}
/delay 1s
}
/echo Buying ${ItemToBuy} Till I get ${amount}
:BuyLoop
/doevents
/if (${InventoryFull}) /return
/if (${QTY}>0) {
/if (${QTY}>19) {
/Shiftkey /notify merchantwnd MW_Buy_Button leftmouseup
/delay 1s ${FindItemCount[${ItemToBuy}]}>=${QTY}
/echo ${FindItemCount[${ItemToBuy}]} ${ItemToBuy} in inventory
/varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]}
/delay 3
/if (${QTY}<=0) /return
/goto :BuyLoop
}
/if (${QTY}>0 && ${QTY}<20) {
/for i 1 to ${QTY}
/Ctrlkey /notify merchantwnd MW_Buy_Button leftmouseup
/delay 1s ${FindItemCount[${ItemToBuy}]}>=${Math.Calc[${FindItemCount[${ItemToBuy}]}+${i}]}
/echo Buying ${ItemToBuy} ${i} of ${QTY}
/if (${i}>=${QTY}) {
/echo ${FindItemCount[${ItemToBuy}]} ${ItemToBuy} in inventory
/return
}
/next i
/varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]}
}
}
/return