Log in

View Full Version : [MSI]Essence Miner: Walking back to bank



matviy
11-18-2011, 02:58 PM
MSI is trying to walk back to the bank from aubury's hut where it ended. Walks the first step of the path, and then crashes with an error in walking.simba.



Reflection := [
// bank to outside house
TPointArray([Point(3254, 3422), Point(3257, 3406), Point(3253, 3398)]),

// outside to inside
TPointArray([Point(3253, 3398), Point(3253, 3402)]),

// Blank to do last obstacle
TPointArray([])
];


That's my path, and on the way back, this is what MSI tries to do:


[0:03:38]: [ Matviy ] -- MSI_AutoObjects: True
[0:03:38]: [ Matviy ] -- MSI_Walk
[0:03:38]: [ Matviy ] ---- Player's Location = Varrock East Essence Mine
[0:03:38]: [ Matviy ] ---- MSI_AtLocation
[0:03:39]: [ Matviy ] -------- MSI_GetMyPos(): (4835, 3030)
[0:03:39]: [ Matviy ] ------ Checking sub-location: Varrock East Bank
[0:03:39]: [ Matviy ] ------ Player not at Varrock East Bank
[0:03:39]: [ Matviy ] ---- MSI_AtLocation: False
[0:03:39]: [ Matviy ] ------ Players Found: 3
[0:03:39]: [ Matviy ] ------ Scanning for randoms...
[0:03:39]: [ Matviy ] ---- MSI_WalkPath: From Location (LOC_VE_BANK to LOC_VE_ESSMINE)
[0:03:39]: [ Matviy ] -------- MSI_MirrorATPA: New ATPA [[], [(4831, 3029), (4831, 3045)], [(4831, 3045), (4847, 3013), (4835, 2949)]] //These points are converted from the points in the path. I checked, they are all valid.
[0:03:39]: [ Matviy ] -------- MSI_MirrorATSA: New string array [['0_1'], ['11_7'], ['11_7']]
[0:03:39]: [ Matviy ] ------ Walking attempts: 1
[0:03:39]: [ Matviy ] ------ SPS Info.: Surface: 1, Areas: ['0_1']
[0:03:39]: [ Matviy ] ------ MSI_SolveObstacle: OBS_DOOR_AUBURY_INSIDE
[0:03:43]: [ Matviy ] -------- MSI_FindObjectTPA: DOOR_AUBURY_INSIDE //Checking of it can find "door closed" obstacle
[0:03:43]: [ Matviy ] ---------- Not enough points: 8
[0:03:43]: [ Matviy ] ---------- Not enough points: 513
[0:03:43]: [ Matviy ] ---------- Not enough points: 485
[0:03:43]: [ Matviy ] ---------- Not enough points: 124
[0:03:43]: [ Matviy ] ---------- Points found: 4
[0:03:43]: [ Matviy ] ---------- Took 235 ms to complete
[0:03:43]: [ Matviy ] -------- MSI_FindObjectTPA: True
[0:03:43]: [ Matviy ] ---------- Uptext: Walk here
[0:03:44]: [ Matviy ] ---------- Failed to find uptext: ['Open', 'pen']
[0:03:44]: [ Matviy ] ---------- Uptext: Walk here Four2 Kids (level: 51) / 3 more options
[0:03:44]: [ Matviy ] ---------- Failed to find uptext: ['Open', 'pen']
[0:03:45]: [ Matviy ] ---------- Uptext: Walk here
[0:03:45]: [ Matviy ] ---------- Failed to find uptext: ['Open', 'pen']
[0:03:46]: [ Matviy ] ---------- Uptext: Walk here
[0:03:46]: [ Matviy ] ---------- Failed to find uptext: ['Open', 'pen']
[0:03:46]: [ Matviy ] ---------- Players Found: 3
[0:03:46]: [ Matviy ] ---------- Scanning for randoms...
[0:03:46]: [ Matviy ] -------- Obstacle not found. Ignore option set. Moving on. //My own bit of magic.
[0:03:46]: [ Matviy ] ------ MSI_SolveObstacle: True
[0:03:46]: [ Matviy ] ------ SPS Info.: Surface: 1, Areas: ['11_7']
[0:03:46]: [ Matviy ] ------ MSI_WalkTPA
[0:03:46]: [ Matviy ] -------- Path: [(4831, 3029), (4831, 3045)]
[0:03:46]: [ Matviy ] ---------- MSI_PointOnPath: Index = 1
[0:03:49]: [ Matviy ] ---------- MSI_GetMyPos(): (4835, 3030)
[0:03:49]: [ Matviy ] ---------- MSI_PointOnPath: Index = 0
[0:03:50]: [ Matviy ] ---------- MSI_GetMyPos(): (4835, 3030)
[0:03:50]: [ Matviy ] ---------- MSI_PointOnPath: Index = 0
[0:03:50]: [ Matviy ] ---------- Current Energy: 100
[0:03:50]: [ Matviy ] -------- Next Point: 1 (4831, 3045)
[0:03:50]: [ Matviy ] ---------- Players Found: 3
[0:03:51]: [ Matviy ] ---------- Average pixel shift: 86
[0:03:51]: [ Matviy ] ---------- Flag distance: 17
[0:03:51]: [ Matviy ] ---------- Players Found: 3
[0:03:51]: [ Matviy ] ---------- Average pixel shift: 62
[0:03:51]: [ Matviy ] ---------- Player animation: Player Idle
[0:03:51]: [ Matviy ] ---------- MSI_GetMyPos(): (4835, 3030)
[0:03:51]: [ Matviy ] ---------- MSI_PointOnPath: Index = 0
[0:03:51]: [ Matviy ] -------- Attempts: 1
[0:03:51]: [ Matviy ] ---------- Current Energy: 98
[0:03:51]: [ Matviy ] -------- Next Point: 1 (4831, 3045)
[0:03:52]: [ Matviy ] ---------- Players Found: 3
[0:03:52]: [ Matviy ] ---------- MSI_AntiBan
[0:03:52]: [ Matviy ] ---------- Average pixel shift: 220
[0:03:52]: [ Matviy ] ---------- Flag distance: -1
[0:03:52]: [ Matviy ] ---------- Players Found: 2
[0:03:52]: [ Matviy ] ---------- Average pixel shift: 145
[0:03:53]: [ Matviy ] ---------- Average pixel shift: 167
[0:03:53]: [ Matviy ] ---------- Players Found: 2
[0:03:53]: [ Matviy ] ---------- Average pixel shift: 179
[0:03:53]: [ Matviy ] ---------- Average pixel shift: 332
[0:03:53]: [ Matviy ] ---------- Players Found: 3
[0:03:53]: [ Matviy ] ---------- Average pixel shift: 149
[0:03:53]: [ Matviy ] ---------- Average pixel shift: 204
[0:03:53]: [ Matviy ] ---------- Players Found: 3
[0:03:53]: [ Matviy ] ---------- Average pixel shift: 103
[0:03:54]: [ Matviy ] ---------- Average pixel shift: 135
[0:03:54]: [ Matviy ] ---------- Players Found: 3
[0:03:54]: [ Matviy ] ---------- Average pixel shift: 86
[0:03:54]: [ Matviy ] ---------- Average pixel shift: 102
[0:03:54]: [ Matviy ] ---------- Players Found: 3
[0:03:54]: [ Matviy ] ---------- Average pixel shift: 125
[0:03:54]: [ Matviy ] ---------- Average pixel shift: 98
[0:03:54]: [ Matviy ] ---------- Players Found: 3
[0:03:54]: [ Matviy ] ---------- Average pixel shift: 45
[0:03:54]: [ Matviy ] ---------- Player animation: Player Idle
[0:03:55]: [ Matviy ] ---------- MSI_GetMyPos(): (4830, 3045)
[0:03:55]: [ Matviy ] ---------- MSI_PointOnPath: Index = 1
[0:03:55]: [ Matviy ] -------- Attempts: 1
[0:03:55]: [ Matviy ] ---------- Players Found: 3
[0:03:55]: [ Matviy ] ---------- Average pixel shift: 39
[0:03:55]: [ Matviy ] ---------- Player animation: Player Idle
[0:03:55]: [ Matviy ] -------- Final distance: 1
[0:03:55]: [ Matviy ] ------ MSI_WalkTPA: True
Error: Out Of Range at line 790 //Crashes here. It usually walks to the first point of the path before this happens.

wasfer
11-18-2011, 03:37 PM
Perhaps use
Procedure toOutsideHouse;
var
toOutsideHouse: TPointArray;
begin
SPS_Debug := true;
SPS_Setup(RUNESCAPE_SURFACE, ['XX_XX'])
toOutsideHouse := [ Point(3254, 3422), Point(3257, 3406), Point(3253, 3398) ];
SPS_WalkPath(toOutsideHouse);
SPS_GetMyPos();

end;

matviy
11-18-2011, 04:31 PM
Perhaps use
Procedure toOutsideHouse;
var
toOutsideHouse: TPointArray;
begin
SPS_Debug := true;
SPS_Setup(RUNESCAPE_SURFACE, ['XX_XX'])
toOutsideHouse := [ Point(3254, 3422), Point(3257, 3406), Point(3253, 3398) ];
SPS_WalkPath(toOutsideHouse);
SPS_GetMyPos();

end;

That pretty much works. But it seems to be an obstacle problem. MSI crashes at this point:




// handle the obstacle
if (i <> h) then
if (length(intObs) > 0) then
begin
obs := MSI_GetObstacle(intObs[i]); <-------Failure
if (not MSI_SolveObstacle(obs)) then
begin
reportInfo.falseReason := 'Failed to pass obstacle: ' + obs.name;
MSI_Debug('Failed to pass obstacle: ' + obs.name);
done := true;
break;
end;
end;
end;
end;



EDIT: It crashes because it attempts to access index 1 in an array of length 1. For some reason it believes that there is more than 1 obstacle. No idea why. I thought i could create an awful dirty fix by doing the following, but it didn't work:




// handle the obstacle
if (i <> h) then
if (length(intObs) > 0) and (length(intObs) > i) then <-------Changed to check for correct length
begin
obs := MSI_GetObstacle(intObs[i]);
if (not MSI_SolveObstacle(obs)) then
begin
reportInfo.falseReason := 'Failed to pass obstacle: ' + obs.name;
MSI_Debug('Failed to pass obstacle: ' + obs.name);
done := true;
break;
end;
end;
end;
end;



It stopped crashing, but that was replaced by a ton of access violations:



[0:04:35]: [ Matviy ] ------ MSI_WalkTPA: True //Point of last crash here.
[0:04:35]: [ Matviy ] ------ SPS Info.: Surface: 2, Areas: ['11_7'] //Wrong. No idea why it's doing this.
[0:04:35]: [ Matviy ] ------ MSI_WalkTPA
[0:04:35]: [ Matviy ] -------- Path: [(4831, 3045), (4847, 3013), (4835, 2949)]
[0:04:35]: [ Matviy ] ---------- MSI_PointOnPath: Index = 7
[0:04:35]: [SPS] ERRORException: Access violation //Access violation caused by wrong surface being loaded.
[0:04:35]: [ Matviy ] ---------- MSI_GetMyPos(): (-1, -1)
[0:04:35]: [ Matviy ] ---------- MSI_PointOnPath: Index = -1
[0:04:35]: [ Matviy ] ---------- MSI_EnterPath: false
[0:04:35]: [ Matviy ] ------ MSI_WalkTPA: False
[0:04:35]: [ Matviy ] ------ MSI_WalkTPA
[0:04:35]: [ Matviy ] -------- Path: [(176, 305), (320, 310), (181, 183), (317, 184), (249, 236)]
[0:04:35]: [ Matviy ] ---------- MSI_PointOnPath: Index = 33
[0:04:35]: [SPS] ERRORException: Access violation
[0:04:35]: [ Matviy ] ---------- MSI_GetMyPos(): (-1, -1)
[0:04:35]: [ Matviy ] ---------- MSI_PointOnPath: Index = -1
[0:04:35]: [ Matviy ] ---------- MSI_EnterPath: false
[0:04:35]: [ Matviy ] ------ MSI_WalkTPA: False
[0:04:35]: [ Matviy ] ------ MSI_WalkTPA
[0:04:35]: [ Matviy ] -------- Path: [(4831, 3045), (4847, 3013), (4835, 2949)]
[0:04:35]: [ Matviy ] ---------- MSI_PointOnPath: Index = 7
[0:04:35]: [SPS] ERRORException: Access violation
[0:04:35]: [ Matviy ] ---------- MSI_GetMyPos(): (-1, -1)
[0:04:35]: [ Matviy ] ---------- MSI_PointOnPath: Index = -1
[0:04:35]: [ Matviy ] ---------- MSI_EnterPath: false
[0:04:35]: [ Matviy ] ------ MSI_WalkTPA: False
[0:04:35]: [ Matviy ] ------ MSI_AtLocation
[0:04:35]: [SPS] ERRORException: Access violation
[0:04:35]: [ Matviy ] ---------- MSI_GetMyPos(): (-1, -1)
[0:04:35]: [ Matviy ] -------- Checking sub-location: Varrock East Bank
[0:04:35]: [ Matviy ] -------- MSI_Relocate (Varrock East Bank)
[0:04:35]: [SPS] ERRORException: Access violation
[0:04:35]: [ Matviy ] ------------ MSI_GetMyPos(): (-1, -1)
[0:04:35]: [ Matviy ] ------------ Players Found: 1
[0:04:35]: [ Matviy ] ------------ Scanning for randoms...
[0:04:35]: [SPS] ERRORException: Access violation
[0:04:35]: [SPS] ERRORException: Access violation
[0:04:35]: [SPS] ERRORException: Access violation
[0:04:35]: [ Matviy ] -------- MSI_Relocate: False
[0:04:35]: [ Matviy ] -------- Player not at Varrock East Bank
[0:04:35]: [ Matviy ] ------ MSI_AtLocation: False
[0:04:35]: [ Matviy ] ---- MSI_WalkPath: False
[0:04:35]: [ Matviy ] ---- MSI_DeathWalk
[0:04:35]: [ Matviy ] ------ MSI_WalkPath: To Location (LOC_LB_SPAWN to LOC_VE_BANK)
[0:04:35]: [ Matviy ] -------- Walking attempts: 1
[0:04:35]: [ Matviy ] -------- SPS Info.: Surface: 1, Areas: ['11_9', '11_8', '11_7']
[0:04:35]: [ Matviy ] -------- MSI_WalkTPA
[0:04:35]: [ Matviy ] ---------- Path: [(12892, -12872), (13044, -12912), (12956, -13120), (12964, -13236), (13196, -13436), (13140, -13716), (13020, -13684)]
[0:04:35]: [ Matviy ] ------------ MSI_PointOnPath: Index = 69
[0:04:36]: [ Matviy ] ------------ MSI_GetMyPos(): (4830, 3050)
[0:04:36]: [ Matviy ] ------------ MSI_PointOnPath: Index = -1
[0:04:36]: [ Matviy ] ------------ MSI_EnterPath: false
[0:04:36]: [ Matviy ] -------- MSI_WalkTPA: False
[0:04:36]: [ Matviy ] -------- MSI_WalkTPA
[0:04:36]: [ Matviy ] ---------- Path: [(13018, -13686)]
[0:04:37]: [ Matviy ] ------------ MSI_GetMyPos(): (4830, 3050)
[0:04:37]: [ Matviy ] ------------ MSI_EnterPath: false
[0:04:37]: [ Matviy ] -------- MSI_WalkTPA: False
[0:04:37]: [ Matviy ] -------- MSI_WalkTPA
[0:04:37]: [ Matviy ] ---------- Path: [(12892, -12872), (13044, -12912), (12956, -13120), (12964, -13236), (13196, -13436), (13140, -13716), (13020, -13684)]
[0:04:37]: [ Matviy ] ------------ MSI_PointOnPath: Index = 69
[0:04:38]: [ Matviy ] ------------ MSI_GetMyPos(): (4830, 3050)
[0:04:38]: [ Matviy ] ------------ MSI_PointOnPath: Index = -1
[0:04:38]: [ Matviy ] ------------ MSI_EnterPath: false
[0:04:38]: [ Matviy ] -------- MSI_WalkTPA: False
[0:04:38]: [ Matviy ] -------- MSI_AtLocation
[0:04:38]: [ Matviy ] ------------ MSI_GetMyPos(): (4830, 3050)
[0:04:38]: [ Matviy ] ---------- Checking sub-location: Varrock East Bank
[0:04:38]: [ Matviy ] ---------- MSI_Relocate (Varrock East Bank)
[0:04:39]: [ Matviy ] -------------- MSI_GetMyPos(): (4830, 3050)
[0:04:39]: [ Matviy ] -------------- Players Found: 1
[0:04:39]: [ Matviy ] -------------- Scanning for randoms...
[0:04:41]: [ Matviy ] ---------- MSI_Relocate: False
[0:04:41]: [ Matviy ] ---------- Player not at Varrock East Bank
[0:04:41]: [ Matviy ] -------- MSI_AtLocation: False
[0:04:41]: [ Matviy ] ------ MSI_WalkPath: False
[0:04:43]: [ Matviy ] -------- Clicked spell: Home Teleport
[0:04:43]: [ Matviy ] ------ Waiting to spawn in Lumbridge
[0:04:44]: [ Matviy ] ------ MSI_AtLocation
[0:04:45]: [ Matviy ] ---------- MSI_GetMyPos(): (4830, 3050)
[0:04:45]: [ Matviy ] -------- Checking sub-location: Lumbridge Courtyard
[0:04:45]: [ Matviy ] -------- Player not at Lumbridge Courtyard
[0:04:45]: [ Matviy ] ------ MSI_AtLocation: False
[0:04:46]: [ Matviy ] ------ MSI_AtLocation
[0:04:47]: [ Matviy ] ---------- MSI_GetMyPos(): (4830, 3050)
[0:04:47]: [ Matviy ] -------- Checking sub-location: Lumbridge Courtyard
[0:04:47]: [ Matviy ] -------- Player not at Lumbridge Courtyard
[0:04:47]: [ Matviy ] ------ MSI_AtLocation: False
[0:04:48]: [ Matviy ] ------ MSI_AtLocation
[0:04:48]: [ Matviy ] ---------- MSI_GetMyPos(): (4830, 3050)
[0:04:48]: [ Matviy ] -------- Checking sub-location: Lumbridge Courtyard
[0:04:48]: [ Matviy ] -------- Player not at Lumbridge Courtyard
[0:04:48]: [ Matviy ] ------ MSI_AtLocation: False
[0:04:49]: [ Matviy ] ------ MSI_AtLocation
[0:04:50]: [ Matviy ] ---------- MSI_GetMyPos(): (4830, 3050)
[0:04:50]: [ Matviy ] -------- Checking sub-location: Lumbridge Courtyard
[0:04:50]: [ Matviy ] -------- Player not at Lumbridge Courtyard
[0:04:50]: [ Matviy ] ------ MSI_AtLocation: False
[0:04:51]: [ Matviy ] ------ MSI_AtLocation
[0:04:52]: [ Matviy ] ---------- MSI_GetMyPos(): (4830, 3050)
[0:04:52]: [ Matviy ] -------- Checking sub-location: Lumbridge Courtyard
[0:04:52]: [ Matviy ] -------- Player not at Lumbridge Courtyard
[0:04:52]: [ Matviy ] ------ MSI_AtLocation: False
[0:04:53]: [ Matviy ] ------ MSI_AtLocation
[0:04:53]: [ Matviy ] ---------- MSI_GetMyPos(): (4830, 3050)
[0:04:53]: [ Matviy ] -------- Checking sub-location: Lumbridge Courtyard
[0:04:53]: [ Matviy ] -------- Player not at Lumbridge Courtyard
[0:04:53]: [ Matviy ] ------ MSI_AtLocation: False
[0:04:54]: Thank-you for using MSI Phoenix scripts!
[0:04:54]: Successfully executed.


Somehow i feel like this all stems from that empty array i created, but maybe not.

EDIT: Seems to me like spsAreas array is reversed in SPS_WalkPath when you're walking back to the bank, but the spsSurfaces array isn't reversed.

matviy
11-19-2011, 10:29 AM
I solved it. Sort of. There were two problems with MSI trying to walk back:

1) For some reason, maybe because of my blank path, MSI thought there were more obstacles that there really were. And was trying to access index 1 (second obstacle) of an array that only had one obstacle to begin with, which triggered a crash. I solved this in the code i posted above by checking to make sure that the index was valid before attempting to access the array.

2) After this, another (possibly related, maybe not) problem appeared. MSI reverses your path as well as your SPS areas ('0_1' for instance) but does not bother to reverse the surfaces that correspond with those areas. It attempts to access 11_7 area (varrock) while set to the DUNGEON_ESSENCE surface.

Unless i screwed MSI up somehow, i don't see any where where this was being handled by MSI, so i created a second array in pathInfo called SPS_MirrorSurfaces which contains the surfaces reversed, and modified SPS_WalkPath to switch between the regular surface array and the reversed one depending on which direction it is going.

Finally, the script has completed it's first few loops.

Coh3n
11-19-2011, 05:37 PM
Nice work! ;) I had to do the same thing in my "cleaned_walking" branch as when I started testing the new maps at the Mining Guild, I had the same issue. Sorry I couldn't help you earlier, I was away for a couple days.

Oh and in the future, you'll probably get a faster response from me if you post in the MSI section. MSI Bugs will suit just fine.

Also, are you doing all of this through Git? It seems like you're making a lot of changes, and in order to properly merge, it's best if it's done in Git.

matviy
11-19-2011, 07:06 PM
Nice work! ;) I had to do the same thing in my "cleaned_walking" branch as when I started testing the new maps at the Mining Guild, I had the same issue. Sorry I couldn't help you earlier, I was away for a couple days.

Oh and in the future, you'll probably get a faster response from me if you post in the MSI section. MSI Bugs will suit just fine.

Also, are you doing all of this through Git? It seems like you're making a lot of changes, and in order to properly merge, it's best if it's done in Git.

I actually have no experience with Git so I'm just working straight from MSI extension that Simba downloaded. I Had a very close call when simba started auto-updating MSI.

I have recorded every change i made anywhere to MSI which i suppose should help later. Although i make every every attempt to make sure that the changes I'm making in MSI are necessary and for the better, I'm not sure that my "fixes" are always the best ways to solve problems. I'm sure there are much nicer ways of doing some things, so I'd love for someone to review all of this.

Good news is that the script is up and running for 3 hours now at ~650 essence per hour. I will watch stability and continue tweaking until i feel it's ready :D

Coh3n
11-19-2011, 07:11 PM
I actually have no experience with Git so I'm just working straight from MSI extension that Simba downloaded. I Had a very close call when simba started auto-updating MSI.

I have recorded every change i made anywhere to MSI which i suppose should help later. Although i make every every attempt to make sure that the changes I'm making in MSI are necessary and for the better, I'm not sure that my "fixes" are always the best ways to solve problems. I'm sure there are much nicer ways of doing some things, so I'd love for someone to review all of this.

Good news is that the script is up and running for 3 hours now at ~650 essence per hour. I will watch stability and continue tweaking until i feel it's ready :D
That's fantastic news! :)

When you think it's ready, could you PM me all the changes? For the future I HIGHLY suggest using git. It would allow me to apply all your changes in 1 click rather than having to copy/paste your changes to make sure everything is right. Git automatically merges changes.

By the sounds of things some of your changes have already been made by me in unreleased versions, so that's a bonus.

Looking forward to adding this. :)

E: Oh, I don't think you've setup stats properly as they're not being added. I think all you need to do is have "Rune Essence (Mined)" as the StatsName for the essence item record.