Results 1 to 7 of 7

Thread: Need Magic Wall Timer

  1. #1
    Normal User
    Join Date
    Jun 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5

    Need Magic Wall Timer

    Like title says; I'll appreciate if some1 could share his magicwall timer!

    Yours,
    Yoshiba

  2. #2
    Normal User
    Join Date
    Oct 2012
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    +1

    I tried to convert one from neo, but it was a disaster hahaha
    I'm not a good lua developer hahaha :/

  3. #3
    Banned
    Join Date
    Sep 2012
    Location
    Poland
    Posts
    242
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    18
    Rep Power
    0
    PHP Code:
    --          ___             --    _______ _______  ______ _____ _______      _  _  _ _______
    --         /\  \          --    |  |  | |_____| |  ____   |   |            |  |  | |_____| |      |
    --        /::\  \           --    |  |  | |     | |
    _______|__ |_____       |__|__| |     | |_____ |_____
    --       /:/\:\  \          --
    --      /::\~\:\  \         --
    --     /:/\:\ \:\
    __\        --
    --     \/
    _|::\/:/  /        --             _______ _____ _______ _______  ______
    --        |:|::/  /         --                |      |   |  |  | |______ |_____/
    --        |:|\/
    __/          --                |    __|__ |  |  | |______ |    \_
    --        |:|  |            --
    --         \|
    __|            --

    local SCRIPT = {
        
    NAME "Magic Wall Timer",
        
    VERSION "1.0",
    }

    -- 
    ENGINE
    -- DON'T CHANGE NOTHING BELOW THIS LINE

    local MAGIC_WALLS = {
        ID = {2128, 2129, 2130, 10181, 10182},
        TIME = {20000, 20000, 45000, 20000, 45000}
    }
    local POSITIONS = {
        QUANTITY = 0,
        X = {},
        Y = {},
        Z = {},
        TIMES = {}
    }

    local function inverse(n)
        return tonumber(n) > 0 and tonumber("-" .. n) or math.abs(n)
    end

    local function findpixel(X, Y)
        return {x = math.floor(worldwin.left / 2) + (inverse(X - posx) * (math.floor(worldwin.left / 15))), y = math.floor(worldwin.top / 2) + (inverse(Y - posy) * (math.floor(worldwin.left / 15)))}
    end

    setfontstyle("calibri", 8, "ffd700")
    setposition(worldwin.left, worldwin.top)

    for HORIZONTAL = -7, 7 do
        for VERTICAL = -5, 5 do
            local TOP_ITEM_ID = topitem(posx + HORIZONTAL, posy + VERTICAL, posz).id
                    local MAGIC_WALL_INDEX = 0
                    repeat
                MAGIC_WALL_INDEX = MAGIC_WALL_INDEX + 1
            until INDEX > #MAGIC_WALLS.ID or TOP_ITEM_ID == MAGIC_WALLS.ID[INDEX]
            if MAGIC_WALL_INDEX <= #MAGIC_WALLS.ID then
                local GROUND_INDEX = 0
            repeat
                GROUND_INDEX = GROUND_INDEX + 1
            until (GROUND_INDEX > POSITIONS.AMOUNT) or ((POSITIONS.X[GROUND_INDEX] == posx + HORIZONTAL) and (POSITIONS.Y[GROUND_INDEX] == posy + VERTICAL) and (POSITIONS.Z[GROUND_INDEX] == posz))
                if GROUND_INDEX > POSITIONS.AMOUNT then
                    POSITIONS.AMOUNT = POSITIONS.AMOUNT + 1
                    table.insert(POSITIONS.X, POSITIONS.AMOUNT, posx + HORIZONTAL)
                    table.insert(POSITIONS.Y, POSITIONS.AMOUNT, posy + VERTICAL)
                    table.insert(POSITIONS.Z, POSITIONS.AMOUNT, posz)
                    table.insert(POSITIONS.TIMES, POSITIONS.AMOUNT, timems + 200 + MAGIC_WALLS.TIME[MAGIC_WALL_INDEX])
                end
            end
        end
    end

    if POSITIONS.AMOUNT > 0 then
        for INDEX = 1, POSITIONS.AMOUNT do
            local MW_TIME = POSITIONS.TIMES[INDEX]
            if MW_TIME == nil then
                MW_TIME = 0
            end
            local TOP_ITEM_ID = topitem(POSITIONS.X[INDEX], POSITIONS.Y[INDEX], POSITIONS.Z[INDEX]).id
            local MAGIC_WALL_INDEX = 0
            repeat
                MAGIC_WALL_INDEX = MAGIC_WALL_INDEX + 1
            until MAGIC_WALL_INDEX > #MAGIC_WALLS.ID or TOP_ITEM_ID == MAGIC_WALLS.ID[MAGIC_WALL_INDEX]
            if MW_TIME - timems > 0 and MAGIC_WALL_INDEX <= #MAGIC_WALL.ID then
                if POSITIONS.Z[MAGIC_WALL_INDEX] == posz then
                    local SCREEN = findpixel(POSITIONS.X[MAGIC_WALL_INDEX], POSITIONS.Y[MAGIC_WALL_INDEX])
                    addtext(string.format("%.2d:%.1d", (MW_TIME - timems) / 1000, (MW_TIME - timems) % 1000), SCREEN.x + 8, SCREEN.y + 12)
                end
                    else
                POSITIONS.AMOUNT = POSITIONS.AMOUNT - 1
                table.remove(POSITIONS.X, MAGIC_WALL_INDEX)
                table.remove(POSITIONS.y, MAGIC_WALL_INDEX)
                table.remove(POSITIONS.z, MAGIC_WALL_INDEX)
                table.remove(POSITIONS.TIMES, MAGIC_WALL_INDEX)
            end
        end
    end 
    Put it as HUD.
    Credits to Ropiderz.

  4. #4
    Normal User
    Join Date
    Oct 2012
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    @Frox. Ty man, but this one isn't working =/
    14:50 : LUA:HUDAction - LuaInterface.LuaScriptException: [string "chunk"]:46: attempt to call global 'topitem' (a nil value)

    Looks like there is a ANSII pointing to nothing, Ropiderz said that he will report to Jonatas, but it was some time ago.
    I'm trying to make it myself based on Ropiderz one, but its quite difficult =/

  5. #5
    iBot User
    Join Date
    Jun 2012
    Posts
    517
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    4 Post(s)
    Reputation
    132
    Rep Power
    7
    Ye, don't working for me too.

  6. #6
    Premium User Daniloco's Avatar
    Join Date
    Jun 2012
    Location
    Chile
    Posts
    74
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    4 Post(s)
    Reputation
    33
    Rep Power
    5
    if working?

  7. #7
    Normal User pautz2's Avatar
    Join Date
    Apr 2012
    Posts
    67
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    working?

Posting Permissions

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