Quote Originally Posted by yompa93 View Post
PHP Code:
local ratio 2.7     -- 100 mana potions 270.00oz
local PotionID 
Item.GetID("mana potion")
local PotionPrice 50
local PotionName 
"mana potion"

--Spells
prio1 
"exevo gran mas vis"
prio2 "utana vid"
prio3 "exura vita"

while(true) do
    if (
Self.ItemCount(PotionName) > 0then --using all of the mana potions
        
while (Self.ItemCount(PotionName) > 0) do
            if 
Self.CanCastSpell(prio1then
            Self
.Cast(prio1)
            elseif (
not Self.CanCastSpell(prio1)) then
            
if Self.CanCastSpell(prio2then
            Self
.Cast(prio2)
            elseif (
not Self.CanCastSpell(prio2)) then
            
if Self.CanCastSpell(prio3then
            Self
.Cast(prio3)
            
end
        end
    end
end
    
else -- we must buy more potions
        
--firstlysell flasks..
        
Self.SayToNpc({"hi""trade"}, 100)
        if (
Self.Flasks() > 0then
            
while (Self.Flasks() > 0) do
            
Self.ShopSellFlasks()
            
end        
        end
        
        
-- lets buy potions
        
if (Self.Money() > 0then -- just to reduce amount of gold coins (wasting cap)
            while (
Self.ItemCount(3031) > PotionPrice) do
                
Self.ShopBuyItem(PotionID1)
                
sleep(math.random(300,900))
            
end
            
            
while ((Self.Cap() > (ratio 100 10)) and (Self.Money() > PotionPrice 100)) do
                
Self.ShopBuyItem(PotionID100)
                
sleep(math.random(300,900))
            
end
            
            
while ((Self.Cap() > (ratio 10 10)) and (Self.Money() > PotionPrice 10)) do
                
Self.ShopBuyItem(PotionID10)
                
sleep(math.random(300,900))
            
end
        end
        
    end

    sleep
(math.random(600,1400))
end 
Made it abit different, more user friendly i guess.
Use the support tab for potions, or use another script to do it.
I can also add the Mana on follow if you need it:

PHP Code:
local ratio 2.7     -- 100 mana potions 270.00oz
local PotionID 
Item.GetID("mana potion")
local PotionPrice 50


while(true) do
    if (
Self.ItemCount(PotionID) > 0then
        Self
.UseItemWithFollow(PotionID)
    elseif (
Self.Flasks() >= 0then
            
while (Self.Flasks() > 0) do
                
Self.SayToNpc({"hi""trade"}, 100)
                
Self.ShopSellFlasks()
            
end
        
-- lets buy potions
        
if (Self.Money() > 0then -- just to reduce amount of gold coins (wasting cap)
            while (
Self.ItemCount(3031) > PotionPrice) do
                
Self.ShopBuyItem(PotionID1)
                
sleep(math.random(300,900))
            
end
            
            
while ((Self.Cap() > (ratio 100 10)) and (Self.Money() > PotionPrice 100)) do
                
Self.ShopBuyItem(PotionID100)
                
sleep(math.random(300,900))
            
end
            
            
while ((Self.Cap() > (ratio 10 10)) and (Self.Money() > PotionPrice 10)) do
                
Self.ShopBuyItem(PotionID10)
                
sleep(math.random(300,900))
            
end
        end
    end
    sleep
(math.random(600,1400))
end 
Thanks for it, I used your potion buyer script with an another spell caster script I found on another thread which was way water to burn the mana.

Got ML87 to ML96 wasting 19.5kk in 24 hours (ultimate mana potion, life ring, soft boots and food) with a voucher (so 3x faster).

Surprisingly I encountered 4 (maybe 5) players at the place I was and I was afk for just one guy so I didn't get mass reported, let's see if I'll survive the cip automatic ban tool :P

http://forums.xenobot.net/showthread...7-manatraining