-
mrtgtr
- Posts: 67
- Joined: Wed Mar 21, 2012 5:09 pm
#1
Post
by mrtgtr » Mon Dec 17, 2012 1:54 am
I used lootomatic but that addon is problem while go to char slection screen or escape to the game, game is crushed and item drop list will not be save.
I want to delete cheap items from 1200 gold ,arrows, Projectiles ,Crafting Runes, Runes with bot.
It didnt work, It didint delete -_-
Code: Select all
if item:isType("Arrows") then
item:delete()
end
if item:isType("Projectiles") then
item:delete()
end
if ( item:isType("Weapons") or item:isType("Armor") ) and (1200 > item.Worth and 5 > item.Quality)then
item:delete()
end
if item:isType("Runes") then
item:delete()
end
-
lolita
- Posts: 139
- Joined: Thu Oct 20, 2011 5:39 am
- Location: Serbia
#2
Post
by lolita » Mon Dec 17, 2012 12:38 pm
try this
Code: Select all
function CleanBag()
for i, item in pairs(inventory.BagSlot) do
if item.SlotNumber >= settings.profile.options.INV_AUTOSELL_FROMSLOT + 60 and
settings.profile.options.INV_AUTOSELL_TOSLOT + 60 >= item.SlotNumber then
if item:isType("Arrows") then
item:delete()
end
if item:isType("Projectiles") then
item:delete()
end
if item:isType("Runes") then
item:delete()
end
if ( item:isType("Weapons") or item:isType("Armor") ) and (1200 > item.Worth and 3 > item.Quality) then
item:delete()
end
if item:isType("Potions") and (46 > item.RequiredLvl and item.RequiredLvl > 10) then
item:delete()
end
end
end
end
Life is a journey, not destination
-
mrtgtr
- Posts: 67
- Joined: Wed Mar 21, 2012 5:09 pm
#3
Post
by mrtgtr » Mon Dec 17, 2012 6:31 pm
lolita wrote:try this
Code: Select all
function CleanBag()
for i, item in pairs(inventory.BagSlot) do
if item.SlotNumber >= settings.profile.options.INV_AUTOSELL_FROMSLOT + 60 and
settings.profile.options.INV_AUTOSELL_TOSLOT + 60 >= item.SlotNumber then
if item:isType("Arrows") then
item:delete()
end
if item:isType("Projectiles") then
item:delete()
end
if item:isType("Runes") then
item:delete()
end
if ( item:isType("Weapons") or item:isType("Armor") ) and (1200 > item.Worth and 3 > item.Quality) then
item:delete()
end
if item:isType("Potions") and (46 > item.RequiredLvl and item.RequiredLvl > 10) then
item:delete()
end
end
end
end
I want to delete from slot 7 to slot 30 ?
and it didnt work, I must put something in rom\userfunctions folder ?
Last edited by
mrtgtr on Mon Dec 17, 2012 6:44 pm, edited 1 time in total.
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#4
Post
by lisa » Mon Dec 17, 2012 6:36 pm
*Looks for the post I made about starting with the basics*
INV_AUTOSELL_FROMSLOT is in the profile and is the absolute basics of starting to work with this bot, I wish people would listen.
-
botje
- Posts: 656
- Joined: Wed Oct 27, 2010 7:17 am
#5
Post
by botje » Thu Dec 20, 2012 10:47 am
hmm, i like that potion thingy there, i would like to drop all useless potions because i can use better ones.
Code: Select all
if item:isType("Potions") and (player:level + 10 > item.RequiredLvl and item.RequiredLvl > 10) then
item:delete()
end
would that work?
-
botje
- Posts: 656
- Joined: Wed Oct 27, 2010 7:17 am
#6
Post
by botje » Thu Dec 20, 2012 11:43 am
Code: Select all
elseif item:isType("Potions") and item.RequiredLvl < player.Level - 10 then
item:delete()
end
that works
-
lolita
- Posts: 139
- Joined: Thu Oct 20, 2011 5:39 am
- Location: Serbia
#7
Post
by lolita » Thu Dec 20, 2012 1:55 pm
cod i posted work's fine for me, on blend and activate runes farm alt's
Life is a journey, not destination
-
botje
- Posts: 656
- Joined: Wed Oct 27, 2010 7:17 am
#8
Post
by botje » Thu Dec 20, 2012 1:56 pm
yes but yours is made with a fixed level, mine is determined by player.level xd
-
lolita
- Posts: 139
- Joined: Thu Oct 20, 2011 5:39 am
- Location: Serbia
#9
Post
by lolita » Thu Dec 20, 2012 1:58 pm
ye, tru, that's better
, think im gona use it too
Life is a journey, not destination
-
botje
- Posts: 656
- Joined: Wed Oct 27, 2010 7:17 am
#10
Post
by botje » Thu Dec 20, 2012 1:59 pm
i included it in my cleanbag function too, its nifty code ^^
great for alts
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#11
Post
by lisa » Thu Dec 20, 2012 5:49 pm
yep it is very handy code, looks familiar too
-
lolita
- Posts: 139
- Joined: Thu Oct 20, 2011 5:39 am
- Location: Serbia
#12
Post
by lolita » Mon Dec 24, 2012 8:33 am
how to make table of items for delete and use it from function.
something like this?
Code: Select all
local DeleteItem = {
[111222] = true,
[112211] = false,
[221122] = true,
[121212] = true,
[212121] = false,
[221111] = true,
}
function ClearBag()
local empties = inventory:itemTotalCount(0)
if 10 > empties then
item:delete(DeleteItem)
end
end
Life is a journey, not destination
-
botje
- Posts: 656
- Joined: Wed Oct 27, 2010 7:17 am
#13
Post
by botje » Mon Dec 24, 2012 8:56 am
lol... i was doing the exact same thing... xd
wanted to make a sort of database with items users can add to always delete.
Code: Select all
for k, v in ipairs(forcedrop) do
if v == item.Name then
item:delete();
end
end
would this work?
-
botje
- Posts: 656
- Joined: Wed Oct 27, 2010 7:17 am
#14
Post
by botje » Mon Dec 24, 2012 6:26 pm
Code: Select all
-- custom database for user added items to trow out
forcedrop = {
"Unknown Gift",
"Lost Gift",
"Sled Fragment",
}
for k, v in ipairs(forcedrop) do
if v == item.Name then
printf("Deleting Item: "..item.Name.."\n");
item:delete();
end
end
this code works ^^
-
lolita
- Posts: 139
- Joined: Thu Oct 20, 2011 5:39 am
- Location: Serbia
#15
Post
by lolita » Wed Dec 26, 2012 6:36 am
botje wrote:Code: Select all
-- custom database for user added items to trow out
forcedrop = {
"Unknown Gift",
"Lost Gift",
"Sled Fragment",
}
for k, v in ipairs(forcedrop) do
if v == item.Name then
printf("Deleting Item: "..item.Name.."\n");
item:delete();
end
end
this code works ^^
hm, idk how work for you
, but it give me an error
Code: Select all
attempt to index global 'item' (a nil value)
Life is a journey, not destination
-
botje
- Posts: 656
- Joined: Wed Oct 27, 2010 7:17 am
#16
Post
by botje » Wed Dec 26, 2012 6:47 am
Code: Select all
-- sell prize = value which drops all below it
-- rarity = / 0 = white / 1 = green / 2 = blue / 3 = purple / 4 = orange / 5 = gold
-- drop true/false = if allready learned recipes should be dropped
function CleanBag(sellprize, rarity, drop, logg)
inventory:update();
-- custom database for user added items to trow out
forcedrop = {
"Unknown Gift",
"Lost Gift",
"Sled Fragment",
}
if sellprize == nil then sellprize = 750 end;
if rarity == nil then rarity = 1 end;
if drop == nil then drop = false end;
if logg == nil then logg = true end;
for i, item in pairs(inventory.BagSlot) do
if item.SlotNumber >= settings.profile.options.INV_AUTOSELL_FROMSLOT + 60 and
settings.profile.options.INV_AUTOSELL_TOSLOT + 60 >= item.SlotNumber then
for k, v in ipairs(forcedrop) do
if v == item.Name then
printf("Deleting Item: "..item.Name.."\n");
item:delete();
end
end
if (item:isType("Weapons") or item:isType("Armor")) and sellprize > item.Worth and item.Quality < rarity then
printf("Deleting Item: "..item.Name.."\n");
if logg == true then
logInfo("CleanBag", "" ..player.Name.. ": Deleted: " ..item.Name.. "." , true)
end
item:delete();
elseif item:isType("Recipes") then
if RoMScript("GetCraftItemInfo("..item.Id..")") == nil and item.Quality < rarity then -- Don't have it
printf("Learning recipe: "..item.Name.."\n");
if logg == true then
logInfo("LearnRecipe", "" ..player.Name.. ": Learning recipe: " ..item.Name.. "." , true);
end
item:use();
yrest(5000);
else
if drop == true and item.Quality < rarity then
printf("Deleting Recipe: "..item.Name.."\n");
if logg == true then
logInfo("LearnRecipe", "" ..player.Name.. ": Deleting recipe: " ..item.Name.. "." , true);
end
item:delete();
end
end
elseif item:isType("Monster Cards") then
if not haveCard(item.Id) then
printf("Using card: "..item.Name.."\n");
if logg == true then
logInfo("UseCard", "" ..player.Name.. ": Using card: " ..item.Name.. "." , true);
end
item:use();
yrest(5000);
end
elseif item:isType("Potions") and item.RequiredLvl < player.Level - 10 then
item:delete()
elseif item:isType("Runes") then
item:delete()
end
end
end
end
-
lolita
- Posts: 139
- Joined: Thu Oct 20, 2011 5:39 am
- Location: Serbia
#17
Post
by lolita » Wed Dec 26, 2012 7:04 am
lol, i forget to add
Code: Select all
for i, item in pairs(inventory.BagSlot) do
thx botje it work now lika charm
Life is a journey, not destination
-
botje
- Posts: 656
- Joined: Wed Oct 27, 2010 7:17 am
#18
Post
by botje » Wed Dec 26, 2012 7:09 am
no problem
Who is online
Users browsing this forum: Bing [Bot] and 10 guests