Question about spaces in INV_AUTOSELL_IGNORE

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Question about spaces in INV_AUTOSELL_IGNORE

#1 Post by rock5 » Sat Mar 27, 2010 7:55 am

It was my understanding that if I use this;

Code: Select all

<option name="INV_AUTOSELL_IGNORE"	value=" V, IV, III,Power II,Endurance II,Resistance II,Elemental Spirit Stone,Spirit Herb" />
then item names with " V" and " IV" wont sell but names with "V" and "IV" will sell.

Am I wrong? Because I have a "Protective Dagger" and it wont sell unless I remove the " V, IV" options.

If so, is there a way to make it work?
Last edited by rock5 on Sat Mar 27, 2010 9:09 pm, edited 1 time in total.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

unicron
Posts: 38
Joined: Fri Mar 05, 2010 3:29 pm

Re: Question about INV_AUTOSELL_IGNORE

#2 Post by unicron » Sat Mar 27, 2010 9:43 am

That is for names, you want this one for stats. Here you can use mine. Add to it whatever.

Code: Select all

<option name="INV_AUTOSELL_STATS_NOSELL" value="X, Authority, Rigor, Endurance, Oppresion, Cougar, Savage, Force, Barbarian, Hammer, Fang, Keen, Observance, Paladin, Defender, Reflex, Agility, Thunder, Illumine, Darkness, Mind, Mystic, Warlock, Soul, Shield, Sage, Blood, Rage, Precision, Speed, Fox, Crystal, Savant, Armor, Assault, Aureola, Bite, Blaze, Break, Constraint, Cruel, Dedication, Elder, Eruption, Excellence, Fright, Genius, Glory, Guard, Gulp, Inhibition, Inquisition, Mage, Mirage, Pioneer, Prophet, Ravage, Razor, Redemption, Repentance, Return, Slaughter, Speculation, Suppression, Surrender, Trial, Whip, Witt, of the Lost" />
.. also don't forget you may want to put in.

Code: Select all

<option name="INV_AUTOSELL_QUALITY" value="white,green" />
Unless you want to keep green quality items.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Question about INV_AUTOSELL_IGNORE

#3 Post by rock5 » Sat Mar 27, 2010 10:14 am

I know it's for names. I use it to stop selling runes. eg. Endurance III, Power IV, etc

So can you please answer the question? Are leading spaces included? If not, is there a way I could include it? Maybe some sort of wild-card or pattern option?

ps. Nice stat list.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

unicron
Posts: 38
Joined: Fri Mar 05, 2010 3:29 pm

Re: Question about INV_AUTOSELL_IGNORE

#4 Post by unicron » Sat Mar 27, 2010 11:06 am

I do not know if ", V" (double space) Would work vs ", V". (single space) You could try it though. I just throw in each item in my list individually. It is a pain, but it only needs to be done once.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Question about INV_AUTOSELL_IGNORE

#5 Post by Administrator » Sat Mar 27, 2010 12:47 pm

I believe leading spaces are counted. If not, let me know.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Question about INV_AUTOSELL_IGNORE

#6 Post by rock5 » Sat Mar 27, 2010 1:23 pm

At first I couldn't work out where the spaces were being removed but then I broke down the code and did some testing and found the problem line. Line 347 of inventory.lua

Code: Select all

local hf_explode = string.gsub (settings.profile.options.INV_AUTOSELL_IGNORE, "%s*[;,]%s*", "\n");	-- replace ; with linefeed
A simple fix for me would be to remove the %s* from the pattern but I realize that it is working as intended.

Your idea of using double space is a good one though. At the moment the pattern removes all spaces. If you replace the * with a ? then it will only remove 1 space so you can use the double space idea. So the pattern would look like this "%s?[;,]%s?". I've tested it and it works.

So to recap. With my fix;
if you don't use leading spaces it works,
if you use leading or ending spaces to space out your list they get removed and it works,
if you want to match a leading space you use a double space so 1 of them gets removed and it works.

What do you think?

ps. The reason you might think it works is because it doesn't remove the leading space from the first name as it is not next to a comma. If you put a name with a leading space in the middle of your list it will remove the space.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Question about INV_AUTOSELL_IGNORE

#7 Post by Administrator » Sat Mar 27, 2010 5:47 pm

Sounds good to me. A better option might be to use an escape character or sequence, like "[SPACE]Itemname".

I'll wait before implementing this to give people a chance to test it further and get some more input.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Question about spaces in INV_AUTOSELL_IGNORE

#8 Post by rock5 » Sat Mar 27, 2010 9:33 pm

Administrator wrote:Sounds good to me. A better option might be to use an escape character or sequence, like "[SPACE]Itemname".
Maybe. But maybe using anything but spaces would not be intuitive.
Administrator wrote:I'll wait before implementing this to give people a chance to test it further and get some more input.
It's a fairly small change. I think most people wont even notice. Maybe you wont get much feedback unless you ask them for it?

Hold on a second. I was just thinking about making the same changes to INV_AUTOSELL_STATS_SELL and INV_AUTOSELL_STATS_NOSELL but they use a different pattern.

Seems to me the proper programming behavior should have them behaving similarly for better consistency. If "[;,]" is good enough for these 2 variables why not use it with INV_AUTOSELL_IGNORE? I don't see any reason why it should be different and it would be the simplest fix.

That way, exactly what you type is exactly what it matches for. Just like the stats variables.

What do you think
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 6 guests