SRL Archive - OSR Help

Help with my fisher [SIMBA]


wondersueak

2010-12-19 02:09:01

Yes, I have read the tutorials.

The problem is, I have no clue how to plug it all in.

I am making a Catherby Fisher that supports all the different spots there.

So far this is all I have:

program WondersCatherbyFisher;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Integers[0] := '';
end;


procedure BankFishes;
begin
if not LoggedIn then
Exit;
if not BankScreen then
R_OpenBankBooth('ctb');
if PinScreen then
InPin(Players[0].Pin);
if BankScreen then
begin
DepositAll;
Withdraw(1, 1, 27);
Closebank;
end;
end;


procedure SetupPlayer;
var
Me: TMe;
begin
Wait(1000+Random(1000));
Me:= GetMe;
Players[CurrentPlayer].Integers[2]:= Me.Levels[Skill_Fishing];
Players[CurrentPlayer].Integers[3]:= Me.Experience[Skill_Fishing];
SetAngle(True);
end;


Procedure WalkToBank;
begin
Walkpath([Tile(3614, 2791), Tile(3611, 2794), Tile(3609, 2798),
Tile(3606, 2798), Tile(3599, 2801), Tile(3593, 2802),
Tile(3586, 2803), Tile(3581, 2803), Tile(3575, 2802),
Tile(3570, 2801), Tile(3570, 2805)]);
end;


procedure WalkToFishingSpot;
begin
Walkpath([Tile(3570, 2801), Tile(3577, 2803), Tile(3592, 2803),
Tile(3597, 2800), Tile(3603, 2797), Tile(3609, 2795),
Tile(3613, 2791)]);
end;

function ClickTheSpot: Boolean;
var
NPCs: array of TNPC;
x, y, i, j: Integer;
SpotTile: TTile;
SpotPoint: TPoint;
begin
NPCs := SortNPCs(GetNPCs);
for i := 0 to High(NPCs) do
begin
if ((NPCs[i].Name = 'Fishing spot')) then
begin
for j := 0 to High(NPCs[i].Actions) do
begin
if (NPCs[i].Actions[j] = 'Cage') then
begin
SpotTile := NPCs[i].Tile
Break;
end;
end;
end;
end;
SpotPoint := TileToMS(SpotTile, 0);
MMouse(SpotPoint.x, SpotPoint.y, 4, 4);
if (r_WaitUpText('age', 800)) then
begin
ClickMouse2(False);
Result := r_WaitOption('age', 800);
end;
end;


procedure TypeOfFishing;
begin
case Players[CurrentPlayer].Integers[0] of
0: Players[CurrentPlayer].Strings[0] := 'Cage';
1: Players[CurrentPlayer].Strings[0] := 'Harpoon';
2: Players[CurrentPlayer].Strings[0] := 'Net';
3: Players[CurrentPlayer].Strings[0] := 'Lure';
4: Players[CurrentPlayer].Strings[0] := 'Bait';
end;
end;


begin
Smart_Server := 32;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
SetupReflection;
DeclarePlayers;
LoginPlayer;
SetupPlayer;
WalkToBank;
WalkToFishingSpot;
ClickTheSpot;
TypeOfFishing;
CheckHarpoonSpotType;
end.

P1nky

2010-12-19 02:25:42

usually i make a outline first such as:


procedure FindFishes;

Procedure Bank;

Procedure Walk;

//and so on... than you can move it around and plug in the code and be like

Begin
walk;
bank;
//and so on...
end;

wondersueak

2010-12-19 02:29:07

Ah, thanks! That helped. Now I at least no where to start….

Edit:

Good, or bad banking? Tips?:
procedure BankFishes;
begin
if (not(LoggedIn)) then Exit;
OpenBank('veb', True, True);
if (PinScreen) then InPin('1337')
if (bankscreen) then
DepositAll;
Withdraw(1, 1, 27);
CloseBank;
end;

Edit edit:
How do I get my characters position on a map? This is for the walking. I want to get the tile position. I've looked up the different types of walking, but I just want some simple tile walking.

KingKong

2010-12-19 03:11:56

Since you are using reflection I recommend using R_OpenBankBooth('veb') to open bankbooth since color has problems sometimes. You don't need brackets after the if statements since you are using it test only one thing.

Here is what I would use:

procedure BankFishes;
begin
if not LoggedIn then
Exit;
if not BankScreen then
R_OpenBankBooth('veb');
if PinScreen then
InPin(Players[0].Pin);
if BankScreen then
begin
DepositAll;
Withdraw(1, 1, 27);
Closebank;
end;
end;

wondersueak

2010-12-19 03:17:29

Ah, thanks. Yeah, I've seen color mess up big time when finding bank booths.

Any advice on how to get my tile position, and then walk to the tile position I choose?

KingKong

2010-12-19 03:28:00


procedure findme;
var
Me: TMe;
begin
Me := GetMe;
writeln(ToStr(Me.Tile.x) + ', ' + ToStr(Me.Tile.y));
this prints out your position on the mainmap, to walk somewhere use sumilions pathmaker.

P.S. This uses reflection, so make sure to include reflection.simba in your script.

Edit: Is this your first script? If it is then maybe you should script for other easy skills(eg: cooking or smithing/magic) Because I started out making out those scripts.

wondersueak

2010-12-19 03:39:44

yeah, I just included it after I realized I only included srl and smart.

Well, It is my first successfulish script. My real first one was really crappy and didn't even run… Heheheh, I've been observing scripts I use thinking… "Hmm… What does this do?" and trying to figure it out.

The thing is, I really need a catherby fisher right now, and there isn't a lot of working fishers in the forums. Maybe one or two. (At least the forums I can access). Plus, I want this to reinforce everything into my head, and I'm the type of person who needs a challenge.

When i went to download the pathmaker it opened up a bunch of files in my Winrar and I didn't know which one to open… How do I download and run it? I know where to download it from… but which file do I click to run it? where do I put the file?

KingKong

2010-12-19 03:41:20

run pathmaker.exe and load the map of runescape.

wondersueak

2010-12-19 04:05:39

It gives me:
PathMaker.cfg
PathMaker.dof
PathMaker.dpr
PathMaker.res

but no cfg file.

KingKong

2010-12-19 04:11:03

looks like you downloaded the source.

wondersueak

2010-12-19 04:24:08

How do I download the actual program? I only found the source on the page.

Gosh, I feel really noobish now :P

KingKong

2010-12-19 04:31:16

I think this page might have actual program:
http://simbareflection.googlecode.com/svn/trunk/Tools/PathMaker/

but i forgot where i got it from(maybe from same place)

wondersueak

2010-12-19 04:36:37

Ah, thanks so much. I can't work on it anymore tonight (Need sleep), but I'll work on it more in the morning.

Awkwardsaw

2010-12-19 14:23:37

walking to the fishing spots is super easy, all you need is a few radialwalks and autocolors. as for banking, openbankfast or openbanknpc works just as well, if not faster than reflection(plus it doesnt break every update ;))

wondersueak

2010-12-19 17:19:09

Thanks! I'll keep that in mind

This is what I have so far:
program WondersCatherbyFisher;
{$ srl/srl/misc/smart.scar}
{$ srl/srl.scar}
{$ reflection/reflection.simba}


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
end;


procedure BankFishes;
begin
if not LoggedIn then
Exit;
if not BankScreen then
R_OpenBankBooth('veb');
if PinScreen then
InPin(Players[0].Pin);
if BankScreen then
begin
DepositAll;
Withdraw(1, 1, 27);
Closebank;
end;
end;


procedure SetupPlayer;
var
Me: TMe;
begin
Wait(1000+Random(1000));
Me:= GetMe;
Players[CurrentPlayer].Integers[2]:= Me.Levels[Skill_Fishing];
Players[CurrentPlayer].Integers[3]:= Me.Experience[Skill_Fishing];
SetAngle(True);
MarkTime(TimeSinceLastBreak);
end;


function LoadPath: TPointArray;
begin
SetLength(Result, 11);

Result[0] := Point(3614, 2791);
Result[1] := Point(3611, 2794);
Result[2] := Point(3609, 2798);
Result[3] := Point(3606, 2798);
Result[4] := Point(3599, 2801);
Result[5] := Point(3593, 2802);
Result[6] := Point(3586, 2803);
Result[7] := Point(3581, 2803);
Result[8] := Point(3575, 2802);
Result[9] := Point(3570, 2801);
Result[10] := Point(3570, 2805);
end;


Procedure WalkToBank;
Var
I: Integer;
Path: TPointArray;

Begin
Path := LoadPath;
for i := 0 to High(Path) do
Begin
WalkToTile(Path[i], 3, 0);
end;
Wait(500+Random(300));
end;


begin
Smart_Server := 32;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SetupPlayer;
WalkToBank;
end.

But, I get a compiling error at line:
[Error] (10:3): Unknown identifier 'HowManyPlayers' at line 9
Compiling failed.

*And I know that it says 'veb' I'm going to change that*

Awkwardsaw

2010-12-19 19:21:09

change {$ srl/srl.scar} to {$include srl/srl.scar}

wondersueak

2010-12-19 19:28:34

Thanks! Can't, believe, I, made, that, mistake. :P

Huh, now when I try to compile it opens the TileCore file and spits this out:

[Error] C:\Users\Glenna\Documents\Simba\Includes\reflection\./Core/TileCore.simba(86:9): Unknown identifier 'SmartGetFieldObject' at line 85
Compiling failed.

Awkwardsaw

2010-12-19 19:58:35

something is wrong with your plugins(most likley)

how are you installing SRL, srl extension for simba, or svn?

KingKong

2010-12-19 20:07:56

Tip: Write setupreflection after you setupsrl
As for your walking function, delete procedure walktobank. Then for all of your tpoints, remove everything before the tile coordinates and replace with tile. Eg:
From Result[0] := Point(3614, 2791); to Tile(3614, 2791). After that Use WalkPath([Tile(x1, y1), Tile(x2, y2)…..Tile(xn, yn)]); to walk flawlessly(or so its said)

wondersueak

2010-12-19 20:41:13

Oh, okay. Thanks!

I use SVN.

I tried replacing my plugins, but I still get the same result.

Could you give me yours?

iroki and libsmart.

Still get the errors with the SetupReflection under SetupSRL

KingKong

2010-12-19 20:48:31

replace your top three lines after program blahblah; with these lines
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}

wondersueak

2010-12-19 20:55:06

Thanks.

That gets rid of that tile error.

is this right/are there any vars or integers I need to declare?:
function LoadPath: TPointArray;
begin
SetLength(Result, 11);

Result[0] := Point(3614, 2791); to Tile(3614, 2791);
Result[1] := Point(3611, 2794); to Tile(3611, 2794);
Result[2] := Point(3609, 2798); to Tile(3609, 2798);
Result[3] := Point(3606, 2798); to Tile(3606, 2798);
Result[4] := Point(3599, 2801); to Tile(3599, 2801);
Result[5] := Point(3593, 2802); to Tile(3593, 2802);
Result[6] := Point(3586, 2803); to Tile(3586, 2803);
Result[7] := Point(3581, 2803); to Tile(3581, 2803);
Result[8] := Point(3575, 2802); to Tile(3575, 2802);
Result[9] := Point(3570, 2801); to Tile(3570, 2801);
Result[10] := Point(3570, 2805); to Tile(3570, 2805);
end;

and could you give me an example of the: WalkPath([Tile(x1, y1), Tile(x2, y2)…..Tile(xn, yn)])

not quite sure what you mean there… ^^

KingKong

2010-12-19 21:04:39

Looks like i didn't explain properly, but this is all you need to walk:


Walkpath([Tile(3614, 2791), Tile(3611, 2794), Tile(3609, 2798),
Tile(3606, 2798), Tile(3599, 2801), Tile(3593, 2802),
Tile(3586, 2803), Tile(3581, 2803), Tile(3575, 2802),
Tile(3570, 2801), Tile(3570, 2805)]);

wondersueak

2010-12-19 21:08:09

Ah, thanks.

I get this error:
[Hint] C:\Users\Glenna\Documents\Simba\Simba\Includes\SRL/SRL/core/gametab.scar(1513:3): Variable 'P' never used at line 1512
[Error] (55:35): Identifier expected at line 54
Compiling failed.

line 54:
Result[0] := Point(3614, 2791); to Tile(3614, 2791);

Awkwardsaw

2010-12-19 21:19:45

you have to actually remove the "Point(3614, 2791); to"

wondersueak

2010-12-19 21:20:56

Oh, Thanks :P

Sweet, no compiling errors or errors of any kind. Now for me to finish my script. I'll post if I have another problem

KingKong

2010-12-19 21:30:35

delete your function loadpath then do this:

procedure walk;
begin
Walkpath([Tile(3614, 2791), Tile(3611, 2794), Tile(3609, 2798),
Tile(3606, 2798), Tile(3599, 2801), Tile(3593, 2802),
Tile(3586, 2803), Tile(3581, 2803), Tile(3575, 2802),
Tile(3570, 2801), Tile(3570, 2805)]);
end;

Awkwardsaw

2010-12-19 21:32:52

From: kongking
delete your function loadpath then do this:

procedure walk;
begin
Walkpath([Tile(3614, 2791), Tile(3611, 2794), Tile(3609, 2798),
Tile(3606, 2798), Tile(3599, 2801), Tile(3593, 2802),
Tile(3586, 2803), Tile(3581, 2803), Tile(3575, 2802),
Tile(3570, 2801), Tile(3570, 2805)]);
end;


maby he doesnt want to use that function, and instead make his own, more usefull function? :)

KingKong

2010-12-19 21:53:22

Or maybe he's confused? :P

Awkwardsaw

2010-12-19 23:16:04

From: kongking
Or maybe he's confused? :P


we wouldnt know, because he hasnt gotten to that part of the script yet ;)

wondersueak

2010-12-20 00:03:59

I was confused (and I'm a she). I didn't know weather loadpath was necessary or not.

Thanks! :D

How do I actually find the fishing spot and select fishing using reflection?
I have the walking procedures done.

Never mind. I got help and a quick walkthrough.