-- ============================================= -- buyDiamonds() by Rickster -- Version 1.0 (12/03/2012 - mm/dd/yyy) -- last edited by: Rickster (12/03/2012) -- ------------------------------------- -- buyDiamonds(_buyThisManyTimes, _debug_mode) -- Description: This will buy diamonds at the npc Cedric in Varanas -- be sure that your char stands near Cedric when calling this userfunction -- Default usage: buyDiamonds() -- this will buy diamonds at Cedric one time -- default times to buy diamonds can be set in the userfunction below -- Additional arguments: -- _buyThisManyTimes -- how many times you want to buy diamands, defaults to 1 -- _debug_mode -- true/false, defaults to false -- -- prints a message before buying and sleeps until key is pressed to continue -- ============================================= function buyDiamonds(_buyThisManyTimes, _debug_mode) -- default settings local buyThisManyTimes = 1 -- default = 1, defaults to buy diamonds one time -- end default settings if not _buyThisManyTimes then _buyThisManyTimes = buyThisManyTimes end if not _debug_mode then _debug_mode=false end local name_npc = GetIdName(115815); -- Cedric in Varanas if _debug_mode then cprinf_ex("|purple| DEBUG - Going to buy diamonds %s times at %s ...\n", _buyThisManyTimes, name_npc) player:sleep() end cprintf_ex("|lightgreen| Buying diamonds ...\n"); for i=1, _buyThisManyTimes do if player:target_NPC(name_npc) then sendMacro("ChoiceOption(1);"); yrest(500); sendMacro("CloseWindows()"); yrest(500); else cprintf_ex("|lightred| NPC not found! Not buying diamonds. Be sure to be near %s in Varanas when trying to buy diamnods.\n", name_npc) break end end; end