Thanks for the feedback. After looking at how I was going to implement it, I decided to make a separate variable for how many slots I would use so I could easily change it so I'm going to be doing this:
Code: Select all
bagstouse = 4 <!-- We will use this many bags for this script. I.e., with default of 4, it will use bags 1 thru 4 (slots 61 thru 180. -->)
endslot = 0 -- establish the variable
function setBagSlots()
if bagstouse == nil then
bagstouse = 4
end
if bagstouse == 1 then
endslot = 90
elseif bagstouse == 2 then
endslot = 120
elseif bagstouse == 3 then
endslot = 150
elseif bagstouse == 4 then
endslot = 180
elseif bagstouse == 5 then
endslot = 210
elseif bagstouse == 6 then
endslot = 240
end
end
setBagSlots()
inventory:update()
for slot = 61, endslot do
if item.ID == 0 then
slotsavailable = slotsavailable + 1
end
end
-- of course I have a lot more code than this that executes within the functions and in the for statement. I just shortened it down for the applicable part that I had a question about. Doing it this way, I can use the endslot variable for my mailing functions as well. so everything I do within this waypoint will apply only to the bags I want to use, so that I can be safe that I won't accidentally send any good items I might have in bag 5 or 6. I'm updating my belt and fusion stone buying and sending script so it will look at how many equipment I currently have, look at my empty slots, look at how many characters I have to send to, and calculate a number of items to buy, then buy and send those proper amounts. In addition to that, It will start with a menu where I choose which group I want to send to, or I select the last option which is "All Groups" in which case it will go through the whole process for each group I have (currently I have 3 groups - 1 with 11 characters, and 2 groups with 16 each.) I've almost got the whole thing working. Hopefully tonight will be the magic night where it'll run through without errors.