Results 1 to 3 of 3

Thread: help: For i in list

  1. #1
    Normal User
    Join Date
    Jan 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4

    help: For i in list

    In need of assistance!
    The code examples does not work!
    Code:
    list = {"Ham", "Meat", "Cheese"}
    for i in list do
        moveitems(list[i],xx,xx,x)
    end
    Thing is, I'm trying to create an action which moves every item in a list. [1] - [x].
    But I cant figure out how lists works, I've tried sevural diffrent solutions but nothing seems to be working.

    Code:
    t = 1
    While toptileitem(posx, posy, posz) ~= itemid("xxx") do
       moveitems(list[t], xx, xx, x)
       t = t + 1
    end
    Any ideas?

    edit: Point is to have a stack, lets say a lootstack. All your loot on the same sqm, and then sort it by throwing each item to it's own sqm.
    Last edited by frozzarn; 10-05-2013 at 11:07 PM. Reason: added info

  2. #2
    Normal User
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,671
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    8 Post(s)
    Reputation
    132
    Rep Power
    9

    list = {"Ham", "Meat", "Cheese"}
    for i = 1, #list do
    moveitems(list[i],xx,xx,x)
    end
    Last edited by soder; 10-06-2013 at 08:40 AM.

  3. #3
    Normal User
    Join Date
    Jan 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    Quote Originally Posted by soder View Post

    list = {"Ham", "Meat", "Cheese"}
    for i = 1, #list do
    moveitems(list[i],xx,xx,x)
    end
    Works great, thank you.

    rep++

Tags for this Thread

Posting Permissions

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