Results 1 to 4 of 4

Thread: Script isn't counting Crocodiles Killed

  1. #1
    iBot User gamalyel's Avatar
    Join Date
    Jan 2014
    Posts
    50
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    10
    Rep Power
    3

    Script isn't counting Crocodiles Killed

    Hey, guys

    The title is everything

    This is the Action

    Lua Code:
    local KILLED_COUNT1 = getsettings('Settings\\Actions\\List\\KILLED_COUNT  \\Script')
    local KILLED_COUNT2 = positive(KILLED_COUNT1+1)
    local TASK_MONSTERS = {"Crocodile"}
    local TASKS_DONE = getsettings('Settings\\Looting\\List\\TASK_DONE\\D  estination')+0
    local SERVER_LOG_MSG = getnewmessages("Server Log")
    local SERVER_LOG_MSG_COUNT = SERVER_LOG_MSG.count - 1
    for INDEX = 0, SERVER_LOG_MSG_COUNT do
        if (SERVER_LOG_MSG[SERVER_LOG_MSG_COUNT - INDEX].text:find('Loot of a') and SERVER_LOG_MSG[SERVER_LOG_MSG_COUNT - INDEX].type == 19) then
            for _, MONSTER in ipairs(TASK_MONSTERS) do
                if (SERVER_LOG_MSG[SERVER_LOG_MSG_COUNT - INDEX].text:find(MONSTER:lower())) then
                               if TASKER == true and TASKS_DONE < 3 then
                                 setsettings('Settings\\Actions\\List\\KILLED_COUNT  \\Script',KILLED_COUNT2)
                               end
                end
            end
        end
    end


    And the HUD

    Lua Code:
    local CONFIG = {
        TITLE = "Awsome Task Counter",
     
        DRAW_TYPE = "border",
        POSITION = {X = 20, Y = 440},
        MONSTERS = {"Crocodile"},
        COLOR = rgbcolor(113, 113, 198),
     
        VERSION = "1.0",
    }
     
    --[[ DON'T EDIT BELOW THIS LINE ]]--
     
    local MESSAGES = getnewmessages("Server Log")
     
    KILLED_CREATURES = KILLED_CREATURES or 0
     
    for INDEX = 0, MESSAGES.count - 1 do
        local m = MESSAGES[INDEX]
     
        if m.type == 19 and m.text:find("Loot of") then
            local MONSTER_NAME = m.text:match('Loot of (.+): (.+)')
     
            if MONSTER_NAME:sub(1, 4):lower() == 'the ' then
                MONSTER_NAME = MONSTER_NAME:sub(5)
            elseif MONSTER_NAME:sub(1, 3):lower() == 'an ' then
                MONSTER_NAME = MONSTER_NAME:sub(4)
            elseif MONSTER_NAME:sub(1, 2):lower() == 'a ' then
                MONSTER_NAME = MONSTER_NAME:sub(3)
            end
     
            MONSTER_NAME = MONSTER_NAME:lower()
     
            for _, NAME_MATCH in ipairs(CONFIG.MONSTERS) do
                if NAME_MATCH:lower() == MONSTER_NAME then
                    KILLED_CREATURES = KILLED_CREATURES + 1
                end
            end
        end
    end
     
    function addcustomtext(TEXT, X, Y, COLOR)
        setfontcolor(rgbcolor(10, 10, 10))
        if CONFIG.DRAW_TYPE:upper() == "SHADOW" then
            addtext(TEXT, X + 1, Y + 1)
        elseif CONFIG.DRAW_TYPE:upper() == "BORDER" then
            addtext(TEXT, X + 1, Y + 1)
            addtext(TEXT, X - 1, Y - 1)
            addtext(TEXT, X - 1, Y + 1)
            addtext(TEXT, X + 1, Y - 1)
            addtext(TEXT, X, Y + 1)
            addtext(TEXT, X, Y - 1)
            addtext(TEXT, X + 1, Y)
            addtext(TEXT, X - 1, Y)
        end
        setfontcolor(COLOR)
        return addtext(TEXT, X, Y)
    end
     
    addcustomtext(string.format("Currently killed %s creatures.", KILLED_CREATURES), CONFIG.POSITION.X, CONFIG.POSITION.Y, CONFIG.COLOR)


    Im using Bosse101's script for Crocodile Task in Port Hope.
    Last edited by gamalyel; 02-08-2015 at 01:19 PM.

  2. #2
    iScripter Eli's Avatar
    Join Date
    Mar 2012
    Posts
    3,764
    Mentioned
    492 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    955 Post(s)
    Reputation
    586
    Rep Power
    10
    Quote Originally Posted by gamalyel View Post
    Hey, guys

    The title is everything

    This is the Action

    Lua Code:
    local KILLED_COUNT1 = getsettings('Settings\\Actions\\List\\KILLED_COUNT  \\Script')
    local KILLED_COUNT2 = positive(KILLED_COUNT1+1)
    local TASK_MONSTERS = {"Crocodile"}
    local TASKS_DONE = getsettings('Settings\\Looting\\List\\TASK_DONE\\D  estination')+0
    local SERVER_LOG_MSG = getnewmessages("Server Log")
    local SERVER_LOG_MSG_COUNT = SERVER_LOG_MSG.count - 1
    for INDEX = 0, SERVER_LOG_MSG_COUNT do
        if (SERVER_LOG_MSG[SERVER_LOG_MSG_COUNT - INDEX].text:find('Loot of a') and SERVER_LOG_MSG[SERVER_LOG_MSG_COUNT - INDEX].type == 19) then
            for _, MONSTER in ipairs(TASK_MONSTERS) do
                if (SERVER_LOG_MSG[SERVER_LOG_MSG_COUNT - INDEX].text:find(MONSTER:lower())) then
                               if TASKER == true and TASKS_DONE < 3 then
                                 setsettings('Settings\\Actions\\List\\KILLED_COUNT  \\Script',KILLED_COUNT2)
                               end
                end
            end
        end
    end


    And the HUD

    Lua Code:
    local CONFIG = {
        TITLE = "Awsome Task Counter",
     
        DRAW_TYPE = "border",
        POSITION = {X = 20, Y = 440},
        MONSTERS = {"Crocodile"},
        COLOR = rgbcolor(113, 113, 198),
     
        VERSION = "1.0",
    }
     
    --[[ DON'T EDIT BELOW THIS LINE ]]--
     
    local MESSAGES = getnewmessages("Server Log")
     
    KILLED_CREATURES = KILLED_CREATURES or 0
     
    for INDEX = 0, MESSAGES.count - 1 do
        local m = MESSAGES[INDEX]
     
        if m.type == 19 and m.text:find("Loot of") then
            local MONSTER_NAME = m.text:match('Loot of (.+): (.+)')
     
            if MONSTER_NAME:sub(1, 4):lower() == 'the ' then
                MONSTER_NAME = MONSTER_NAME:sub(5)
            elseif MONSTER_NAME:sub(1, 3):lower() == 'an ' then
                MONSTER_NAME = MONSTER_NAME:sub(4)
            elseif MONSTER_NAME:sub(1, 2):lower() == 'a ' then
                MONSTER_NAME = MONSTER_NAME:sub(3)
            end
     
            MONSTER_NAME = MONSTER_NAME:lower()
     
            for _, NAME_MATCH in ipairs(CONFIG.MONSTERS) do
                if NAME_MATCH:lower() == MONSTER_NAME then
                    KILLED_CREATURES = KILLED_CREATURES + 1
                end
            end
        end
    end
     
    function addcustomtext(TEXT, X, Y, COLOR)
        setfontcolor(rgbcolor(10, 10, 10))
        if CONFIG.DRAW_TYPE:upper() == "SHADOW" then
            addtext(TEXT, X + 1, Y + 1)
        elseif CONFIG.DRAW_TYPE:upper() == "BORDER" then
            addtext(TEXT, X + 1, Y + 1)
            addtext(TEXT, X - 1, Y - 1)
            addtext(TEXT, X - 1, Y + 1)
            addtext(TEXT, X + 1, Y - 1)
            addtext(TEXT, X, Y + 1)
            addtext(TEXT, X, Y - 1)
            addtext(TEXT, X + 1, Y)
            addtext(TEXT, X - 1, Y)
        end
        setfontcolor(COLOR)
        return addtext(TEXT, X, Y)
    end
     
    addcustomtext(string.format("Currently killed %s creatures.", KILLED_CREATURES), CONFIG.POSITION.X, CONFIG.POSITION.Y, CONFIG.COLOR)


    Im using Bosse101's script for Crocodile Task in Port Hope.
    Remove both, it wont work.

    Add New HUD or replace with your current General Information HUD
    [xcode=lua]
    -- iBot+ General Info v1.0.1 --

    local HUD =
    {
    TITLE = "iBot+ General Info v1.0.1",

    CONFIG =
    {
    ORIENTATION = "Left",
    START_POSITION = {15, 25},
    MAX_TEXT_LENGTH = 15,
    TEXT_DISTANCE = 120,
    LINE_DISTANCE = 15,
    },

    TIBIABASEDXPPERHOUR = true,

    COLORS =
    {
    TITLE = rgbcolor(255, 165, 0),
    TEXT1 = rgbcolor(205, 200, 177),
    TEXT2 = rgbcolor(255, 255, 255),
    SUBTITLE = rgbcolor(30, 144, 255),
    RED = rgbcolor(178, 34, 34),
    GREEN = rgbcolor(107, 142, 35),
    },

    CHARINFO =
    {
    {NAME = "Level:", VALUE = level, ENABLED = true},
    {NAME = "Health:", VALUE = hp.. " / ".. maxhp .." (".. hppc .." %)" , ENABLED = true},
    {NAME = "Mana:", VALUE = mp.. " / ".. maxmp .." (".. mppc .." %)" , ENABLED = true},
    {NAME = "Balance:", VALUE = comma_value(balance), ENABLED = true},
    {NAME = "Experience:", VALUE = comma_value(exp).. " (".. format_num((exptolevel()*100)/(50*level*level - 150*level + 200)) .." %)", ENABLED = true},
    {NAME = "Exp to Level:", VALUE = comma_value(exptolevel()), ENABLED = true},
    {NAME = "Exp Gained:", VALUE = comma_value(expgained), ENABLED = true},
    {NAME = "Exp Per Hour:", VALUE = comma_value(valxpperhour), ENABLED = true},
    {NAME = "Hunt Time:", VALUE = timehunt, ENABLED = true},
    {NAME = "Time to Level:", VALUE = valTimeToLevel, ENABLED = true},
    {NAME = "Stamina:", VALUE = converttime(format_num((stamina/60))).." Hours", ENABLED = true},
    {NAME = "Killed Crocodiles:", VALUE = killedcount("Crocodile"), ENABLED = true},
    },

    BOTINFO = true,
    }

    valxpperhour = (HUD.TIBIABASEDXPPERHOUR and tibiaexphour or exphour)
    valTimeToLevel = converttime(format_num((exptolevel()/valxpperhour))) .. " Hours"

    local X, Y = (HUD.CONFIG.ORIENTATION:lower() == "right" and clientwin.right - 455 or clientwin.left + 10) + HUD.CONFIG.START_POSITION[1], worldwin.top + 10 + HUD.CONFIG.START_POSITION[2]

    setfontcolor(HUD.COLORS.TITLE)
    addtextstroke(HUD.TITLE, X, Y)

    Y = Y + HUD.CONFIG.LINE_DISTANCE + 2

    setfontcolor(HUD.COLORS.SUBTITLE)
    addtextstroke("CHARACTER INFORMATION:", X, Y)

    Y = Y + HUD.CONFIG.LINE_DISTANCE

    for _, INFO in ipairs(HUD.CHARINFO) do
    if INFO.ENABLED then
    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke(INFO.NAME, X, Y)
    if INFO.NAME == "Stamina:" and stamina >= 2400 then
    setfontcolor(HUD.COLORS.GREEN)
    elseif INFO.NAME == "Stamina:" and stamina < 2400 and stamina >= 840 then
    setfontcolor(HUD.COLORS.TEXT2)
    elseif INFO.NAME == "Stamina:" and stamina < 840 then
    setfontcolor(HUD.COLORS.RED)
    else
    setfontcolor(HUD.COLORS.TEXT2)
    end

    addtextstroke(INFO.VALUE, X + HUD.CONFIG.TEXT_DISTANCE, Y)
    Y = Y + HUD.CONFIG.LINE_DISTANCE
    end
    end

    if HUD.BOTINFO then
    Y = Y + 6
    setfontcolor(HUD.COLORS.SUBTITLE)
    addtextstroke("BOT INFORMATION:", X, Y)

    Y = Y + HUD.CONFIG.LINE_DISTANCE
    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke("Cavebot", X, Y)
    if cavebot then
    setfontcolor(HUD.COLORS.GREEN)
    addtextstroke("Enabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    else
    setfontcolor(HUD.COLORS.RED)
    addtextstroke("Disabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    end

    Y = Y + HUD.CONFIG.LINE_DISTANCE
    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke("Looting", X, Y)
    if looting then
    setfontcolor(HUD.COLORS.GREEN)
    addtextstroke("Enabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    else
    setfontcolor(HUD.COLORS.RED)
    addtextstroke("Disabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    end

    Y = Y + HUD.CONFIG.LINE_DISTANCE
    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke("Targeting", X, Y)
    if targeting then
    setfontcolor(HUD.COLORS.GREEN)
    addtextstroke("Enabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    else
    setfontcolor(HUD.COLORS.RED)
    addtextstroke("Disabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    end
    end[/xcode]

  3. #3
    iBot User gamalyel's Avatar
    Join Date
    Jan 2014
    Posts
    50
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    10
    Rep Power
    3
    Oh, wow....

    hmmm... lot of things have changed.

    Super thanks, I'll try and then let to know what happens

  4. #4
    iBot User gustavorique3's Avatar
    Join Date
    May 2012
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    11
    Rep Power
    5
    Quote Originally Posted by Eli View Post
    Remove both, it wont work.

    Add New HUD or replace with your current General Information HUD
    [xcode=lua]
    -- iBot+ General Info v1.0.1 --

    local HUD =
    {
    TITLE = "iBot+ General Info v1.0.1",

    CONFIG =
    {
    ORIENTATION = "Left",
    START_POSITION = {15, 25},
    MAX_TEXT_LENGTH = 15,
    TEXT_DISTANCE = 120,
    LINE_DISTANCE = 15,
    },

    TIBIABASEDXPPERHOUR = true,

    COLORS =
    {
    TITLE = rgbcolor(255, 165, 0),
    TEXT1 = rgbcolor(205, 200, 177),
    TEXT2 = rgbcolor(255, 255, 255),
    SUBTITLE = rgbcolor(30, 144, 255),
    RED = rgbcolor(178, 34, 34),
    GREEN = rgbcolor(107, 142, 35),
    },

    CHARINFO =
    {
    {NAME = "Level:", VALUE = level, ENABLED = true},
    {NAME = "Health:", VALUE = hp.. " / ".. maxhp .." (".. hppc .." %)" , ENABLED = true},
    {NAME = "Mana:", VALUE = mp.. " / ".. maxmp .." (".. mppc .." %)" , ENABLED = true},
    {NAME = "Balance:", VALUE = comma_value(balance), ENABLED = true},
    {NAME = "Experience:", VALUE = comma_value(exp).. " (".. format_num((exptolevel()*100)/(50*level*level - 150*level + 200)) .." %)", ENABLED = true},
    {NAME = "Exp to Level:", VALUE = comma_value(exptolevel()), ENABLED = true},
    {NAME = "Exp Gained:", VALUE = comma_value(expgained), ENABLED = true},
    {NAME = "Exp Per Hour:", VALUE = comma_value(valxpperhour), ENABLED = true},
    {NAME = "Hunt Time:", VALUE = timehunt, ENABLED = true},
    {NAME = "Time to Level:", VALUE = valTimeToLevel, ENABLED = true},
    {NAME = "Stamina:", VALUE = converttime(format_num((stamina/60))).." Hours", ENABLED = true},
    {NAME = "Killed Crocodiles:", VALUE = killedcount("Crocodile"), ENABLED = true},
    },

    BOTINFO = true,
    }

    valxpperhour = (HUD.TIBIABASEDXPPERHOUR and tibiaexphour or exphour)
    valTimeToLevel = converttime(format_num((exptolevel()/valxpperhour))) .. " Hours"

    local X, Y = (HUD.CONFIG.ORIENTATION:lower() == "right" and clientwin.right - 455 or clientwin.left + 10) + HUD.CONFIG.START_POSITION[1], worldwin.top + 10 + HUD.CONFIG.START_POSITION[2]

    setfontcolor(HUD.COLORS.TITLE)
    addtextstroke(HUD.TITLE, X, Y)

    Y = Y + HUD.CONFIG.LINE_DISTANCE + 2

    setfontcolor(HUD.COLORS.SUBTITLE)
    addtextstroke("CHARACTER INFORMATION:", X, Y)

    Y = Y + HUD.CONFIG.LINE_DISTANCE

    for _, INFO in ipairs(HUD.CHARINFO) do
    if INFO.ENABLED then
    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke(INFO.NAME, X, Y)
    if INFO.NAME == "Stamina:" and stamina >= 2400 then
    setfontcolor(HUD.COLORS.GREEN)
    elseif INFO.NAME == "Stamina:" and stamina < 2400 and stamina >= 840 then
    setfontcolor(HUD.COLORS.TEXT2)
    elseif INFO.NAME == "Stamina:" and stamina < 840 then
    setfontcolor(HUD.COLORS.RED)
    else
    setfontcolor(HUD.COLORS.TEXT2)
    end

    addtextstroke(INFO.VALUE, X + HUD.CONFIG.TEXT_DISTANCE, Y)
    Y = Y + HUD.CONFIG.LINE_DISTANCE
    end
    end

    if HUD.BOTINFO then
    Y = Y + 6
    setfontcolor(HUD.COLORS.SUBTITLE)
    addtextstroke("BOT INFORMATION:", X, Y)

    Y = Y + HUD.CONFIG.LINE_DISTANCE
    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke("Cavebot", X, Y)
    if cavebot then
    setfontcolor(HUD.COLORS.GREEN)
    addtextstroke("Enabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    else
    setfontcolor(HUD.COLORS.RED)
    addtextstroke("Disabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    end

    Y = Y + HUD.CONFIG.LINE_DISTANCE
    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke("Looting", X, Y)
    if looting then
    setfontcolor(HUD.COLORS.GREEN)
    addtextstroke("Enabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    else
    setfontcolor(HUD.COLORS.RED)
    addtextstroke("Disabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    end

    Y = Y + HUD.CONFIG.LINE_DISTANCE
    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke("Targeting", X, Y)
    if targeting then
    setfontcolor(HUD.COLORS.GREEN)
    addtextstroke("Enabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    else
    setfontcolor(HUD.COLORS.RED)
    addtextstroke("Disabled", X + HUD.CONFIG.TEXT_DISTANCE, Y)
    end
    end[/xcode]
    Thanks Eli, the hud its working but action counter doesnt work.
    Can you help me? Thank you.
    Be truth.

    Gusta~

Posting Permissions

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