Results 1 to 4 of 4

Thread: Scripts Lua

  1. #1
    Administrator Jonatas's Avatar
    Join Date
    Feb 2012
    Posts
    1,187
    Mentioned
    450 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    219 Post(s)
    Reputation
    272
    Rep Power
    10

    Scripts Lua

    Em iBot, scripting é executado através de uma linguagem de script popular e poderoso chamado Lua. Esta atualização adiciona flexibilidade adicional e permite-lhe implementar scripts muito mais poderosas e personalizadas. Lua já vem pré-embalados com várias bibliotecas contendo úteis de uso geral, tais como funções para a matemática ou a manipulação de strings, assim, muito pode ser feito com pequenas quantidades de esforço.
    Sinta-se avontade para perguntar sobre qualquer script.
    Aproveite o iBot.
    Last edited by Manuu; 05-29-2014 at 11:56 AM.

  2. #2
    Administrator Jonatas's Avatar
    Join Date
    Feb 2012
    Posts
    1,187
    Mentioned
    450 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    219 Post(s)
    Reputation
    272
    Rep Power
    10
    How to open Depot.
    Como abrir o Depot.
    Lua Code:
     
    reachgrounditem("depot")
    wait(1000,2000)
    openitem("depot")
    wait(700,900)
    openitem(3502, "locker")
    wait(700,900)



    How to check manas
    Como checar as manas
    Lua Code:
     
    if itemcount("mana potion") < 20 then
       gotolabel("refiller")
    end



    How to drop gold coin on ground
    Como jogar os o item gold coin no chão
    Lua Code:
     
    dropitems(3031)



    How to set Taget enable no.
    Como deixar o Target desligado.
    Lua Code:
     
    settargeting("no")



    How to deposit all.
    Como depositar todo seu dinheiro no banco.
    Lua Code:
     
    depositall()



    How to levitate. In example char turn to north and use 'exani hur up'.
    Como usar a levitação para subir ou descer andares. No exemplo o char ira virar o norte e subir com 'exani hur up'.
    Lua Code:
     
    levitate("n","up")



    How to deposit all and withdraw for buy 500 manas and 50 ultimates.
    Como depositar e tirar a quantidade exata para a compra de 500 mana potion e 50 ultimate potion no banco.
    Lua Code:
     
    local mana = positive(500 - itemcount("mana potion")) * 50
    local health = positive(50 - itemcount("ultimate health potion")) * 310
    local Total = mana + health
     
    say("hi")
    wait(1500,2500)
    npcsay("deposit all")
    wait(200,300)
    npcsay("yes")
    wait(200,300)
     
    if Total > 0 then
       npcsay("withdraw "..Total)
       wait(200,300)
       npcsay("yes")
       wait(200,300)
    end



    How to buy 500 manas from npc.
    Como comprar 500 manas do npc.
    Lua Code:
     
    opentrade()
    sellflasks()
    buyitemsupto("mana potion", 500)



    How to use 'utani hur'
    Como usar o 'utani hur'
    Lua Code:
     
    cast('utani hur')



    How set Alerts/Player/OnScreen/PlaySound to yes
    Como mudar Alerts/Player/OnScreen/PlaySound para yes
    Lua Code:
     
    setsettings("Settings\\Alerts\\Player\\OnScreen\\PlaySound","yes")



    Como usar a fishing rod no water elemental
    1- Adicione uma nova action.
    2- Coloque o Spam de 500-800.
    3- Coloque o script.
    Lua Code:
     
    fish(7, true)

    No caso 7 seria a distancia de SQMs que a função irá procurar por um water morto.
    O segundo parametro 'true', no caso ele vai esperar o corpo morto rescente até poder usar a fishing rod.


    Como usar o ponteiro target. O mesmo retorna as informções pertinentes ao target no qual pode ser usado para diversas actions.
    Lua Code:
     
    target.id
    target.name
     
    target.posx
    target.posy
    target.posz
     
    target.hppc
    target.dist
     
    target.isreachable
    target.isshootable



    Simples re-connect
    Lua Code:
     
    local accounts = 
        {
            {acc = 'account', pass = 'password', name = 'Char Name'}
        }
    local serversavetime = {from = '6:00', to = '6:20'}
    serversavetime = {from = tosec(serversavetime.from), to = tosec(serversavetime.to)}
    local randdelay = {min = 0, max = 300}
    local startlabel = ''
    local curchar = 1
     
    --dont change things below
     
    local randomdelay = math.random(randdelay.min, randdelay.max)
    if not connected then
        setcavebot('off')
        local curtime = tosec(time())
        if curtime < serversavetime.from or curtime > serversavetime.to+randomdelay then
            connect(accounts[curchar].acc, accounts[curchar].pass, accounts[curchar].name)
            wait(3000,4000)
            updateworld()
            if connected then
                if startlabel ~= '' then
                    gotolabel(startlabel)
                end
                setcavebot('on')        
            end
        end
    end


    Re-Connect para 1 char para cada dia.
    Lua Code:
     
    local accounts = 
        {
            {acc = 'account', pass = 'password', name = 'Char Name 1'},
            {acc = 'account', pass = 'password', name = 'Char Name 2'},
            {acc = 'account', pass = 'password', name = 'Char Name 3'},
            {acc = 'account', pass = 'password', name = 'Char Name 4'}
        }
    local serversavetime = {from = '6:00', to = '6:20'}
    serversavetime = {from = tosec(serversavetime.from), to = tosec(serversavetime.to)}
    local randdelay = {min = 0, max = 500}
    local startlabel = ''
     
    --dont change things below
     
    local curchar = 1
    local curtime = tosec(time())
    if curtime <= serversavetime.from and curtime >= tosec('00:00') then
       curchar = ((days()-1)%#accounts)+1
    else
       curchar = (days()%#accounts)+1
    end
     
    local randomdelay = math.random(randdelay.min, randdelay.max)
    if not connected then
        setcavebot('off')
        curtime = tosec(time())
        if curtime < serversavetime.from or curtime > serversavetime.to+randomdelay then
            connect(accounts[curchar].acc, accounts[curchar].pass, accounts[curchar].name)
            wait(3000,4000)
            updateworld()
            if connected then
                if startlabel ~= '' then
                    gotolabel(startlabel)
                end
                setcavebot('on')        
            end
        end
    end
    Last edited by dragonjapa; 09-14-2014 at 01:01 PM.

  3. #3
    Administrator Jonatas's Avatar
    Join Date
    Feb 2012
    Posts
    1,187
    Mentioned
    450 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    219 Post(s)
    Reputation
    272
    Rep Power
    10
    Como fazer um Safe Heal
    Lua Code:
     
    if maround(5,false,'Serpent Spawn', 'Medusa') >= 2 then
    setsettings('Settings\\Healer\\Rules\\ExuraVita\\H  ealRange', '0 to 70 %')
    setsettings('Settings\\Healer\\Rules\\ExuraGran\\H  ealRange', '70 to 90 %')
    setsettings('Settings\\Healer\\Rules\\Exura\\HealR  ange', '0 to 0 %')
    else
    setsettings('Settings\\Healer\\Rules\\ExuraVita\\H  ealRange', '0 to 57 %')
    setsettings('Settings\\Healer\\Rules\\ExuraGran\\H  ealRange', '57 to 77 %')
    setsettings('Settings\\Healer\\Rules\\Exura\\HealR  ange', '77 to 90 %')
    end



    Anti-Lure
    Lua Code:
     
    local monsters = {'Medusa','Serpent Spawn'}
     
    if maround(7, unpack(monsters)) >= 3 then 
       settargeting('off')
       if not hasted then
          cast('utani hur')
          wait(200,300)
          gotolabel(wpt.id-2)
       end
    else
       wait(1000)
       if getsettings("Settings\\Targeting\\Enabled") == 'no' then
          settargeting('on')
          wait(1000,2000)
       end
    end



    HUD - Recent Loot
    Lua Code:
     
    -- you can add more items here
    local warnitems = {'dragon shield', 'wand of inferno', 'serpent sword','dragon hammer'}
     
    -- max lines to display at once 
    local maxindex = 6 
     
    -- spacing between lines
    local spacing = 15
     
     
    local index = 0 
    local msgs = getmessages("Server Log")
    local qtd = msgs.count-1
    for i=0,qtd do
       if msgs[qtd-i].type == 20 and msgs[qtd-i].text:find('Loot of ') then
     
          local colorm = false
          local l = 0
          for l=1, table.getn(warnitems) do
             if msgs[qtd-i].text:find(warnitems[l]) then
                colorm = true
                break
             end
          end
          if colorm then
             setfontcolor('red')
          else
             setfontcolor('green')
          end
     
          addtext(msgs[qtd-i].text, worldwin.left+5,worldwin.bottom-(maxindex*spacing)+20+(index*spacing))
     
          index=index+1
          if index == maxindex then
            break
          end
       end
    end



    Exemplo de Safe Bank
    Lua Code:
     
    -- NPC name
    local npcname = 'Znozel'
     
    local index = 0 
    local msgs = getmessages("NPCs")
    local qtd = msgs.count-1
    for i=0,qtd do
       if msgs[qtd].sender == npcname and msgs[qtd].text:find('There is not enough gold on your account.') then
          setcavebot('off')
          wait(5000,10000)
          closetibia()
       end
    end



    Exemplo de Soft Boots Changer
    Lua Code:
     
    -- ID change boots
    changeboots = 4033  -- Draken Boots
     
    if mppc > 85 or pzone then
       if boots ~= changeboots then
          if itemcount(changeboots) > 0 then
             moveitems(changeboots,"all","boots",1)
          end
       end
    else
       if boots ~= 3549 then
          if itemcount("soft boots") > 0 then
             moveitems("soft boots","all","boots",1)
          end
       end
    end



    Exemplo de Contador de Loot - Loot Counter
    Lua Code:
     
    -- Loots
    local lootsitems = {'gold coin', 'dragon Shield', 'Wand of Inferno', 'serpent sword','dragon hammer','dragonbone staff','small diamond','green dragon scale','green dragon leather','dragons tail' }
    local lootsvalue = {1,4000,3000,900,2000,3000,300,100,100,100}
     
    -- Supplie
    local suppliesitems = {'mana potion'}
    local suppsvalue = {50}
     
    -- Start Position
    local startpos = 200
     
     
    --dont change things below
     
    local loots = getitems(unpack(lootsitems))
    local qtdl = loots.count-1
    local totall = 0
     
    local supps = getitems(unpack(suppliesitems))
    local qtds = supps.count-1
    local totals = 0
     
    local startloot = 0
     
    setfontcolor("white")
    addtext("________________________________", 0,10+startpos)
    setfontcolor("red")
     
    -- Supplies
    for i=0,qtds do
       addtext(supps[i].name, 10,30+(startloot*15)+20+startpos)
       addtext(":", 140,30+(startloot*15)+20+startpos)
       addtext(supps[i].usage*suppsvalue[i+1], 150,30+(startloot*15)+20+startpos)
       startloot = startloot + 1
       totals = totals + supps[i].usage*suppsvalue[i+1]
    end
     
    setfontcolor("red")
    addtext("Supplie", 10,30+startpos)
    addtext(":", 140,30+startpos)
    addtext(totals, 150,30+startpos)
     
    setfontcolor("white")
    addtext("________________________________", 0,45+(startloot*15)+startpos)
     
    -- Loots
     
    setfontcolor("green")
    local posloot = 50+(startloot*15)+20+startpos
     
    for i=0,qtdl do
       addtext(loots[i].name, 10,50+(startloot*15)+40+startpos)
       addtext(":", 140,50+(startloot*15)+40+startpos)
       addtext(loots[i].loot*lootsvalue[i+1], 150,50+(startloot*15)+40+startpos)
       startloot = startloot + 1
       totall = totall + loots[i].loot*lootsvalue[i+1]
    end
     
    setfontcolor("green")
    addtext("Loots", 10,posloot)
    addtext(":", 140,posloot)
    addtext(totall, 150,posloot)
     
    setfontcolor("white")
    addtext("________________________________", 0,85+(startloot*15)+startpos)
     
    if totall-totals > 0 then
    setfontcolor("blue")
    else
    setfontcolor("red")
    end
     
    addtext("Total", 10,50+(startloot*15)+20+startpos+35)
    addtext(":", 140,50+(startloot*15)+20+startpos+35)
    addtext(totall-totals, 150,50+(startloot*15)+20+startpos+35)
     
    setfontcolor("white")
    addtext("________________________________", 0,115+(startloot*15)+startpos)
    Last edited by dragonjapa; 09-14-2014 at 01:01 PM.

  4. #4
    Administrator Manuu's Avatar
    Join Date
    Jun 2012
    Location
    Curitiba
    Posts
    3,585
    Mentioned
    202 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    473 Post(s)
    Reputation
    233
    Rep Power
    10
    este tópico será atualizado em breve.

    Loja

    Site

    Facebook

    Skype

    Promoção

    manuellascripts
    --

Posting Permissions

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