party.lua bugs

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
pman
Posts: 59
Joined: Thu Jul 28, 2011 10:44 am

Re: party.lua bugs

#41 Post by pman » Sun Jul 15, 2012 11:35 am

lisa wrote: Do you hold down the keys or just do a quick press?
I noticed with (1) if I hold the key down it spams the code constantly, was still accurate for me though.
a "normal" keypress, i am young enough to keep my fingers under control ;) but all in all (1) is ok, with some chars the order is strange, char2 bevore char1 and char 1 comes twice. with the two english names (1) looks good, 1x Char1 then 1x Char2.
lisa wrote: That name should have been gotten directly from the Memory I suspect as the UI, try removing all addons except for the ingamefunctions and start up client again. It is possible an addon is messing with it.
Tried it, looks the same as before, (2)(3) scrambled, with two english named chars standing next to each other.

pman
Posts: 59
Joined: Thu Jul 28, 2011 10:44 am

Re: party.lua bugs

#42 Post by pman » Sun Jul 15, 2012 12:34 pm

The strange thing is, with umlauts in name (for example ä and ß) only the umlauts gets scrambled in (2) and (3), the rest of the name is ok. But when i use english names, for example "abcdefghijklmnop" then i get for example only 4 cryptic literals in (2) and (3), so the length is not compareable.

Another question, is there anywhere a limitation in name length?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party.lua bugs

#43 Post by lisa » Sun Jul 15, 2012 7:21 pm

I had a response typed up but it didn't post =(

So short answer, the reading from memory function is part of MM and I don't know how it works exactly, Admin would know it best.

Are you using Linux or Mac?
Are the names very long?
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party.lua bugs

#44 Post by lisa » Sun Jul 15, 2012 10:58 pm

I just created a char using maximum letters allowed in name and still worked perfectly.
1 has name of Eishoidfgfdgfdgg

Actually not so perfect lol
Party member 1 has the name of (bÆ,

Player has name of Char1
Party member 1 has name of (bÆ,

Have you tried removing all addons except ingamefunctions?
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party.lua bugs

#45 Post by lisa » Sun Jul 15, 2012 11:35 pm

Ok I have some progress, this was a pain in the butt lol

So here is the story, if the name of the character is to long then the address that GetPartyMemberName(_number) gets is actually a pointer where the name is kept where as normally GetPartyMemberName(_number) gets the actual name.


This might take some looking in to as to how to deal with it but yes I can confirm the long name is the issue.

Maybe Rock has an idea for this but this is what I see at this early stage on investigation.
partylongname.png
Ok so top name is to long and so it points to another address that has the name
Second name contains the actual name as a string.

Main difference I see first is
4 bytes after where the name should be is 00000000, I would need to check what is after a name with few letters to see if it will also have the 00000000 after the name.

Ok checked and 4 letter name has 00000000 after it aswell.

This just gets worse and worse.

Once a name with to many letters has been in a spot of party then that spot ALWAYS has a pointer to the name held elsewhere, regardless of it party is disbanded and reinvited.
So once a long name has been in any position in party it is messed up until client restarts.

So basically if we are going to allow for long names then function GetPartyMemberName(_number) needs to be rewritten to allow for it being a pointer or string at the address.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

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

Re: party.lua bugs

#46 Post by rock5 » Mon Jul 16, 2012 1:59 am

Finally, you figured out the problem. That must have been getting fustrating, for both of you. So the problem has always been with names that are too long? So what's the maximum name length before it becomes a pointer?

The first solution I can think of is; if there are only 4 characters then check if all 4 are valid allowed characters. The odds are probably small that an address would be made up of all valid characters I think. Then goto the address and see if it holds a 1 word string. That's a bit messy though. It's a shame that the game allows 4 letter names or we could have just used the length to tell if it's a pointer or not.

How about checking the rest of the memory area? I see from the code that the memory area is 0x60 in size. Maybe there is some indicater whether it's a name or a poimter. In your picture, for example, I see one has a 1F and the other has a 0F. Maybe that's it. Or just compare the memory of names that are short and those that are long and see what you come up with.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party.lua bugs

#47 Post by lisa » Mon Jul 16, 2012 2:04 am

rock5 wrote:How about checking the rest of the memory area? I see from the code that the memory area is 0x60 in size. Maybe there is some indicater whether it's a name or a poimter. In your picture, for example, I see one has a 1F and the other has a 0F. Maybe that's it. Or just compare the memory of names that are short and those that are long and see what you come up with.
Yeah been testing it out and nothing conclusive yet, still working on it.

For now I have replaced the partytable getting party names with RoMScripts, so pman give this a test, this is by no means what I want to use in the end but it might keep you going.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

pman
Posts: 59
Joined: Thu Jul 28, 2011 10:44 am

Re: party.lua bugs

#48 Post by pman » Mon Jul 16, 2012 4:04 am

Hi, cool lisa, i test this in a few hours, when i get home.

As i see it, there are 2 probs rock:
1) long names (short german names are nearly impossible (allready used), except some things like "sdfkja", which are banned directly, because goldsellers use them :D)
2) (1) vs (2)(3) with umlauts in names. (1) is ok, (2)(3) replaces the umlauts with special characters

Update: Addons and PC are not to blame (tested on 2 PC's with and without Addons), last working char name length is 15 (16 results in much the same as lisa postet, 4 cryptic literals)

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party.lua bugs

#49 Post by lisa » Mon Jul 16, 2012 5:14 am

K all fixed, revert all files back to default and then use this functions.lua

Yes they had maximum 16 characters and 15 worked fine but the 16th is what caused the issue.

Tested with characters like Ý and worked fine, not sure about german characters.
Attachments
functions.lua
(60.41 KiB) Downloaded 167 times
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

pman
Posts: 59
Joined: Thu Jul 28, 2011 10:44 am

Re: party.lua bugs

#50 Post by pman » Mon Jul 16, 2012 7:48 am

tested everything again, long names work now, thanks for that. German literals (äöüß) still do not work. (1) is ok, with (2)(3) the literals get scrambled. So for me this is still a big move forward, because i have many chars with long names ;)

have a nice day

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party.lua bugs

#51 Post by lisa » Mon Jul 16, 2012 9:34 am

The print from 2 and 3 arn't hugely important, did the 4 and 5 work though, that is the important thing.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

pman
Posts: 59
Joined: Thu Jul 28, 2011 10:44 am

Re: party.lua bugs

#52 Post by pman » Mon Jul 16, 2012 9:50 am

with umlauts (äüö) and ß > false, with long charnames > true

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

Re: party.lua bugs

#53 Post by rock5 » Mon Jul 16, 2012 10:33 am

If I understand correctly (1) shows the names using object table search but (2) and (3) are printing the names from the party functions. This is confusing as I thought both just read strings from memory.

After having a closer look are how (1) reads the name, I found this bit of code in object.lua

Code: Select all

		if( bot.ClientLanguage == "RU" ) then
			self.Name = utf82oem_russian(tmp);
		else
			self.Name = utf8ToAscii_umlauts(tmp);	-- only convert umlauts
--			self.Name = convert_utf8_ascii( tmp )	-- convert the whole UTF8_ASCII.xml table
		end
Is it possible this has something to do with it? Maybe you need to do the same with the party function names.
  • 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

pman
Posts: 59
Joined: Thu Jul 28, 2011 10:44 am

Re: party.lua bugs

#54 Post by pman » Mon Jul 16, 2012 4:29 pm

So, i have tested it for a while now, i get a strange error. (about 10 times per hour)
party.lua:152 attempt to index field (?) a nil value

with 4 members, so the for in the code should work... and with the new functions.lua

Update: debuged it a bit, the crash occurs only for the char with the long name, he is party member 4 and i==4 when the crash occur

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party.lua bugs

#55 Post by lisa » Mon Jul 16, 2012 8:51 pm

Ok 2 new files to test out, see if they help.
Attachments
party.lua
(4.65 KiB) Downloaded 172 times
functions.lua
(59.25 KiB) Downloaded 169 times
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

pman
Posts: 59
Joined: Thu Jul 28, 2011 10:44 am

Re: party.lua bugs

#56 Post by pman » Tue Jul 17, 2012 7:23 am

thanks, will test that as soon as the server maintainance with the new patch is done and the new adress offsets were figured out :)

pman
Posts: 59
Joined: Thu Jul 28, 2011 10:44 am

Re: party.lua bugs

#57 Post by pman » Wed Jul 18, 2012 9:48 am

Tested äüöß, works great now (1-5 is ok), thanks, the only thing i cannot test now is the error in the "for" loop for the long charname, our server is patched to death, so i have to wait till they fix all this shit...

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party.lua bugs

#58 Post by lisa » Sat Jul 21, 2012 11:44 pm

I commited those changes to rev 728, so you should be able to do a revert when you update and have all green ticks again.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests