SRL Archive - First Scripts

Guild Fisher Alpha Release.


apx900

2009-04-16 02:43:38

First things first,
This is like my first script that does more then one task
This is also the first script that involves different locations
This script does not have anti-randoms.
It does have an ok antiban.
I will hopefully update it with improvements.
I recommend NOT RUNNING THIS SCRIPT UNATTENDED.

Please DO Post Some Proggies and any comments which may help me improve this.


program Apx900GuildFisher;
{.include SRL/SRL.scar}
{.include SRL/SRL/Misc/arrayLoader.scar}
{.include srl/srl/misc/Users.scar}


Var
x,y,Banked:integer;

const
DockColour = 799294;
MiniOblisk = 11517872;



procedure PlayerSetup;
begin
LampSkill := 'fletching'//If It Finds Lamp What Skill? yet to use
CurrentPlayer := 0; //Int!
HowManyPlayers := 1; //Int!
NumberOfPlayers(HowManyPlayers);
Players[0].Name := ' ';//UserName
Players[0].Pass := ' '; //Password
Players[0].Nick := ' '; //Nick Name
Players[0].Active := True; //Use This Player [ True / False ]
Players[0].Integers[0] := 10; //Number Of Loads
Players[0].Strings[0] := ' '; //BankPin [If Any]
Players[0].Integers[1] := 75; //Logout Every How many loads?
Players[0].Integers[2] := 3; //Stay Logged Out for how many minutes?
end;



procedure introtext;
begin;
cleardebug;
writeln('');
wait(300);
writeln(' _____ ______________ ___ ________ .__.__ .___');
wait(300);
writeln(' / _ \\______ \ \/ / / _____/ __ __|__| | __| _/');
wait(300);
writeln(' / /_\ \| ___/\ / / \ ___| | \ | | / __ | ');
wait(300);
writeln('/ | \ | / \ \ \_\ \ | / | |__/ /_/ | ');
wait(300);
writeln('\____|__ /____| /___/\ \ \______ /____/|__|____/\____ | ');
wait(300);
writeln(' \/ \_/ \/ \/ ');
wait(300);
writeln('___________.__ .__ ');
wait(300);
writeln('\_ _____/|__| _____| |__ ___________ ');
wait(300);
writeln(' | __) | |/ ___/ | \_/ __ \_ __ \ ');
wait(300);
writeln(' | \ | |\___ \| Y \ ___/| | \/ ');
wait(300);
writeln(' \___ / |__/____ >___| /\___ >__| ');
wait(300);
writeln(' \/ \/ \/ \/ ');
wait(300);
writeln('');
end;

procedure FastSwitchTabs; // Taken from RM Fisher by Rasta Magician
var x, y, i, h:integer;
begin
if not LoggedIn then exit;
GetMousePos(x, y);
PickUpMouse;
IncEx(MouseSpeed, 10);
i := GetCurrentTab;
repeat
h := 1+Random(12);
until(h <> i)
GameTab(h);
wait(500+Random(500));
GameTab(i);
MMouse(x, y, 3, 3);
DecEx(MouseSpeed, 10);
end;

procedure Apx900AntiBan;
begin
case random(8) of
0: PickUpMouse;
1: Writeln('Decided, Its Wise To Not Perform Antiban This Round');
2: RandomMovement;
3: Writeln('Decided, Its Wise To Not Perform Antiban This Round');
4: RandomRClick;
5: Writeln('Decided, Its Wise To Not Perform Antiban This Round');
6: case random(3) of
0: HoverSkill('Attack', false);
1: HoverSkill('Strength', false);
2: HoverSkill('Defence', false);
3: HoverSkill('Fishing', false);
7: FastSwitchTabs; //taken from RM Fisher By Rasta Magician
8: Writeln('Decided, Its Wise To Not Perform Antiban This Round');
end;
end;
end;

Procedure Proggy;
begin
ClearDebug;
Banked := Banked + 1;
writeln('---------------//////----------------');
writeln('--------------( o o )----------------');
writeln('-----------oo0--(_)-0oo--------------');
Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=');
Writeln('|| Banked ' + IntToStr (Banked)+ ' Times ||');
Writeln('|| Gained ' + IntToStr (Banked*2430)+ ' Exp ||');
Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=');
Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=');
end;


Procedure Equipmentcheck;
Begin
MMouseItem(1);
if IsUpText('Lobster pot')then
begin
WriteLn('Found Lobster Pot');
end else
WriteLn('Lobster Pot Not Found');
exit;
end;

Procedure ToDock;{Working}
begin
RadialRoadWalk(DockColour, 70, 100, 50, -1, 1);
end;

Procedure ToBank;
Begin
if LoggedIn then SymbolAccuracy := 0.5;
writeln('Inventory Full.');
RadialWalk(MiniOblisk, 270, 225, 90, 1, -1);
FindSymbol(x, y, 'Bank');
mouse(x,y,4,2,true);
SymbolAccuracy := 0.8;
end;

Procedure OpenTheBank;
begin
repeat
FindBank('db');
If not BankScreen then FindBank('akb');
until BankScreen;
end;

Procedure DepositItem;
begin
MouseItem(2,false);
wait(Random(500));
ChooseOption('sit-All');
Proggy;
wait(Random(2000));
end;


Procedure FindfishingSpot;
begin
repeat
FindObjCustom(x,y,['cage','age','cag'],[8943468,8417382,9340029,8944499,11379871,
10195339,9800323],20)
mouse(x,y,4,4,false);
until ChooseOption('Cage');
end;

Procedure InventoryCheck;
begin
ClearDebug;
repeat
if not InvFull then WriteLn('Inventory Not Full.');
WriteLn('Attempting To Perform Antiban');
Apx900AntiBan;
wait(random(60000));
FindFishingSpot;
wait(random(5000));
Apx900AntiBan;
until InvFull;
end;

Procedure OffToBank;
begin
ToBank;
end;

Procedure MainLoop;
begin
SetupSrl;
PlayerSetup;
Writeln('Logging In');
LoginPlayer;
repeat
ToDock;
InventoryCheck;
OpenTheBank;
DepositItem;
ToDock;
until false;
end;

Begin
activateclient;
setupsrl;
IntroText;
PlayerSetup;
Writeln('Logging In');
LoginPlayer;
Equipmentcheck;
ToDock;
repeat
InventoryCheck;
OffToBank;
OpenTheBank;
DepositItem;
Proggy;
wait(random(2000));
ToDock;
until Banked =(Players[0].Integers[0]);
end.

senrath

2009-04-16 02:51:03

Looks interesting. I'm not a member, so I can't test it, but I can say some things just from looking. First, in your anti-ban, your case with random(9) should run from 0..8, while you currently have it run 0..9. But you also skipped the number 1, so you can just renumber to make it work right. Also, you don't have to have a case for each possible number.

Second, in your OpenTheBank procedure, you have the possibility of an infinite loop. A good idea would be to add a time limit or limit the number of tries.

apx900

2009-04-16 02:54:04

Good Points. i'v fixed the case issue and re uploaded it again.

Smarter Child

2009-04-16 03:22:13

Gosh, get standards! Why is i that you use standards in the beginning then shift over to not using standards!

Good first script though, since this is your first i don't really care about your standards :p.

Procedure OpenTheBank;
begin
repeat
FindBank('db');// i kinda edited the standards...people like be b**ch at people who don't use them lol...LOL:P JK
If not BankScreen then FindBank('akb');
until BankScreen;
end;

?? Why find alkharid bank if originally you wanna find draynor bank??

Hint: Don't expect people to actually use this script…

senrath

2009-04-16 03:27:12

Erm, you misunderstood what I was getting at with the antiban. random(num) returns a number in the range 0..num-1. So for the way you have it set up right now, with 0..8 as the options, you want random(9).

noidea

2009-04-16 04:11:33

From: Smarter Child
Gosh, get standards! Why is i that you use standards in the beginning then shift over to not using standards!

Good first script though, since this is your first i don't really care about your standards :p.

Procedure OpenTheBank;
begin
repeat
FindBank('db');// i kinda edited the standards...people like be b**ch at people who don't use them lol...LOL:P JK
If not BankScreen then FindBank('akb');
until BankScreen;
end;

?? Why find alkharid bank if originally you wanna find draynor bank??

Hint: Don't expect people to actually use this script…


Chill out… This is his first real attempt. I remember you 'having standards' when you started. And 'Hint: Don't expect people to actually use this script…' is mean…


apx900, this is a nice attempt :) The key to a good script are fail safes, meaning 'if then. 'statements.

Procedure ToBank;
var
x, y: Integer;
begin
if not RadialWalk(...) then
begin
If not FindSymbol(...) then
begin
writeln('No bank found');
exit;
end else
begin
mouse(x, y...);
flag;
exit;
end;
end;
end;



Also, as you advance down the road, you should look into TPA's, DTM's, and DDTM's.
TPA's will confuse you now, but after help and tuts, you will understand :)

Very nice job.

apx900

2009-04-16 17:08:29

i've come to the conclusion that making a fisher is like ten times harder then making lets say a willow banker, so my next project is making a wc cutter and banker.

Naike

2009-04-17 00:59:44

Took the time to add standards to your script..


program Apx900GuildFisher;
{.include SRL/SRL.scar}
{.include SRL/SRL/Misc/arrayLoader.scar}
{.include srl/srl/misc/Users.scar}


Var
x,y,Banked:integer;

const
DockColour = 799294;
MiniOblisk = 11517872;



procedure PlayerSetup;
begin
LampSkill := 'fletching'//If It Finds Lamp What Skill? yet to use
CurrentPlayer := 0; //Int!
HowManyPlayers := 1; //Int!
NumberOfPlayers(HowManyPlayers);
Players[0].Name := ' ';//UserName
Players[0].Pass := ' '; //Password
Players[0].Nick := ' '; //Nick Name
Players[0].Active := True; //Use This Player [ True / False ]
Players[0].Integers[0] := 10; //Number Of Loads
Players[0].Strings[0] := ' '; //BankPin [If Any]
Players[0].Integers[1] := 75; //Logout Every How many loads?
Players[0].Integers[2] := 3; //Stay Logged Out for how many minutes?
end;



procedure introtext;
begin;
cleardebug;
writeln('');
wait(300);
writeln(' _____ ______________ ___ ________ .__.__ .___');
wait(300);
writeln(' / _ \\______ \ \/ / / _____/ __ __|__| | __| _/');
wait(300);
writeln(' / /_\ \| ___/\ / / \ ___| | \ | | / __ | ');
wait(300);
writeln('/ | \ | / \ \ \_\ \ | / | |__/ /_/ | ');
wait(300);
writeln('\____|__ /____| /___/\ \ \______ /____/|__|____/\____ | ');
wait(300);
writeln(' \/ \_/ \/ \/ ');
wait(300);
writeln('___________.__ .__ ');
wait(300);
writeln('\_ _____/|__| _____| |__ ___________ ');
wait(300);
writeln(' | __) | |/ ___/ | \_/ __ \_ __ \ ');
wait(300);
writeln(' | \ | |\___ \| Y \ ___/| | \/ ');
wait(300);
writeln(' \___ / |__/____ >___| /\___ >__| ');
wait(300);
writeln(' \/ \/ \/ \/ ');
wait(300);
writeln('');
end;

procedure FastSwitchTabs; // Taken from RM Fisher by Rasta Magician
var x, y, i, h:integer;
begin
if not LoggedIn then exit;
GetMousePos(x, y);
PickUpMouse;
IncEx(MouseSpeed, 10);
i := GetCurrentTab;
repeat
h := 1+Random(12);
until(h <> i)
GameTab(h);
wait(500+Random(500));
GameTab(i);
MMouse(x, y, 3, 3);
DecEx(MouseSpeed, 10);
end;

procedure Apx900AntiBan;
begin
case random(8) of
0: PickUpMouse;
1: Writeln('Decided, Its Wise To Not Perform Antiban This Round');
2: RandomMovement;
3: Writeln('Decided, Its Wise To Not Perform Antiban This Round');
4: RandomRClick;
5: Writeln('Decided, Its Wise To Not Perform Antiban This Round');
6: case random(3) of
0: HoverSkill('Attack', false);
1: HoverSkill('Strength', false);
2: HoverSkill('Defence', false);
3: HoverSkill('Fishing', false);
end;
7: FastSwitchTabs; //taken from RM Fisher By Rasta Magician
8: Writeln('Decided, Its Wise To Not Perform Antiban This Round');
end;
end;

Procedure Proggy;
begin
ClearDebug;
Banked := Banked + 1;
writeln('---------------//////----------------');
writeln('--------------( o o )----------------');
writeln('-----------oo0--(_)-0oo--------------');
Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=');
Writeln('|| Banked ' + IntToStr (Banked)+ ' Times ||');
Writeln('|| Gained ' + IntToStr (Banked*2430)+ ' Exp ||');
Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=');
Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=');
end;


Procedure Equipmentcheck;
Begin
MMouseItem(1);
if IsUpText('Lobster pot')then
WriteLn('Found Lobster Pot') else WriteLn('Lobster Pot Not Found');
end;

Procedure ToDock;{Working}
begin
RadialRoadWalk(DockColour, 70, 100, 50, -1, 1);
end;

Procedure ToBank;
Begin
if LoggedIn then SymbolAccuracy := 0.5;
writeln('Inventory Full.');
RadialWalk(MiniOblisk, 270, 225, 90, 1, -1);
FindSymbol(x, y, 'Bank');
mouse(x,y,4,2,true);
SymbolAccuracy := 0.8;
end;

Procedure OpenTheBank;
begin
repeat
FindBank('db');
If not BankScreen then FindBank('akb');
until BankScreen;
end;

Procedure DepositItem;
begin
MouseItem(2,false);
wait(Random(500));
ChooseOption('sit-All');
Proggy;
wait(Random(2000));
end;


Procedure FindfishingSpot;
begin
repeat
FindObjCustom(x,y,['cage','age','cag'],[8943468,8417382,9340029,8944499,11379871, 10195339,9800323],20)
mouse(x,y,4,4,false);
until ChooseOption('Cage');
end;

Procedure InventoryCheck;
begin
ClearDebug;
repeat
if not InvFull then
WriteLn('Inventory Not Full.');
WriteLn('Attempting To Perform Antiban');
Apx900AntiBan;
wait(random(60000));
FindFishingSpot;
wait(random(5000));
Apx900AntiBan;
until InvFull;
end;

Procedure OffToBank;
begin
ToBank;
end;

Procedure MainLoop;
begin
SetupSrl;
PlayerSetup;
Writeln('Logging In');
LoginPlayer;
repeat
ToDock;
InventoryCheck;
OpenTheBank;
DepositItem;
ToDock;
until false;
end;

Begin
activateclient;
setupsrl;
IntroText;
PlayerSetup;
Writeln('Logging In');
LoginPlayer;
Equipmentcheck;
ToDock;
repeat
InventoryCheck;
OffToBank;
OpenTheBank;
DepositItem;
Proggy;
wait(random(2000));
ToDock;
until Banked =(Players[0].Integers[0]);
end.

Psst. Only posted in code tags so you can copy it.

ian.

2009-04-18 02:24:16

D:< bad standards

capital functions/procedures >:/

it's Wait not wait and ActivateClient not activateclient >.<

(sorry, i r teh standard nazi).

Smarter Child

2009-04-18 02:37:34

From: noidea
Chill out… This is his first real attempt. I remember you 'having standards' when you started. And 'Hint: Don't expect people to actually use this script…' is mean…


apx900, this is a nice attempt :) The key to a good script are fail safes, meaning 'if then. 'statements.

Procedure ToBank;
var
x, y: Integer;
begin
if not RadialWalk(...) then
begin
If not FindSymbol(...) then
begin
writeln('No bank found');
exit;
end else
begin
mouse(x, y...);
flag;
exit;
end;
end;
end;



Also, as you advance down the road, you should look into TPA's, DTM's, and DDTM's.
TPA's will confuse you now, but after help and tuts, you will understand :)

Very nice job.


*cough* When i started out i had a good form of standards, plus i am not being mean, it's his first script, I would rather warn people not to you use it..
–Btw, i never posted my first script yet, maybe i should post it lol…:p

purescar37

2009-05-13 21:28:56

looks nice thanks :P

Sape1

2009-05-15 23:32:48

Hi, so I was using your script.

It fished and then deposited the lobsters into the bank correctly, however instead of exiting the bank it started moving my mouse onto various items around my bank instead of exiting and walking back to the fishing pier. Also instead of showing the proggy after it had deposited it just said "Inventory Not Full." =s Perhaps this was an error on my end rather than the scripts.
Because it clicked on the fishing spots reasonably quickly, it sometimes stopped fishing for a while (I'm guessing it was due to this) Until it clicked again. If it is possible to make a check so that it will only find and click a new fishing spot when the one it is fishing from moves/disappears, then I think that would be a useful thing to add.

I think that is about it for what I noticed wrong with it. It seems like it could be a pretty decent script (although it may already be, I might have just managed to do something =[ )

DeSnob

2009-05-16 00:33:20

This isn't as great of a script as it can be. However, if you learn how to learn and sign up for Srl Members, Rasta Magician, a great Dev/Mod has guild fisher. Since his Powerfisher was great, i believe his Guilder Fisher should be too.

holyhustler106

2009-06-28 23:16:59

i tested it and its very buggy because its not accurate and slow

Griff

2009-06-28 23:47:23

From: apx900
i've come to the conclusion that making a fisher is like ten times harder then making lets say a willow banker, so my next project is making a wc cutter and banker.


You're right, fishers are some of the harder things to do.

Try learning standards, because they made the code easier to read, and its a big bonus for when you apply for membership. (which I'm assuming is your goal). For a first script, really good job! Your object finding could be improved with the use of TPAs, which might be a little confusing, but you'll learn them easy enough. You can learn really simple yet effective object finding in my tutorial for making a basic wcer, which is what you said you wanted to make, so check in out in my signature.

Coh3n

2009-06-29 03:23:03

Hey I looked at your script and it's not bad for a first. There's a lot that can be improved on, but no one's first script is perfect. ;) Don't get discouraged about what some people say, most of the time they're only trying to help you, and sometimes it just comes out wrong. If they explicitly make fun of you, just ignore them because I guarantee they weren't master scripters when they first started either. Try to take criticism as a positive thing, take it as a compliment, because if someone criticizes you, it's only because they know you can do better. :)

You're on the right track, and yes, fishers are difficult to make, but I think you should stick to it, you'll understand it better and better the more you do, and the more you read about scripting.

From personal experience, reading tutorials helps A LOT! But don't just read them, do the procedures/functions along with the tutorial, you'll have a better understanding and a better chance of remembering it that way.

Keep it up, it'll come faster than you think, just stick to it. ;)

apx900

2009-10-11 11:41:51

I dont think a lot of people have used or even looked at this script, but for anyone who might consider this, just like to let you all know that i'm in the process of updating this script to work wiht the updates, and instead of colours the script will use TPA for finding the fishing spots, and thats just some of the improvements. will let everyone know once its ready