Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.

skorli said:Replace that line of code with this
Rich (BB code):/if (${Merchant.Open}) /cleanup
Will pretty much just close all the windows you currently have open. Just a slight work around till they have the new merchant window sorted out.
Redbot said:Updated the first post, thanks Skorli!
. maybe after!| buy.inc
| Modified by Twist to buy more than 20 of stackable items
| by: Terramantian
| Thanks to DKAA
Sub Buy(string Name, int Quantity)
/declare ListPosition int local
/varset ListPosition ${Window[MerchantWnd].Child[ItemList].List[=${Name},2]}
/if (!${ListPosition}) {
/echo ERROR: Could not find ${Name}.
/return
} else {
/notify MerchantWnd ItemList listselect ${ListPosition}
/delay 2
/notify MerchantWnd ItemList leftmouse ${ListPosition}
/delay 2
}
/delay 5 (${Window[MerchantWnd].Child[MW_SelectedItemLabel].Text.Equal[${Name}]})
/if (!${Window[MerchantWnd].Child[MW_SelectedItemLabel].Text.Equal[${Name}]}) {
/echo ERROR: Selection Error
/return
}
:CheckQuantity
/if ( ${Quantity} > 20 ) {
/buyitem 20
/varcalc Quantity ${Quantity} - 20
/delay 5
/goto :CheckQuantity
} | if
/if ( ${Quantity} > 0 ) {
/buyitem ${Quantity}
} | if
/return
| - idiot.mac -
| By: Onezero
| Version: 0.0.2
| Adapted to MQ2 by Zornecro, 10/10/2004
| Profit finding logic Created by dstern
|
| This macro goes through the list of traders in the zone and checks
| them all for profit exploits. (E.g, they are idiot sellers.) It will
| check all traders in the zone once, then end. No pathing needed,
| it uses the bad and wrong, but oh so good /megawarp.
|
| Usage: /mac idiot
| This can get you BANNED! You have been warned. It requires the use of the MEGAWARP plugin
| and players seeing you pop all over the zone may inspire them to do a
| /petition or /report. But I think the risk is low as everyone lags there,
| so popping around is normal to see. The bigger risk is people sending you tells
| "Were you looking for something specific?"
#turbo 40
#define DEBUG_1 /echo
#define DEBUG_2 /echo
#include common\buy.inc
|PoK has 143 merchants. Make the number below bigger if you find a zone with more than 200.
|Since we want to dumpster dive all TRADERS, there can be up to 600.
#define MAX_MERCH 600
|If you think delays will help avoid you getting petitioned, set this to how many seconds.
|It will wait at least this long, up to twice as long at random.
#define PARANOIA 3
Sub Main
/declare counter int local 1
/declare idcount int local 0
/declare ids[MAX_MERCH] int local 0
/declare curID int local 0
/keepkeys off
/popup Searching all of ${Zone} for Traders...
| Go through LastSpawn[n] until we get no more or fill up.
:nextTrader
/varset curID ${LastSpawn[${counter}].ID}
/if (${Spawn[${curID}].Trader}) {
/varcalc idcount ${idcount}+1
/varset ids[${idcount}] ${curID}
} else {
/if (${curID}==0) /goto :nextMerch
}
/varcalc counter ${counter}+1
/if (${idcount}<MAX_MERCH) /goto :nextTrader
:nextMerch
/popup Checking ${idcount} Traders for idiot prices now...
DEBUG_1 Got ${idcount} Traders to check.
/for counter 1 to ${idcount}
/varset curID ${ids[${counter}]}
/target trader id ${curID}
/delay 1s (${Target.ID}!=0)
/if (${Target.Trader}) {
DEBUG_1 Heading to ${Spawn[${curID}].CleanName}
/call movetomerch "${Target.CleanName}"
/click right target
/delay 10s ${Merchant.Open}
|Only buy things at least 8.5% worth of profit (below)
/call TraderDive 8.5
|We're done buying now.
/if (${Merchant.Open}) /notify /windowstate MerchantWnd close
/if (PARANOIA) {
/delay PARANOIAs
/delay ${Math.Rand[PARANOIA]}s
}
} else {
DEBUG_2 Trader ID ${curID} went away!
}
/next counter
/echo Looks like we're done after checking ${idcount} Traders.
/return
Sub movetomerch(string mobname)
/face fast nolook
/squelch /warp target
/delay 6s ${Target.Distance}<20
/face fast nolook
/delay 1
/keypress back hold
/delay 1
/keypress forward
/if (${Target.ID}==0) /target trader "${mobname}"
/face fast nolook
/delay 3
/return
|**
Created by dstern
Made into sub by Zornecro 10/25/04
How To Run: target a trader/npc; open up the merchant window; /call TraderDive 10
The second parameter is MINIMUM acceptable profit. (10% in the example.)
You will either get nothing returned besides the "macro ended" message, or your computer
will beep, and will return a message saying that "You can make x.yyy PP on item."
It then will buy up to 100 of these if possible.
Have fun with this, and you can probably figure out ways to automate this process.
Zornecro did!
Oh! And happy farming PP!!!
**|
Sub TraderDive(float percentNeeded)
/declare priceToBuy int local
/declare priceToSell int local
/declare profit int local
/declare profitPc float local
/declare iteration int local
/declare totalItems int local ${Merchant.Items}
/if (${totalItems}<1) /return
/varcalc percentNeeded 1.0+${Math.Calc[${percentNeeded}/100]}
/for iteration 1 to ${totalItems}
/if (${Merchant.Open}&&(${iteration}<=${totalItems})) {
/varset priceToBuy ${Merchant.Item[${iteration}].BuyPrice}
/varset priceToSell ${Merchant.Item[${iteration}].Value}
/varcalc profit ${priceToSell}-${priceToBuy}
|Ignore items that profit less than 1pp regardless.
/if (${profit}>1000) {
/varcalc profitPc ${Math.Calc[${priceToSell}/${priceToBuy}]}
/if (${profitPc}>=${percentNeeded}) {
DEBUG_1 You can resell ${Merchant.Item[${iteration}].Name} at ${Math.Calc[${profitPc}*100.0].Int}% buying price.
|/mqpause
/popup Buying ${Merchant.Item[${iteration}].Name} from ${Merchant.Name}
/call buy "${Merchant.Item[${iteration}]}" 20
} else {
DEBUG_2 Profit on ${Merchant.Item[${iteration}]} was ${profit} but only ${Math.Calc[${profitPc}*100.0].Int}%
|/mqpause
}
}
}
/next iteration
/return

