Results 1 to 8 of 8

Thread: New Lua Highlighter

  1. #1
    Banned
    Join Date
    Jun 2012
    Location
    Ceará
    Posts
    2,114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    81
    Rep Power
    0

    New Lua Highlighter

    The old tag [lua] was broken, so Solaris have added a new one.

    It's used to highlight Lua based codes, it's much better to view and find errors, please use this form whenever you are posting a script.

    [luas]CODE_INSIDE[/luas]

    Example:

    Lua Code:
    local CONFIG = {
        LOOT_BACKPACK = "jewelled backpack",
     
        STACKABLE_BACKPACK = "green backpack",
        STACKABLE_BACKPACK_AMOUNT = 2,
     
        NOT_STACKABLE_BACKPACK = "grey backpack",
        NOT_STACKABLE_BACKPACK_AMOUNT = 18,
     
        DEPOSIT_ITEMS = {"great health potion", "fish fin", "necklace of the deep", "deepling staff"},
    }
     
    local NOT_STACKABLE_LAST_ON_TO, ITEM_INDEX = 0, 1
     
    while (#CONFIG.DEPOSIT_ITEMS >= ITEM_INDEX) do
        if (type(CONFIG.DEPOSIT_ITEMS[ITEM_INDEX]) == "string") then
            local ITEM_ID = itemid(CONFIG.DEPOSIT_ITEMS[ITEM_INDEX])
     
            if (ITEM_ID > 0) then
                CONFIG.DEPOSIT_ITEMS[ITEM_INDEX], ITEM_INDEX = ITEM_ID, ITEM_INDEX + 1
            else
                table.remove(CONFIG.DEPOSIT_ITEMS, ITEM_INDEX)
            end
        elseif (type(CONFIG.DEPOSIT_ITEMS[ITEM_INDEX]) == "number") then
            if (CONFIG.DEPOSIT_ITEMS[ITEM_INDEX] > 0) then
                ITEM_INDEX = ITEM_INDEX + 1
            else
                table.remove(CONFIG.DEPOSIT_ITEMS, ITEM_INDEX)
            end
        else
            table.remove(CONFIG.DEPOSIT_ITEMS, ITEM_INDEX)
        end
    end
     
    while (true) do
        for _, DEPOSIT_ITEM in ipairs(CONFIG.DEPOSIT_ITEMS) do
            if (itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK) > 0) then
                if (itemproperty(DEPOSIT_ITEM).isCumulative) then
                    local STACKABLE_LAST_ON_TO = 0
     
                    while (CONFIG.STACKABLE_BACKPACK_AMOUNT > STACKABLE_LAST_ON_TO) do
                        local ITEM_COUNT_BEFORE = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
     
                        moveitemsonto(DEPOSIT_ITEM, "all", CONFIG.STACKABLE_BACKPACK, 100, STACKABLE_LAST_ON_TO) wait(500, 1000)
     
                        local ITEM_COUNT_AFTER = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
     
                        if (ITEM_COUNT_BEFORE == ITEM_COUNT_AFTER and ITEM_COUNT_AFTER > 0) then
                            STACKABLE_LAST_ON_TO = STACKABLE_LAST_ON_TO + 1
                        elseif (ITEM_COUNT_AFTER == 0) then
                            break
                        end
                    end
                else
                    while (CONFIG.NOT_STACKABLE_BACKPACK_AMOUNT > NOT_STACKABLE_LAST_ON_TO) do
                        local ITEM_COUNT_BEFORE = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
     
                        moveitemsonto(DEPOSIT_ITEM, "all", CONFIG.NOT_STACKABLE_BACKPACK, 100, NOT_STACKABLE_LAST_ON_TO) wait(500, 1000)
     
                        local ITEM_COUNT_AFTER = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
     
                        if (ITEM_COUNT_BEFORE == ITEM_COUNT_AFTER and ITEM_COUNT_AFTER > 0) then
                            NOT_STACKABLE_LAST_ON_TO = NOT_STACKABLE_LAST_ON_TO + 1
                        elseif (ITEM_COUNT_AFTER == 0) then
                            break
                        end
                    end
                end
            end
        end
     
        if (itemcount(CONFIG.LOOT_BACKPACK, CONFIG.LOOT_BACKPACK) > 0) then
            openitem(CONFIG.LOOT_BACKPACK, CONFIG.LOOT_BACKPACK, false) wait(2000, 3000)
        else
            break
        end
     
        wait(100)
    end

  2. #2
    Focus Group Solaris's Avatar
    Join Date
    Feb 2012
    Location
    Rio de Janeiro / RJ
    Posts
    383
    Mentioned
    83 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    40 Post(s)
    Reputation
    256
    Rep Power
    7
    woww nicee !

    Administrador

    Atenciosamente,
    Solaris

    ----> Facebook LIKE ME !!


  3. #3
    Banned
    Join Date
    May 2012
    Posts
    1,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    127
    Rep Power
    0
    I'd prefer it [lua] instead but still good

  4. #4
    Premium User Eldar's Avatar
    Join Date
    Apr 2013
    Location
    Poland
    Posts
    1,335
    Mentioned
    37 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    62 Post(s)
    Reputation
    159
    Rep Power
    7
    Good work!

  5. #5
    Normal User vinera ambition's Avatar
    Join Date
    Nov 2012
    Location
    venezuela
    Posts
    109
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    33
    Rep Power
    5
    great!

  6. #6
    iBot User Noxuos's Avatar
    Join Date
    Mar 2012
    Location
    iBot Forums
    Posts
    852
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    167
    Rep Power
    7
    awesome! i was just looking for this ^^

    again great job!
    123456789123456789

    Script Voc Video Of Script 100% AFK
    [300+]Zao Walls Main Floor And Floor Up Ava SD and Spell Version ED|MS Video On TibiaCast/YouTube
    [200+]Deeplings Stage 1 West Side ED|MS|RP|EK Video On TibiaCast/YouTube
    [150+]Yalahar Bog Raiders Optional Nightmare And Destroyer Elite Knight Video On TibiaCast/YouTube
    •Noxuos Scripts Screen Shot Project Click Here! •Sell 340 RP Open-PVP: Transferable: Pm With Offers Noxuos Scripts Character Shop Click Here

    •New Poll Which voc do you want to see more scripts of? Check out my thread to vote •Sell 264 ED PvP: Transferable: 80 voucher days! •Accepting Tibia Cash On All New Scripts



  7. #7
    iBot User J.Dre's Avatar
    Join Date
    Aug 2012
    Posts
    108
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    13 Post(s)
    Reputation
    12
    Rep Power
    5
    Quote Originally Posted by BUgWT View Post
    I'd prefer it [lua] instead but still good
    Yeah, what's with the "s" at the end? It's called "Lua" code.

    You could also make it:

    [CODE=Lua][/CODE]
    Last edited by J.Dre; 11-16-2013 at 12:14 PM.

  8. #8
    Normal User Y4rR0's Avatar
    Join Date
    May 2012
    Location
    Warsaw, Poland
    Posts
    596
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    18 Post(s)
    Reputation
    87
    Rep Power
    6
    love it

Posting Permissions

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