Results 1 to 8 of 8

Thread: Help with an action!

  1. #1
    Normal User Nidray's Avatar
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    15
    Rep Power
    4

    Help with an action!

    Hello.

    I was wondering if there is a way to check if the toptileitem.id is not an specifik id, and if it is not and the id is movable move that id to a sqm next to it untill the toptileitem is the one you are looking for.

    For example.
    on 1 sqm there is, from the ground counted. soft boots, gold coin, dead rat, empty vail. I want to create an action that see's the soft boots and moves the empty vail to another position, then moves the dead rat to another postition, then moves the cold coin to another position and last but not least finds that the soft boots are now the toptileitem and moves them to your backpack.




    Free Scripts from me can be found here

  2. #2
    Normal User
    Join Date
    May 2013
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    16
    Rep Power
    4
    ctrl + right klick, then select browse field, drag the soft boots in this example to your backback.

  3. #3
    Normal User Nidray's Avatar
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    15
    Rep Power
    4
    Yeah that works if you are at the computer :P But is there a way for the bot to do this?
    Like an move all items above this id away from that sqm




    Free Scripts from me can be found here

  4. #4
    Normal User Nidray's Avatar
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    15
    Rep Power
    4
    Okey so something like.

    for i = 0, gettile(posx,posy,posz).count do
    if gettile(posx,posy,posz).item[i].id == wantedID then
    if not toptileitem(posx,posy,posz) == wantedID then
    movitems(gettile(posx,posy,posz).item[i].id, posx,posy,posz, posx+1,posy,posz)
    else
    movitems(gettile(posx,posy,posz).item[i].id, posx,posy,posz,"backpack")
    end
    end
    end


    Would that have any chans at all of working XD?




    Free Scripts from me can be found here

  5. #5
    Normal User Nidray's Avatar
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    15
    Rep Power
    4
    Noone?




    Free Scripts from me can be found here

  6. #6
    Normal User Nidray's Avatar
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    15
    Rep Power
    4
    Quote Originally Posted by Ropiderz View Post
    Almost Xd


    Code:
    local tile = gettile(posx, posy, posz) -- set a var to make code shorter
    
    for i = 0, tile.count - 1 do
        if tile.items[i].id == wantedID then
            if not toptileitem(posx,posy,posz) == wantedID then
                movetems(tile.items[i].id, ground(posx,posy,posz), ground(posx+1,posy,posz), 100)
            else
                movetems(tile.items[i].id, ground(posx,posy,posz),"backpack", 100)
            end
        end
    end
    Thx m8! Will test it when the bot is updated




    Free Scripts from me can be found here

  7. #7
    Normal User Nidray's Avatar
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    15
    Rep Power
    4
    Also instead of the

    ground(posx+1,posy,posz)

    Could you use

    ground(wheretomove(posx,posy,posz).x,wheretomove(p osx,posy,posz).y,wheretomove(posx,posy,posz).z)

    For a better code?




    Free Scripts from me can be found here

  8. #8
    Normal User Nidray's Avatar
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    15
    Rep Power
    4
    This is the final product!

    Code:
    for i = -7, 7 do 
        for j = -7, 7 do  
            local POSX,POSY,POSZ = posx+i,posy+j,posz
            local tile = gettile(POSX,POSY,POSZ)
              for n = 0, tile.count - 1 do
              if tile.items[n].id == 6529 or tile.items[n].id == 6530 then
                  if toptileitem(POSX,POSY,POSZ) == 6529 or toptileitem(POSX,POSY,POSZ) == 6530 then  
                  moveitems(tile.items[n], ground(POSX,POSY,POSZ), mainBP)
                    else
                     for k = 0, tile.count -1 do
                          local flytta = wheretomove(POSX, POSY, POSZ)
                          if toptileitem(POSX,POSY,POSZ) == 6529 or toptileitem(POSX,POSY,POSZ) == 6530 then  
                          moveitems(tile.items[n], ground(POSX,POSY,POSZ), mainBP)
                          wait(1000,2000)
                          end
                          moveitems(tile.items[k].id, ground(POSX,POSY,POSZ), ground(flytta.x, flytta.y,POSZ), 100)
                          wait(1000,2000)
                      end
                    end 
               end
             end 
        end  
    end
    Last edited by Nidray; 06-12-2013 at 03:29 PM.




    Free Scripts from me can be found here

Posting Permissions

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