Results 1 to 2 of 2

Thread: Help with a script

  1. #1
    Normal User
    Join Date
    Aug 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4

    Help with a script

    Hello guys,

    Well, I think that randomness is the way to not be banned, thinking about it, I'm trying to write a script to make runes in the best random way I can think.
    Here's the script:

    if (mp >= math.random(1500,2600) and soul >= 5 and itemcount("blank rune") > 0) then
    if (mp / 985) > 2 then
    cast("adori gran mort")
    wait(2000,6000)
    cast("adori gran mort")
    else
    cast("adori gran mort")
    if (math.random(1,4)) >= 3 then
    local sds = 985 - mp
    if sds < 260 then
    local espera = 1000 * sds + 1000
    wait(espera)
    cast("adori gran mort")
    end
    end
    end
    wait(210000)
    end


    But, with this, I'm getting this debug message:
    22:14 : LUAoAction:SuddenDeath: - LuaInterface.LuaScriptException: ...ettings\Owner\My Documents\iBot\library\Standard.lua:319: A .NET exception occured in user-code


    Anyone knows what's wrong?


    Thank you

  2. #2
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    Try that?

    Messy code though :S

    Code:
    if (mp >= math.random(1500,2600) and soul >= 5 and itemcount("blank rune") > 0) then
    	if (mp / 985) > 2 then
    		cast("adori gran mort")
    		wait(2000,6000)
    		cast("adori gran mort")
    	else
    		cast("adori gran mort")
    		wait(2000,6000)
    	elseif (math.random(1,4)) >= 3 then
    	local sds = 985 - mp
    		if sds < 260 then
    			local espera = 1000 * sds + 1000
    			wait(espera)
    			cast("adori gran mort")
    		end
    	end
    	wait(210000)
    end


    Heres a quick one i wrote:

    Code:
    local runeSpell = "adori gran mort" -- The spell for the runes to make
    local runeSoul = 5 -- Minimum Soul required for this spell
    local runeMana = 985 -- Minimum mana to make 1 rune
    local minMppc = 70 -- Minimum Mana % to have before starting to make runes
    local maxMppc = 90 -- Maximum ana % to have before starting to make runes
    
    while mppc < math.random(minMppc, maxMppc) do
    	wait(1000)
    end
    -- This will wait until you have between minMppc-maxMppc before making runes, instead of using a massive wait time like 210000
    
    while soul > runeSoul and mp > runeMana and itemcount("blank rune") > 0 do
    	if cancast(runeSpell) then
    		cast(runeSpell)
    	end
    end
    -- This part will make as many runes as you can, after waiting until you have between minMppc and maxMppc % mana.

    I didnt test it though, but that would be a simpler way of doing it.

    If you wanted to test it, id makea few runes by spamming mana pots for the first few, to make sure its working, intead of waiting for normal regen.
    Last edited by pink_panther; 08-27-2013 at 12:26 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •