javascript:
/* made by Petee (TW-DB.info), all rights except redistribution reserved */
-> in other words, guys, [B]please[/B] don't modify the thing without my permission
var TC = Market.prototype.prepareTraderControl.toString();
-> get the original code
var R = 0;
-> a variable to check how many changes were done
TC = TC.replace(/n *> *1 *&& *false *\? *['"]<tr><td>['"] *\+ *['"][^"]+:['"] *\+/, function(str){R++; return "n>1?'<tr><td>'+'Repeat this sale (*):'+";});
-> bypass the thing devs used to disable the feature, as in the old script; change field description
TC = TC.replace(/id=['"]market_n['"] *value=[(?:\\")'"]{2} *\+ *n *\+ *[(?:\\")'"]{2}/, function(str){R++; return str.replace(/\+ *n *\+/,"+1+");});
-> set the default number of repeats to 1
TC = TC.replace(/"<\/table><br \/><\/div>"/, function(str){R++; return '"</table>"+(n>1?"* - <font size=1>This setting will instruct the game to repeat this same auction the specified number of times.</font>":"")+"<br /></div>"';});
-> add some simple help text
TC = TC.replace(/Ajax.remoteCall\(['"]building_market['"], *['"]putup['"], *{town_id: *that.townId, *item_id: *item.get_id\(\), *auctionprice: *min_bid, *maxprice: *max_price, *itemcount: *nsell/,
function(str){R++; return "for(var i=0;i<nsell-1;i++) Ajax.remoteCall('building_market','putup',{town_id:that.townId,item_id:item.get_id(),auctionprice:min_bid,maxprice:max_price,itemcount:1,sellrights:(charHasTown?rights:2),auctionlength:days,description:$('auction_description').value},function(){;});"
+"Ajax.remoteCall('building_market','putup',{town_id:that.townId,item_id:item.get_id(),auctionprice:min_bid,maxprice:max_price,itemcount:1";}); /* the 1 to the left completely disables the original purpose of the Amount field */
-> this is the part which actually tells the server to put the item on the market
-> itemcount:1 means that the Amount variable will not be used, so it will not enable players to sell multiple items at once
-> there is also a loop which runs the request n-1 times; the n-th time, it will also handle the server response (display the message, alter the local inventory, etc.)
Market.prototype.prepareTraderControl = eval("("+TC+")");
-> apply the changes
alert('Market patch by Petee '+(R==4?"applied successfully!":"was not applied :(. Try it again after refreshing window (isn't the script already applied?). If it just won't work, please contact Petee on the .net forums.")+' \n\nThanks to Lekensteyn for the inspiration from his original script. Please, support me by visiting http://tw-db.info/ !');
if(R!=4)window.location.reload();
-> this piece of code is a safetyguard; if the 1st replace succeeded and the 4th one failed, players could make use of the disabled feature; in that case, reload the page and discard any changes
void(0);