SRL Archive - MSI Archives

Noob in need of adding new location. :)


the smith400

2010-12-11 23:06:38

Hello Everybody,

I'm adding a Catherby fishing into the MSI Scripts and I'm a little stuck.

With the Catherby location, I feel as though I'm missing one last bit of information to insert that I might not be able to do because I lack the experience/knowledge. The following is a proggy of what happens when I attempt to start the MSI Fishing script:


[0:00:05]: {----------------------------------------------------------------}
[0:00:05]: { MSI Phoenix Player Report }
[0:00:05]: {------------------------- Revision 393 -------------------------}
[0:00:05]: { Time Running: 5 Seconds }
[0:00:05]: {----------------------------------------------------------------}
[0:00:05]: { }
[0:00:05]: { Player 0: **** **** }
[0:00:05]: { Location: Catherby Bank }
[0:00:05]: { Time: 00s }
[0:00:05]: { Active: True }
[0:00:05]: { }
[0:00:05]: { Script: Catherby Fisher }
[0:00:05]: { Time: 00s }
[0:00:05]: { Skill: Fishing }
[0:00:05]: { Exp: 0 }
[0:00:05]: { Level: 46 }
[0:00:05]: { Loads: 0 }
[0:00:05]: { Item: Raw lobster }
[0:00:05]: { Amount: 0 }
[0:00:05]: { }
[0:00:05]: {----------------------------------------------------------------}
[0:00:05]: {----------------------------------------------------------------}
[0:00:05]: [ Nry ] -- MSI_SetupPlayer
[0:00:07]: [ Nry ] ------ Scanning for randoms...
[0:00:12]: [ Nry ] ---- MSI_SetSkillLevels
[0:00:13]: [ Nry ] ------ Fishing level hasn't changed
[0:00:13]: [ Nry ] ---- MSI_SetSkillLevels: Exit
[0:00:13]: [ Nry ] ---- MSI_SetupFishing
[0:00:14]: [ Nry ] ------ MSI_FindTool - Gametab: Inventory
[0:00:14]: [ Nry ] -------- Found DTM: Lobster Pot
[0:00:14]: [ Nry ] ------ MSI_FindTool: True
[0:00:14]: [ Nry ] ------ Fishing spot 0: Cage Spot
[0:00:14]: [ Nry ] ---- MSI_SetupFishing: True
[0:00:14]: [ Nry ] -- MSI_SetupPlayer: True
[0:00:14]: [ Nry ] ---- Exception: - Slot 1
[0:00:15]: [ Nry ] ---- There are 1 exceptions
[0:00:15]: [ Nry ] -- MSI_Walk
[0:00:15]: [ Nry ] ------ MSI_WaitWhileResting
[0:00:15]: [ Nry ] ---- Player's Location = Catherby Bank
[0:00:15]: [ Nry ] ---- MSI_PerfomWalk
[0:00:15]: [ Nry ] ------ MSI_ReflectionWalk
[0:00:15]: [ Nry ] -------- Tile(2858, 3429) is not on the minimap
[0:00:15]: [ Nry ] -------- Tile(2853, 3426) is not on the minimap
[0:00:15]: [ Nry ] -------- Tile(2844, 3432) is not on the minimap
[0:00:15]: [ Nry ] -------- Tile(2836, 3434) is not on the minimap
[0:00:15]: [ Nry ] -------- [FAIL] Leg: 0 Script: Catherby Fisher
[0:00:15]: [ Nry ] -------- MSI_ColorWalk
[0:00:15]: [ Nry ] ---------- MSI_CreateWalkFailsafe
[0:00:15]: [ Nry ] -------------- MSI_WalkToColorIndex: Failed to walk to, index: 29; not on the minimap
[0:00:15]: [ Nry ] ---------- MSI_CreateWalkFailsafe: True
[0:00:15]: [ Nry ] ------------ Scanning for randoms...
[0:00:18]: [ Nry ] -------- MSI_ColorWalk: True
[0:00:18]: [ Nry ] ------ MSI_PerformWalk: True
[0:00:18]: [ Nry ] ---- MSI_Walk: True
[0:00:18]: [ Nry ] ---- MSI_AutoObjects
[0:00:18]: [ Nry ] ------ MSI_FindObjectsIn
[0:00:18]: [ Nry ] ---------- MSI_FindObjectsTPA: No colors found!
[0:00:18]: [ Nry ] ------ MSI_FindObjectsIn: False
[0:00:18]: [ Nry ] -------- Scanning for randoms...
[0:00:19]: [ Nry ] -------- Scanning for randoms...
[0:00:22]: [ Nry ] ------ MSI_Relocate
[0:00:22]: [ Nry ] ---------- No relocation areas for Catherby fishing spot
[0:00:22]: [ Nry ] ---------- No relocation areas for Catherby fishing spot
[0:00:23]: [ Nry ] ---------- No relocation areas for Catherby fishing spot
[0:00:23]: [ Nry ] ---------- No relocation areas for Catherby fishing spot
[0:00:23]: [ Nry ] -------- Relocate attempts: 1
[0:00:23]: [ Nry ] ------ MSI_Relocate: False
[0:00:23]: [ Nry ] ---- MSI_AutoObjects: False
[0:00:23]: [ Nry ] ---- MSI_HandleBreaking
[0:00:23]: [ Nry ] ------ Taking a short break
[0:00:28]: BREAK_TIME remaining: 11 Minutes and 46 Seconds;

Coh3n's response to the proggy:
By the looks of things, none of the tiles you added to the path were on the minimap, so once that failed, it tried to do color walking; however, it said that the color walking was successful so something went wrong there. Did you modify anything in Walking_Color.simba? Could just be an error that was already there.


Hopefully this will give you guys an understanding of what I may have missed. I've attached a rar file of all the scripts i've modified (and not changed).

If you check the scripts I've modified and make changes to it or add anything I've missed out on, can you tell me what you've done so I won't make the same mistake again.

Thank you so much :)

Oh by the way, I put my name by everything I've added so it's easier to find them when using ctrl+f. Just search "Juan"

Like I said before, If you can find anything I missed out on, can you tell me? :D Thanks

Camaro'

2010-12-11 23:59:04

Upload the files please :)

I'll take a look.

the smith400

2010-12-12 00:24:33

I truly am… an idiot.

Camaro'

2010-12-12 09:56:41

I'll tell you all the things I found wrong. ( Going to edit this post )

Edit:

In globals.simba, put your color walking at the end of the list, instead of after draynor fishing variables. Also, each color walking variable represents a click, so if I remember correctly, theres three clicks of walking at Cath fishing.


WALK_FISH_DB_1 = 27;
WALK_FISH_DB_BANK_1 = 28;


WALK_WC_GE_YEW_1 = 31;
WALK_WC_GE_YEW_2 = 32;
WALK_WC_GE_YEW_3 = 33;

WALK_WC_GE_YEW_BANK_1 = 34;
WALK_WC_GE_YEW_BANK_2 = 35;
WALK_WC_GE_YEW_BANK_3 = 36;

WALK_FISH_CB_1 = 37; //Juan //First click
WALK_FISH_CB_2 = 38; //Juan second...
WALK_FISH_CB_3 = 39; //Juan third
WALK_FISH_CB_BANK_1 = 40; //Juan first click on the way to bank...
WALK_FISH_CB_BANK_2 = 41; //Juan
WALK_FISH_CB_BANK_3 = 42; //Juan

Damn! I don't know if I will get a chance to finish this today, got to go.
Take a look at : http://villavu.com/forum/showthread.php?t=60698
and : http://villavu.com/forum/showthread.php?t=57726

On the second link , just reread the reflection walking part. Bye!

If you read the first link, that should fix all your color walking problems.

and for the reflection problem, is your reflection up to date, in general are the reflection hooks up to date?

the smith400

2010-12-12 11:01:37

WOOOOOOOOOOOOO! It worked :D

Awesome, but i did get into a problem or two.
For the fishing spot closest to the bank, it took me a while to try to find for a spot, it was looking into some other area of the water, it gave up and went to another location. It did it again at another place. But in the end it managed to find it after changing spots.

And, the script doesn't right click the fishing spots to check for "cage" should i be concerned?

Because it does it frequently. It's unable to locate the fishing spots that i can see and it doesnt rightclick spots for more options. (I haven't tried all equipments)

Well in the end it walks fine and yeah :) thanks.

Hopefully next time I'll add more locations without causing as much headaches.

Please do give it a try, and tell me if the problem is from me or the script, because it's more likely to be me.


(After a while of watching it macro) Yeeahh, noo it's just standing there, on shore, moving the mouse around the water. I'll try to search through forums and fix this problem.


EDIT:This goes to the people who made the fishing script. While i'm fishing i moves to a new location to fish and sometimes it clicks the same spot to fish… whyyyy? D: And also, I don't know how to get right click net fish spots just incase there is a cage spot under it?

NCDS

2010-12-12 14:57:22

Fishing is rather buggy. I've been working on a new object finding system for it as the current one doesn't handle fishing spots too well.

The reason it clicks the same spot sometimes is because WaitWhileFishing "loses" the spot and attempts to find it again.

I'm finally about done settling stuff in my new place but I've got quite a list of things to do before I can get back to this. (Shouldn't take very long once I get back to it though as it's already mostly done.)

the smith400

2010-12-12 16:23:09

<3 YOU NCDS. You've cured my mind from thinking I just suck at scripts and that the problem isn't my fault… :D

The thing is.. I've got another tinsy problem, which I just have to say. I feel as though I'm getting under your skins for not s'ing-tfu..

I've made an Al-Kharid location. I've added ALL the constants into Global.simba (including Al Kharid colours), and no ARRAY_L had to be updated. I've added the bank into Objects.simba, the mining area and bank in Locations.simba and Walking_Color info also. But with scripts.simba, no matter how many times I look through it, and try to fix it, i get a problem…
    SCRIPT_AK_MINER:
with MSI_Scripts[whichScript] do
begin
Name := 'Al Kharid Miner';
Constant := SCRIPT_AK_MINER;
SkillName := 'Mining';
SkillConst := SKILL_MINING;
BankType := Bank;
WhichBank := MSI_BANK_AK;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;

with Defaults do
begin
Rocks := [ROCK_COAL, ROCK_MITHRIL];

Items := [
TIntegerArray([ORE_COAL]), TIntegerArray([ORE_MITHRIL])
];
end; // And this line get's highlighted

with PathInfo do
begin
StartLoc := LOC_AK_BANK;
EndLoc := LOC_AK_MINE;

Result := [Point(3269, 3165), Point(3279, 3178), Point(3283, 3193),
Point(3281, 3208), Point(3281, 3223), Point(3284, 3238),
Point(3290, 3253), Point(3294, 3268), Point(3297, 3278),
Point(3300, 3287)];

ColorTo := [
WALK_MINE_AK_1, WALK_MINE_AK_2, WALK_MINE_AK_3,
WALK_MINE_AK_4, WALK_MINE_AK_5, WALK_MINE_AK_6,
WALK_MINE_AK_7, WALK_MINE_AK_8, WALK_MINE_AK_9,
WALK_MINE_AK_10
];
ColorFrom := [
WALK_MINE_AK_BANK_1, WALK_MINE_AK_BANK_2, WALK_MINE_AK_BANK_3,
WALK_MINE_AK_BANK_4, WALK_MINE_AK_BANK_5, WALK_MINE_AK_BANK_6,
WALK_MINE_AK_BANK_7, WALK_MINE_AK_BANK_8, WALK_MINE_AK_BANK_9,
WALK_MINE_AK_BANK_10
];

end;
end;

And the following debug message occurs:
[Hint] C:\Simba\Includes\SRL/SRL/core/gametab.scar(1513:3): Variable 'P' never used at line 1512
[Error] C:\Simba\Includes\MSI/Scripts.simba(537:40): Type mismatch at line 536
Compiling failed.

without SMART ever opening.. If i remove that whole section, SMART opens but then obviously the script doesnt run… Whyyyyyyyy am i really bad at this???

NCDS

2010-12-12 16:30:15

Did you write a color path for it? if not you can remove the color points and see if that changes anything.

Otherwise, upload your whole scripts.simba folder so I can see better.

the smith400

2010-12-12 16:39:12

Uploaded all the changes, just incase

P.S. this also has the Catherby (for those who wondered where the previous attachments are)

Edit: The file was too big so i deleted Objects.simba..
Here's the missing info
    MSI_BANK_CB:                //Juan
with MSI_Objects[whichObject] do
begin
Name := 'Catherby Bank';
UpText := 'anker';
Option := 'ank Banker';
Colors := [6712171];
Tol := 25;
Hue := 0.31;
Sat := 0.26;
FindAllColors := False;
W := 10;
H := 10;
Accuracy := 6;
ExcludeSelf := True;
RightClickOnly := True;
Tries := 10;
Anim := False;
WaitToMove := True;
BadColors := [];
BadColorTolerance := 10;
end;

MSI_BANK_AK: //Juan
with MSI_Objects[whichObject] do
begin
Name := 'Al Kharid Bank';
UpText := 'anker';
Option := 'ank Banker';
Colors := [4481411];
Tol := 18;
Hue := 0.06;
Sat := 0.47;
FindAllColors := False;
W := 10;
H := 10;
Accuracy := 7;
ExcludeSelf := True;
RightClickOnly := True;
Tries := 10;
Anim := False;
WaitToMove := True;
BadColors := [];
BadColorTolerance := 10;
end;

Coh3n

2010-12-13 00:28:37


Result := [Point(3269, 3165), Point(3279, 3178), Point(3283, 3193),
Point(3281, 3208), Point(3281, 3223), Point(3284, 3238),
Point(3290, 3253), Point(3294, 3268), Point(3297, 3278),
Point(3300, 3287)];
There's your issue. ;) Look at the reflection paths from other script records.

the smith400

2010-12-13 09:12:11

What would I do without you..

Coh3n

2010-12-13 11:44:38

From: the smith400
What would I do without you..

If you get everything working, please post all the records and constants you added so they can be committed. :)

3Garrett3

2010-12-13 15:07:48

About the fishing in general, NCDS, are you working on the object finding and handling within the fishing? I was planning on making it less terrible after exams are over (thursday :)) but if you're working on it I will switch my focus to other things in the core, etc.

NCDS

2010-12-13 16:35:23

From: 3Garrett3
About the fishing in general, NCDS, are you working on the object finding and handling within the fishing? I was planning on making it less terrible after exams are over (thursday :)) but if you're working on it I will switch my focus to other things in the core, etc.


I've got a new object finding function that I'd like to try out with it, but it's not quite finished yet. I'll get in touch with you on MSN sometime and we can talk. ;)

the smith400

2010-12-14 10:29:43

Hello again everybodyyyy,

Sadly the hooks are outdated and I'm unable to get my scripting walking… again.

What adjustments should I make?

[0:00:04]: {----------------------------------------------------------------}
[0:00:04]: { MSI Phoenix Player Report }
[0:00:04]: {------------------------- Revision 393 -------------------------}
[0:00:04]: { Time Running: 4 Seconds }
[0:00:04]: {----------------------------------------------------------------}
[0:00:04]: { }
[0:00:04]: { Player 0: Zezima }
[0:00:04]: { Location: Catherby Bank }
[0:00:04]: { Time: 00s }
[0:00:04]: { Active: True }
[0:00:04]: { }
[0:00:04]: { Script: Catherby Fisher }
[0:00:04]: { Time: 00s }
[0:00:04]: { Skill: Fishing }
[0:00:04]: { Exp: 0 }
[0:00:04]: { Level: 47 }
[0:00:04]: { Loads: 0 }
[0:00:04]: { Item: Raw lobster }
[0:00:04]: { Amount: 0 }
[0:00:04]: { }
[0:00:04]: {----------------------------------------------------------------}
[0:00:04]: {----------------------------------------------------------------}
[0:00:04]: [ Nry ] -- MSI_SetupPlayer
[0:00:05]: [ Nry ] ------ Scanning for randoms...
[0:00:11]: [ Nry ] ---- MSI_SetSkillLevels
[0:00:12]: [ Nry ] ------ Fishing level hasn't changed
[0:00:12]: [ Nry ] ---- MSI_SetSkillLevels: Exit
[0:00:12]: [ Nry ] ---- MSI_SetupFishing
[0:00:13]: [ Nry ] ------ MSI_FindTool - Gametab: Inventory
[0:00:13]: [ Nry ] -------- Found DTM: Lobster Pot
[0:00:13]: [ Nry ] ------ MSI_FindTool: True
[0:00:13]: [ Nry ] ------ Fishing spot 0: Cage Spot
[0:00:13]: [ Nry ] ---- MSI_SetupFishing: True
[0:00:13]: [ Nry ] -- MSI_SetupPlayer: True
[0:00:13]: [ Nry ] ---- Exception: - Slot 1
[0:00:13]: [ Nry ] ---- There are 1 exceptions
[0:00:13]: [ Nry ] -- MSI_Walk
[0:00:13]: [ Nry ] ------ MSI_WaitWhileResting
[0:00:13]: [ Nry ] ---- Player's Location = Catherby Bank
[0:00:13]: [ Nry ] ---- MSI_PerfomWalk
[0:00:13]: [ Nry ] ------ MSI_ColorWalk
[0:00:13]: [ Nry ] -------- MSI_CreateWalkFailsafe
[0:00:13]: [ Nry ] ------------ MSI_WalkToColorIndex: Failed to walk to, index: 37; not on the minimap
[0:00:13]: [ Nry ] -------- MSI_CreateWalkFailsafe: True
[0:00:13]: [ Nry ] ---------- Scanning for randoms...
[0:00:14]: [ Nry ] -------- MSI_CreateWalkFailsafe
[0:00:14]: [ Nry ] ------------ MSI_WalkToColorIndex: Failed to walk to, index: 38; not on the minimap
[0:00:14]: [ Nry ] -------- MSI_CreateWalkFailsafe: True
[0:00:14]: [ Nry ] ---------- Scanning for randoms...
[0:00:17]: [ Nry ] -------- MSI_CreateWalkFailsafe
[0:00:17]: [ Nry ] ------------ MSI_WalkToColorIndex: Failed to walk to, index: 39; not on the minimap
[0:00:17]: [ Nry ] -------- MSI_CreateWalkFailsafe: True
[0:00:17]: [ Nry ] ---------- Scanning for randoms...
[0:00:18]: [ Nry ] -------- MSI_CreateWalkFailsafe
[0:00:18]: [ Nry ] ------------ MSI_WalkToColorIndex: Failed to walk to, index: 40; not on the minimap
[0:00:18]: [ Nry ] -------- MSI_CreateWalkFailsafe: True
[0:00:18]: [ Nry ] ---------- Scanning for randoms...
[0:00:21]: [ Nry ] ------ MSI_ColorWalk: True
[0:00:21]: [ Nry ] ---- MSI_PerformWalk: True
[0:00:21]: [ Nry ] -- MSI_Walk: True
[0:00:21]: [ Nry ] -- MSI_AutoObjects
[0:00:21]: [ Nry ] ---- MSI_FindObjectsIn
[0:00:21]: [ Nry ] -------- MSI_FindObjectsTPA: No colors found!
[0:00:21]: [ Nry ] ---- MSI_FindObjectsIn: False
[0:00:21]: [ Nry ] ------ Scanning for randoms...
[0:00:24]: [ Nry ] ------ Scanning for randoms...
[0:00:25]: [ Nry ] ---- MSI_Relocate
[0:00:25]: [ Nry ] -------- No relocation areas for Catherby fishing spot
[0:00:25]: [ Nry ] -------- No relocation areas for Catherby fishing spot
[0:00:25]: [ Nry ] -------- No relocation areas for Catherby fishing spot
[0:00:25]: [ Nry ] -------- No relocation areas for Catherby fishing spot
[0:00:25]: [ Nry ] ------ Relocate attempts: 1
[0:00:25]: [ Nry ] ---- MSI_Relocate: False
[0:00:25]: [ Nry ] -- MSI_AutoObjects: False
[0:00:25]: [ Nry ] -- MSI_HandleBreaking
[0:00:25]: [ Nry ] ---- Taking a short break
[0:00:32]: BREAK_TIME remaining: 14 Minutes and 40 Seconds;

Coh3n

2010-12-14 16:09:59

From: the smith400
Hello again everybodyyyy,

Sadly the hooks are outdated and I'm unable to get my scripting walking… again.

What adjustments should I make?

What do you mean? You'll just have to wait until the hooks are updated, unless you also want to write color walking for the catherby fisher. I notice the debug said it couldn't walk, so did you already make color walking for it?

the smith400

2010-12-14 23:00:56

From: Coh3n
What do you mean? You'll just have to wait until the hooks are updated, unless you also want to write color walking for the catherby fisher. I notice the debug said it couldn't walk, so did you already make color walking for it?


Yeah I did add a color walking for catherby fisher. I was very pleased with my progress and understanding of how to add one before it fudged up on me..

function MSI_FISH_CBPoints(Index: Integer): TPoint;      //Juan
var
TPA: TPointArray;
I , X, Y :Integer;
begin
Result := Point(-1, -1);

case Index of
WALK_FISH_CB_1:
begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color_CB_Bank_Floor, MMX1, MMY1, MMX2, MMy2, 25);
SortTPAFrom(TPA, Point(627, 88));
for I := 0 to High(TPA) do
begin
X := TPA[I].x;
Y := TPA[I].y;

if not RS_onMinimap(X, Y) then
Continue;
Result := Point(X + 4, Y);
Break;
end;
end;

WALK_FISH_CB_2:
begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, COLOR_ROAD_CATHERBY, MMX1, MMY1, MMX2, MMy2, 20);
SortTPAFrom(TPA, Point(694, 96));
for I := 0 to High(TPA) do
begin
X := TPA[I].x;
Y := TPA[I].y;

if not RS_onMinimap(X, Y) then
Continue;
Result := Point(X + 5, Y + 4);
Break;
end;
end;

WALK_FISH_CB_3:
begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color_WATER, MMX1, MMY1, MMX2, MMy2, 20);
SortTPAFrom(TPA, Point(684, 106));
for I := 0 to High(TPA) do
begin
X := TPA[I].x;
Y := TPA[I].y;

if not RS_onMinimap(X, Y) then
Continue;
Result := Point(X + 5, Y + 4);
Break;
end;
end;


WALK_FISH_CB_BANK_3:
begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, COLOR_WATER, MMX1, MMY1, MMX2, MMy2, 20);
SortTPAFrom(TPA, Point(627, 82));
for I := 0 to High(TPA) do
begin
X := TPA[I].x;
Y := TPA[I].y;

if not RS_onMinimap(X, Y) then
Continue;
Result := Point(X + 4, Y);
Break;
end;
end;

WALK_FISH_CB_BANK_2:
begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, COLOR_ROAD_CATHERBY, MMX1, MMY1, MMX2, MMy2, 20);
SortTPAFrom(TPA, Point(574, 55));
for I := 0 to High(TPA) do
begin
X := TPA[I].x;
Y := TPA[I].y;

if not RS_onMinimap(X, Y) then
Continue;
Result := Point(X + 5, Y + 4);
Break;
end;
end;


WALK_FISH_CB_BANK_1:
begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, COLOR_CB_BANK_FLOOR, MMX1, MMY1, MMX2, MMy2, 20);
SortTPAFrom(TPA, Point(557, 74));
for I := 0 to High(TPA) do
begin
X := TPA[I].x;
Y := TPA[I].y;

if not RS_onMinimap(X, Y) then
Continue;
Result := Point(X + 5, Y + 4);
Break;
end;
end;

else
MSI_SubDebug('MSI_FISH_CBPoints: Invalid walk point!');
end;

end;

Coh3n

2010-12-15 02:21:59

From: the smith400
Yeah I did add a color walking for catherby fisher. I was very pleased with my progress and understanding of how to add one before it fudged up on me..

The problem is probably with the color. The minimap colors change A LOT every time you reload the client. So you have to reload it several times, picking colors in ACA until you can find the best one.

the smith400

2010-12-15 07:20:50

From: Coh3n
The problem is probably with the color. The minimap colors change A LOT every time you reload the client. So you have to reload it several times, picking colors in ACA until you can find the best one.


I really feel so sorry for you guys, Jagex is really being a bitch about this.. I wonder why?

Thanks Coh3n :)

Love learning a new thing everyday