Page 1 of 2
Lootoption addon w/filter
Posted: Wed Feb 22, 2012 2:55 am
by Romplayer
Ok so i made a loot addon. It is in alpha/beta stages b/c I am trying to incorporate the Lootomatic table into this addon so... also thinking of adding a logfile of what was thrown out.
Load in onload section or in profile startLootstuff()
disable it when switching WP or WP files with stopLootstuff()
can add filter through editing the .lua or using Lootstuffadd() or Lootstuffremove()
i.e. Lootstuffadd("link rune") would not toss out link runes
Lootstuffremove("link rune") would esp. toss out link runes even if over 5 stacked or looted
By default will not toss out stacked or looted items over 5.
This addon is not limited by receiving items by completion of events.
i.e if u recieve a "Wild Lilly" from a player it will also toss it out immediatly unless u have a stack of more than 5
This addon is meant to completely loot the bodies and immediatly toss out what was just looted.
For the most part it works, filter is untested but 5 items stacked has been tested as it won't toss out.
Update: I added a Lootomatic check and a option to loot by gold value above 1000 gold NOW IN BETA
if it doesn't work maybe i can call the saved varriables file through the in game functions frame.
BETA has code but hasn't been tested and needs the addon file
alpha/beta works but doesn't have Lootomatic check and option to loot by gold value
It seems to work but hasn't been tested b/c i have a ping of 6000ms
Note: this needs the D303fix or something to produce os.time
Re: Lootoption addon w/filter
Posted: Wed Feb 22, 2012 3:26 am
by Romplayer
Also i found that item preview has a table that allows u to read the item's worth so maybe i might try to incorporate tossing out items less than 1k gold.
Re: Lootoption addon w/filter
Posted: Wed Feb 22, 2012 12:41 pm
by Romplayer
item preview has a table that i don't know how to read from
ItemPreview_ListData = {
[227628] = {
["zones"] = {
[21] = 18,
},
["tip"] = {
["left"] = {
[6] = "Worth: 7,222 Gold",
[2] = "Tier 4",
[3] = "Requires Level 68",
[1] = "Plate Armor of the Ruins",
[4] = "Plate",
[5] = "Physical Defense 1005",
},
["right"] = {
[4] = "Upper Body",
[5] = "Magical Defense 704",
},
},
["mobs"] = {
["Thieving Ronin"] = 2,
["Thieving Handyman"] = 2,
["Trailing Chupura"] = 9,
["Thieving Spy"] = 5,
},
["date"] = "02/17/12",
["text"] = "Plate Armor of the Ruins",
["lvl"] = 68,
["id"] = 227628,
["color"] = "00ff00",
},
}
would i = ItemPreview_ListData[id]["tip"]["left"][6] give me i = "Worth: 7,222 Gold"
edit: yes it does.. This just might work
therefore Lootomatic_Settings["ItemFilter"]["name"] would yeild if the name is in item filter and Lootomatic_Settings["ItemFilter"]["loot"] would yeild action taken. 2 don't loot and 3 would loot
i sure hope i can access these variables from rombot
Re: Lootoption addon w/filter
Posted: Wed Feb 22, 2012 2:00 pm
by Romplayer
i came up with this general function to use with the ItemPreview ADDon not sure if it really works but i use ItemPreview-v1.17 not sure if the global variable is accessable by rombot
Code: Select all
function getValue(id)
local valuestring = ItemPreview_ListData[id]["tip"]["left"][6]
if valuestring ~= nil then -- checks if there is something there
local v1, v2 = string.find(valuestring, "Gold")
local v3, v4 = string.find(valuestring, "Worth:")
if v1 then
local value = string.sub(valuestring, v4+2, v1-2)
end
if v1 == nil then -- finds value if weapon or shield
valuestring = ItemPreview_ListData[id]["tip"]["left"][7]
if valuestring then
v1, v2 = string.find(valuestring, "Gold")
v3, v4 = string.find(valuestring, "Worth:")
value = string.sub(valuestring, v4+2, v1-2)
end
end
local v5, v6 = string.find(value, ",")
if v5 then -- removes the comma in thousands value as no item is over 9999
local value1 = string.sub(value, v5+1, v5+3)
local value2 = string.sub(value, v5-1, v5-1)
value = value2,value1
end
else
value = "false"
end
return value
end
Re: Lootoption addon w/filter
Posted: Wed Feb 22, 2012 7:28 pm
by lisa
Code: Select all
id = 207582
local value = RoMScript("getValue("..id..")")
Re: Lootoption addon w/filter
Posted: Wed Feb 22, 2012 8:07 pm
by Romplayer
lisa wrote:Code: Select all
id = 207582
local value = RoMScript("getValue("..id..")")
whats wrong? did it not work? it should work... im incorporating it into a rom addon so i can use it for the userfunction
Re: Lootoption addon w/filter
Posted: Wed Feb 22, 2012 8:31 pm
by Romplayer
i'll test out the Beta with the addon as soon as i finish downloading Rift... only 17 hrs to go

Re: Lootoption addon w/filter
Posted: Wed Feb 22, 2012 8:53 pm
by lisa
not sure if the global variable is accessable by rombot
I posted code that would access the function using rombot.
Re: Lootoption addon w/filter
Posted: Thu Feb 23, 2012 1:30 pm
by Romplayer
I donno if this will work.... I tested it once today and looted 3 items but it threw out a completely different item and only that one item. This will need lots of work... I'll try to tweak it this weekend
Ok it seems to work fine now... BETA that is
Note: I disabled the loot drop by value function b/c i was having problems of it freezing the whole Micromacro window.
one thing i notice is that it will drop the item multiple times on occasion... but other than that it works for multiple loots too
UPDATE: it works now!!! testing the loot drop by value < 1000
Re: Lootoption addon w/filter
Posted: Thu Feb 23, 2012 5:12 pm
by Romplayer
Im not sure if the loot drop by value works... I think i need to find another way to get the tooltip info.........
From the looks of it ItemPreview uses a SOL addon to get frames info text and stuff sooooo idk looks like i have to spend hours trying to find the code..
But the rest works! ESP with Lootomatic ... Soon i might remove the stack of 5 limitation.
hmm seems it doesn't work... I think RoMScript only can return numbers so i guess i'll have to edit my addon code.
seems i can send a variable thru RoMScript....
i donno anymore... filtercheckd = RoMScript('getfilter(name);') keeps giving me a nil
I think im gonna give up. at most this will filter items u specify aww well
i donno i might have fixed it needed a ; somewhere
Re: Lootoption addon w/filter
Posted: Thu Feb 23, 2012 6:40 pm
by BillDoorNZ
hmm....I just use Lootfilter++, modded it a bit to make it easier to add/remove from picklist and droplist and added in a 'clear' option to reset it. Then I just send a sendMacro("/lf add "..itemname..")");
but then, that doesn't solve the problem of throwing out the trash - for that I use the CleanBag userfunction that botje wrote:
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2849
Re: Lootoption addon w/filter
Posted: Fri Feb 24, 2012 6:26 pm
by kuripot
how can i set by category...??? i wanted to throw all that item... because i only using backpack I,II
i mean all runes I,II,III
and also all production runes
arrows..
other ammunition
recipes
armors and weapon
Re: Lootoption addon w/filter
Posted: Fri Feb 24, 2012 9:02 pm
by Romplayer
by default it throws out everything looted... as long as it isn't stacked 5 or more... or u can write specific names in the .lua file to throw out in the mustDelete variable use " " and a comma so "Link Rune",
the names in mustDelete will ignore the stack of 5.
I can't get the rom addon to work right now with the userfunction i think it has to do with non caps. So it should work without the Rom addon...
Re: Lootoption addon w/filter
Posted: Sat Feb 25, 2012 3:55 pm
by Romplayer
OK! this beta works with lootomatic and itempreview
need the new rom addon and userfunction
Note: i think i had to use caps on the function in the Rom addon and had to tripple check my RoMScript syntax
Note: Fully Functional with some erroneous code
Safe to use in profile <onload> section just insert startLootstuff() I do..
Re: Lootoption addon w/filter
Posted: Sat Feb 25, 2012 9:43 pm
by rock5
If I understand correctly, you have the event monitor running every 2 seconds. Even though I wrote the event monitor code, I never liked using it because it uses RoMScript to check the in game event log. RoMScripts are very slow so I wouldn't be surprised if it interferes a bit with the smooth running of the bot; maybe causing it to pass waypoints, not stop running when it's supposed to, etc. Maybe it needs to be every 2 seconds but I'm just a bit worried about this. Seeing as you get loot from killing stuff, maybe you could just run it after combat?
You should probably put the addon in folder in the compressed file. Not everyone will know to make a folder to put it in.
Re: Lootoption addon w/filter
Posted: Sun Feb 26, 2012 5:36 pm
by Romplayer
Ok this version is almost perfect..
Changes: I removed the Itempreview need and made my own tooltip check (requires SOL which is included in the addon .rar) So it is now able to check value all the time. It still does the Lootomatic check if u have it and not drop stacks of 5 or greater.
I'll name this version V .8 b/c it is working as intended and almost ready for V 1.0 which will be the final version.
Note: I had problems with Romscript synatax so i moved around the functions for value checking (a lot) finally, i figured out the syntax and got it working but not to what i originally had it at. Thus, V .8 and not V .9
V .9 would be when i set the functions back to original state and V 1.0 will be when i remove all the unneeded lines from major Debuging.
So without adue I give u fully functional V .8
*Update* I noticed that the Lootomatic function when called by RoMscript always gave me a false negative so im working on it will post V .8 when done
Well at least i got the values finally working... fix one and notice the other don't work right...*sheesh*
Re: Lootoption addon w/filter
Posted: Sun Feb 26, 2012 6:02 pm
by Romplayer
i dont effing get it.. the addon works in game but my RoMscripts call is crap for syntax... RoMScript("ValueTxt('"..name.."');"); finally got it to work but RoMScript('GettFilter("..name..");'); doesn't seem to work nor will RoMScript("GettFilter('"..name.."');"); <-- this one won't even function at all it freezes the MM window and the other one just spits out the same thing but if i check it in game it gives me a correct value
wth i hate this crap it'll take me at least another day to figure this crap out
Re: Lootoption addon w/filter
Posted: Sun Feb 26, 2012 6:24 pm
by Romplayer
ok im gonna give up i touched the one and it stopped working.. im not sure but its def.. a RoMscript problem
i give up i tried all possible combinations using " and ' in different places in RoMScript( ... ) some would work but spit out a incorrect number meaning it isn't using the function properly. Sometimes it will invalidate the next use of RoMScript and making my last day of work fault which makes me nervous. I don't think i'll release the version until this gets ironed out.
It makes me mad... reminds me when i failed my C programming class in highschool.
Re: Lootoption addon w/filter
Posted: Sun Feb 26, 2012 7:29 pm
by lisa
Romplayer wrote: RoMScript('GettFilter("..name..");'); doesn't seem to work nor will RoMScript("GettFilter('"..name.."');");
Ok so first question, is it GettFilter or GetFilter ? lol
What is the in game function you want to call, exactly?
GettFilter("Link Rune")
?
If so do this
Code: Select all
RoMScript("GettFilter(\""..name.."\");");
Re: Lootoption addon w/filter
Posted: Sun Feb 26, 2012 8:22 pm
by Romplayer
OMG.. Lisa u are some kinda genius.. how did u know slashes.... I didn't even think of slashes.... Now that i think about it this was one part of my C class i always failed at.. that and not studying... but studying doesn't help when u don't understand it so it is like looking at junk and memorizing doesn't help..
U are AMAZING!!! BTW it works now.
and yes it is Gettfilter cuz i didn't want to accidentally call any Get* from the rom api

I still don't understand why the other function works like it does but doesn't work with the Gettfilter one b/c im still just sending the same string or whatever who cares now it works!
Uploading the Full version V .8
Note: V .8 prints out debug info a 1 or 0 if in Lootomatic + the value of the item looted And it should all work as intended. Thanks so much Lisa