Unable to find "Expedition Team Scout"

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
klubi
Posts: 10
Joined: Sun Jul 24, 2011 10:55 am

Unable to find "Expedition Team Scout"

#1 Post by klubi »

The bot is unable to find this merchant, but it finds "Diloss" the NPC near him.

npcname = RoMScript("TEXT('Sys114291_name')"); yrest(500) -- ie. "Expedition Team Scout"
player:merchant(npcname);

also

player:merchant("Expedition Team Scout");

doesn't work.

Anyone how knows this problem and how to deal with it?

Thank you for your help :)
SpiralV
Posts: 72
Joined: Sat Jun 25, 2011 10:37 am
Location: Germany

Re: Unable to find "Expedition Team Scout"

#2 Post by SpiralV »

I would try

player:merchant(114291);

or

player:merchant("Expedition");
klubi
Posts: 10
Joined: Sun Jul 24, 2011 10:55 am

Re: Unable to find "Expedition Team Scout"

#3 Post by klubi »

player:merchant(114291);

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

Re: Unable to find "Expedition Team Scout"

#4 Post by rock5 »

klubi wrote:player:merchant(114291);

works well, thank you
That's good. I'm still curious why

Code: Select all

player:merchant("Expedition Team Scout");
didn't work. You are on an English client right?
  • 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
klubi
Posts: 10
Joined: Sun Jul 24, 2011 10:55 am

Re: Unable to find "Expedition Team Scout"

#5 Post by klubi »

I'm on the European Client with german as Ingame language, but I tried it on german and on english with the full name and a short version
player:merchant(114291);
is still the only function that works
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Unable to find "Expedition Team Scout"

#6 Post by rock5 »

I just translated the name and see that in german it includes a hyphen '-'. Hyphens have special meaning when doing string comparisons.
Try replacing it with a period '.' A period means "any character". That should work.

In future if you have similar problems just try replacing any suspect characters with periods.
  • 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: 5344
Joined: Sat Jan 05, 2008 4:21 pm

Re: Unable to find "Expedition Team Scout"

#7 Post by Administrator »

rock5 wrote:I just translated the name and see that in german it includes a hyphen '-'. Hyphens have special meaning when doing string comparisons.
Try replacing it with a period '.' A period means "any character". That should work.

In future if you have similar problems just try replacing any suspect characters with periods.
Is there any reason why this is needed in this particular case? Couldn't we just set the 4th parameter to true so that patterns cannot be used, or is this actually used somewhere?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Unable to find "Expedition Team Scout"

#8 Post by rock5 »

Administrator wrote:Is there any reason why this is needed in this particular case? Couldn't we just set the 4th parameter to true so that patterns cannot be used, or is this actually used somewhere?
Good point. Merchant would only ever get a name for an argument. I don't see the need for any special pattern matching features. But untumately the base function is findNearestNameOrId. I don't know if it would be wise to block pattern features with such a far reaching function. I certainly couldn't say for sure that it would be safe to do so.

If we think that merchant wouldn't be used with special pattern matching, maybe we could fix the string with a general purpose string fixing function that fix all the special characters? Or does a function like that already exist?
  • 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: 5344
Joined: Sat Jan 05, 2008 4:21 pm

Re: Unable to find "Expedition Team Scout"

#9 Post by Administrator »

rock5 wrote:If we think that merchant wouldn't be used with special pattern matching, maybe we could fix the string with a general purpose string fixing function that fix all the special characters? Or does a function like that already exist?
Not that I'm aware of. Could just use string.gsub() to replace certain characters with an escaped representation, though.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Unable to find "Expedition Team Scout"

#10 Post by rock5 »

That's exactly what I mean. I know there are functions like that, to do with converting strings for differnt languages but I wasn't sure if there was one just for this purpose.

Ok, so what do we call it? ConvertName FixName FixString? What characters need to be fixed? Just ' " -? Any others?

What should it be used for? merchant, target_npc? Any others?
  • 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: 5344
Joined: Sat Jan 05, 2008 4:21 pm

Re: Unable to find "Expedition Team Scout"

#11 Post by Administrator »

Well, obviously, the best solution would be the simplest. I can't really see any place you would need the patterns in findNearestNameOrId(). I mean, if you want to look for say "Brown Bear" and "Young Bear", you could just search for "Bear", so you wouldn't need the .* pattern.

If we really need to, I guess we could just replace the patterns. What other special characters might appear in NPC names?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Unable to find "Expedition Team Scout"

#12 Post by rock5 »

Administrator wrote:I can't really see any place you would need the patterns in findNearestNameOrId().
On second thought, maybe your right. I can't think of any use for it.
  • 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