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

party.lua bugs

#1 Post by pman » Fri Jul 13, 2012 7:36 am

line 37: _timexx = os.time() //if you reset the time here, you will allways get the name of the first groupmember only

furthermore if i add the fourth member in the group, the names of the first one gets wrong, maybe of the others too, but i have only the name of the first one, because of line 37 ;)

example what i mean:
3 characters in grp -> everything works -> the posted name of the first member every 60 secs is ok
4 characters in grp -> checkparty waits, even tho characters stand next to each other -> the posted name of the first member every 60 secs looks partly unreadable -> so checkparty fails.

have a nice day ;)

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

Re: party.lua bugs

#2 Post by lisa » Fri Jul 13, 2012 7:47 am

It comes down to how you use the party code.
The party member info is redone every time you call PartyTable(), so if your code doesn't call the function regularly then yes you will get old information.


An example is in PartyHeals(), inside the while loop it calls PartyTable() and so it is done regularly.

So how do you use the party code?
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

#3 Post by pman » Fri Jul 13, 2012 8:32 am

Code: Select all

for i = 1, 5 do
		if _firsttimes == nil then -- post party names when bot started
			if GetPartyMemberName(i) ~= nil then
				cprintf(cli.yellow,"Party member "..i.." has the name of ")
				cprintf(cli.red, GetPartyMemberName(i).."\n")
				_firsttimes = true
			end
		end
	
		if os.time() - _timexx >= 60  then --only post party names every 60 seconds
			if GetPartyMemberName(i) ~= nil then
				cprintf(cli.yellow,"Party member "..i.." has the name of ")
				cprintf(cli.red, GetPartyMemberName(i).."\n")
			        _timexx = os.time()
			end
		end

		if GetPartyMemberName(i) then
			table.insert(partymemberName,i + 1, GetPartyMemberName(i))
			table.insert(partymemberObj,i + 1, player:findNearestNameOrId(partymemberName[i + 1]))
			if partymemberObj[i + 1] then
				table.insert(partymemberpawn,i + 1, CPawn(partymemberObj[i + 1].Address))
			end
		end
	end
you should not reset the time (_timexx = os.time()), until the for loop is done, otherwise you will not post the names of group member 2...5 ;)

and i use checkparty() only which calls PartyTable()

If you can correct and submit it, i can debug the problems with 4+ partymembers more easy.

best regards

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

Re: party.lua bugs

#4 Post by lisa » Fri Jul 13, 2012 8:50 am

Actually it was intended to only print the first party member, I originally had it print them all but I got sick of seeing all the names being printed, I used to do full party DoD runs. I also used to have it print it every time and not every 60 seconds. So making it only print first name and only print every 60 seconds was to reduce MM print spam.

You said it was printing incorrect names though, that is what I was worried/curious about as I never had that happen to me.

--=== Edit ===--
Also make sure to have a yrest of atleast 500 (half second) in any checkparty loop.
ie.

Code: Select all

repeat
yrest(500)
until checkparty(100)
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

#5 Post by pman » Fri Jul 13, 2012 10:17 am

yeah, i use yrest(1000), so that should not be the problem.

the bug with the 4+ members isn't pretty at all, when i add the 4th member, the name of the printed member is partly garbish, so checkparty cannot this first member (and maybe the others) any more. when i remove the 4th from party again, its stays buggy, even if i restart all bots. when i relog all 3 chars and start everything new, it works again. i am trying to find out why, but i have no plan where to start.

all i do is to invite the members, check myself if they are in a group, when true enter the ini, wait for loadingscreen and then a few seconds, then comes the checkparty repeat. and there it gets dirty with 4+ members :D

CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Re: party.lua bugs

#6 Post by CNKTHoward » Fri Jul 13, 2012 11:16 am

my best bet is that the

Code: Select all

function checkparty(_dist)
function is kinda messing up things. I cannot debug but I think the table partymemberpawn gets corrupted or something, because it hasn't got enough time to save all the chars.

Btw, you said you had full DoD runs - how did you manage do make all the groupmembers wait for each other inside, if it's obviously bugging.

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

Re: party.lua bugs

#7 Post by pman » Fri Jul 13, 2012 11:39 am

i tested this a litte bit now, with different chars and different orders which i invite them, checkgroup() bugs always on the 4th char, so the invite order does matter. And it always scrambles the first 5 literals of the membernames.

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

Re: party.lua bugs

#8 Post by lisa » Fri Jul 13, 2012 7:05 pm

CNKTHoward wrote:Btw, you said you had full DoD runs - how did you manage do make all the groupmembers wait for each other inside, if it's obviously bugging.
This was back before I actually made the checkparty code, back then I used to use a combinations of buffs and party chat monitoring, far more complicated than the checkparty.
pman wrote:i tested this a litte bit now, with different chars and different orders which i invite them, checkgroup() bugs always on the 4th char, so the invite order does matter. And it always scrambles the first 5 literals of the membernames.
Looks like I might have to update my old PC's, haven't actually used more than 2 chars in a long time, I don't even play the game anymore, just log in to test things for people.

I went over the party.lua code a few times and I can't find a fault in it to do this, I am thinking that maybe when you get to the 4th group member the memory changes some how. I just can't think of anything else that will do it.

I won't be able to test it for a while as I will need to update the clients on my old PC's to load a full party.

In the mean time you could play around with this file for me, just test it while having more or less party members.
When you start it there will be a print of what to do.

It has a 1 second delay between recognising key presses so you don't get spammed with prints.
Attachments
partytest.xml
untested.
(1.21 KiB) Downloaded 147 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

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

Re: party.lua bugs

#9 Post by lisa » Fri Jul 13, 2012 10:08 pm

I managed to get 4 chars going on this laptop, removed all models and anything else not needed.

It ran perfectly using that WP I posted for testing, I even made chars teleport elsewhere using snoop and it still worked exactly as intended, no weird names.

I did find/replace with actual char names for char1, char2 and so on.
I even logged off the chars and kept them in party and still worked as intended, only printed the names of chars still logged on. The partytable() print did print the name of the logged off char but that was expected.

Code: Select all

We use the normal waypoint path partytest.xml now.
GM detection started
Press numpad 1 to update party table names
Press numpad 2 to print party names
Press numpad 4 to checkparty(100)
Press numpad 5 to checkparty(200)
Press Ctrl + L to exit
Party member 1 has the name of Char2
1 has name of Char1
2 has name of Char2
3 has name of Char3
4 has name of Char4
true
true
1 has name of Char1
2 has name of Char2
3 has name of Char3
4 has name of Char4
1 has name of Char1
2 has name of Char2
3 has name of Char3
4 has name of Char4
Party member 1 has the name of Char2
1 has name of Char1
2 has name of Char2
3 has name of Char3
1 has name of Char1
2 has name of Char2
3 has name of Char3
Party member 1 has the name of Char2
Party member 1 has the name of Char2
1 has name of Char1
2 has name of Char2
3 has name of Char3
4 has name of Char4
1 has name of Char1
2 has name of Char2
3 has name of Char3
4 has name of Char4
1 has name of Char1
2 has name of Char2
3 has name of Char3
4 has name of Char4
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
4 has name of Char2
1 has name of Char1
2 has name of Char3
3 has name of Char4
4 has name of Char2
Party member 1 has the name of Char3
Party member 1 has the name of Char3
true
true
1 has name of Char1
2 has name of Char3
3 has name of Char4
4 has name of Char2
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
Party member 1 has the name of Char3
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
false
false
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
4 has name of Char2
Party member 1 has the name of Char3
1 has name of Char1
2 has name of Char3
3 has name of Char4
4 has name of Char2
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

#10 Post by lisa » Fri Jul 13, 2012 11:52 pm

There is only one thing that comes to mind to cause the weird names.

Basically the bot uses the GetPartyMemberName() which gets the party names directly from memory and then it looks for pawns with that name in memory range.
So only thing I can think of is that the GetPartyMemberName() address changes at the exact time that you are doing partytable and so it gets incorrect values.
I can only think of one occasion where it would happen is if you are changing zones at the time you use checkparty(), maybe try adding in a 2 second yrest before doing the checkparty loop.
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

#11 Post by pman » Sat Jul 14, 2012 6:34 am

morning :)

so I first will test this with 3 chars in a group

3 chars;

Code: Select all

numpad 1:
-> Party member 1 has the name of
more of numpad 1:
-> no output

numpad 2: (more of numpad 2: always this output)
-> 1 has name of Char1
-> 2 has name of Char1

numpad 4:
-> false

numpad 5:
-> false
doesnt look so good, im going to do this again with a char without umlauts


update:
test with 2 new logged in chars in my house (no umlauts or strange things in char names)

Code: Select all

numpad 1:
-> Party member 1 has the name of (something i cannot read)
more of numpad 1:
-> no output

numpad 2: (more of numpad 2: always this output)
-> 1 has name of Char1

numpad 4:
-> false

numpad 5:
-> false
looks worse than the first test

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

Re: party.lua bugs

#12 Post by pman » Sat Jul 14, 2012 7:12 am

test with the 3 chars i have used before, where it worked fine:

Code: Select all

numpad 1:
-> Party member 1 has the name of Char2
more of numpad 1:
-> no output

numpad 2: (more of numpad 2: always this output)
-> 1 has name of Char1
-> 2 has name of Char2
-> 3 has name of Char3

numpad 4:
-> true

numpad 5:
-> true
now it works fine

Update:
added 1 more char to the working ones:
4 chars:

Code: Select all

numpad 1:
-> Party member 1 has the name of Char2
more of numpad 1:
-> no output

numpad 2: (more of numpad 2: always this output)
-> 1 has name of Char1
-> 2 has name of Char2
-> 3 has name of Char3

numpad 4:
-> false

numpad 5:
-> false
So I think it's not the order or the number of members, its the chars themselfes.

My best bet is, that some chars somehow have not the right adress and kill the party.lua code...

Update2:
I don't know if this is has something to do with it, but the working chars are at least 1-2 years old, the others are pretty new, but i have not enough old chars to be sure of this...

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

Re: party.lua bugs

#13 Post by lisa » Sat Jul 14, 2012 7:58 am

numpad 2 will only print names of party members in memory range, if they are out of range it won't print their names. Also need to do Numpad 1 to update the names, so just doing numpad 2 repeatedly will just print the same thing for ever, or until updated.

umlauts may affect it, hard to say.

I doubt the age of the characters would affect anything.

I am going to add a numpad 3, probably tomorrow, to print all names in party direct from memory using the GetPartyMemberName()
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

#14 Post by pman » Sat Jul 14, 2012 5:35 pm

yeah, i know what i tried with your code, i have read it, i tried to update (1) and print it (2) more times, to make sure, that the result is the same ;)
i have tried one more ols char today, it worked, so i tried to make a new one, and it failed. so i cannot say anything like before :)
yeah, that would be nice.

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

Re: party.lua bugs

#15 Post by lisa » Sat Jul 14, 2012 8:12 pm

Ok new test file.
numpad1 just updates table and prints first name
numpad 2 now also updates party table first
numpad 3 prints party names direct from memory even if they are logged off but still in party
numpad4 still check party 100, fill return false if any chars in party are offline or out of range
numpad5 same as numpad4 but range 200.

I tested this for about an hour, 4 chars, 1 was brand new, as in literally just created it for this, a dwarf.
It worked perfectly for me the entire time.
partytest.xml
(1.76 KiB) Downloaded 159 times
So I guess I need to ask more questions as I cannot find any faults in the code.

1. Are you using latest rombot files and all files have green SVN tick?
2. Are you on a server running an old client?
3. are you on a non-english client version?
4. Do any chars have special characters in their name?
5. Do you poke out your tongue when typing?
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

#16 Post by lisa » Sat Jul 14, 2012 8:20 pm

Made a character with a special letter in it, Ý and MM prints it as ├¢

It still worked though, I still can't find any faults in the code.
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

#17 Post by pman » Sat Jul 14, 2012 8:22 pm

lisa wrote:Ok new test file.
thx, will try this tomorrow.
lisa wrote: So I guess I need to ask more questions as I cannot find any faults in the code.
1. Are you using latest rombot files and all files have green SVN tick? yes
2. Are you on a server running an old client? no
3. are you on a non-english client version? german
4. Do any chars have special characters in their name? no, tried with umlauts in charnames and without
5. Do you poke out your tongue when typing? yes, most of the time

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

Re: party.lua bugs

#18 Post by pman » Sat Jul 14, 2012 8:29 pm

One more info, I played all day long with one of the 3 "good" chars, then i tried the testfile again, names where rubbish. After restart of clients, everything perfect. Tried again with a "bad" char, rubbish, restart of clients, rubbish, again with 3 "good" chars, rubish, restart of clients, everything perfect. :)

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

Re: party.lua bugs

#19 Post by lisa » Sat Jul 14, 2012 8:42 pm

changed my client to , I think polish, anyway I tested in another client language.

Code: Select all

1 has name of PernorchÛ

Player has name of PernorchÛ

check party 100 is false

check party 200 is false

1 has name of PernorchÛ

1 has name of PernorchÛ

Player has name of PernorchÛ
Still worked for the weird names for player, didn't have any more accounts that server for testing.
I even altered the code to print the pawn info using the findnearest(name) and it still worked, even with the Ý.

Code: Select all

table: 0409F268
1:      table: 0409FB00
        free_debug1:    0
        MaxMP:  100
        MaxHP:  117
        PotionLastOnceUseTime:  0
        Mana:   0
        ActualSpeed:    0
        Lootable:       false
        Race:   0
        ExpInsertPos:   0
        ExpTable:       table: 0409FB50
        MaxEnergy:      0
        Attackable:     false
        Sleeping_time:  0
        Class3: -1
        Rage:   0
        Type:   1
        MaxMP2: 1
        Id:     1000
        Harvesting:     false
        Level3: 1
        Casting:        false
        PetPtr: 0
        Stance: 0
        MP:     100
        LastExp:        0
        Last_ignore_target_time:        0
        ExpUpdateInterval:      10
        Fighting:       false
        Concentration:  100
        InventoryDoUpdate:      false
        ExpPerMin:      0
        MaxMana:        0
        Moving: false
        Speed:  50
        Class1: 2
        BotStartTime_nr:        0
        TargetIcon:     true
        InParty:        false
        Swimming:       false
        MaxConcentration:       100
        SkillQueue:     table: 0409FBA0
        Name:   PernorchÛ
        LastSkillType:  0
        LastSkillStartTime:     0
        Buffs:  table: 0409FBC8
                1:      table: 0409FD30
                        Name:   Ochrona Nowicj
                        Id:     509705
                        Level:  0
                        TimeLeft:       2.0219
                        Count:  1
        HP:     117
        Z:      -8248
        Mounted:        false
        free_flag3:     false
        Guild:  <UNKNOWN>
        PotionLastManaEmptyTime:        0
        free_flag2:     false
        free_flag1:     false
        Success_waypoints:      0
        PotionHpUsed:   0
        Death_counter:  0
        PotionManaOnceUsed:     0
        Alive:  true
        mobs:   table: 0409FB78
        Unstick_counter:        0
        PotionLastUseTime:      0
        ranged_pull:    false
        GUID:   1266
        LastTargetPtr:  0
        Returning:      false
        ExpTableMaxSize:        10
        PhiriusManaUsed:        0
        Last_ignore_target_ptr: 0
        Current_waypoint_type:  3
        TimeTillLevel:  0
        free_counter1:  0
        Fights: 0
        Sleeping:       false
        level_detect_levelup:   0
        LastExpUpdateTime:      1342316449
        PotionLastManaOnceEmptyTime:    0
        DirectionY:     0
        Direction:      -0.82030473865531
        free_counter3:  0
        PhiriusLastManaEmptyTime:       0
        BotStartTime:   1342316449
        PhiriusLastHpEmptyTime: 0
        InventoryLastUpdate:    1342316449
        Nature: 0
        PotionManaUsed: 0
        Level2: 0
        PhiriusHpUsed:  0
        MP2:    1
        PhiriusLastUseTime:     0
        IgnoreTarget:   0
        TargetPtr:      0
        lastHitTime:    0
        Level:  1
        LastDistImprove:        1342316449
        Cast_to_target: 0
        PotionLastHpEmptyTime:  0
        PotionHpOnceUsed:       0
        MaxRage:        0
        free_counter2:  0
        Energy: 0
        Y:      244.55908203125
        X:      -4069.9982910156
        Class2: -1
        Address:        581602304
        PotionLastHpOnceEmptyTime:      0
        Battling:       false
        LastSkillCastTime:      0
        Aggressive:     false
PernorchÛ
1 has name of PernorchÛ
So yeah I can't fault the code at all, no idea why it is messing up for you.
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

#20 Post by lisa » Sat Jul 14, 2012 8:48 pm

pman wrote:One more info, I played all day long with one of the 3 "good" chars, then i tried the testfile again, names where rubbish. After restart of clients, everything perfect. Tried again with a "bad" char, rubbish, restart of clients, rubbish, again with 3 "good" chars, rubish, restart of clients, everything perfect. :)
So it works sometimes but not all the time?
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: Ahrefs [Bot], Bing [Bot] and 3 guests