SRL Archive - Archive

lancelot074 - SRL Member Application Form


Lancelot074

2008-03-27 12:47:30

<!– BEGIN TEMPLATE: formanswers –>
lancelot074 - SRL Member Application Form
lancelot074

What is the meaning to life?


Where you Referred to SRL? If yes, by whom?
no


Programming Knowledge
Nope

Other Communitys
Some game websites

How Long have You Played Runescape
like 4 years or so

Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.

I like to script and I am dedicated, that is why I keep applying. I always work hard to reach my goals. I like to learn new things and make new friends. I also don't mind helping others out. I like to script because it is relaxing and it gives me something to do.

——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted

{//////////////////////////////////////////////////////////////
[ Script by : Lancelot074 ]
[ Version : 0.5 ]
---------------------------------------------------------------
Description : Tans cowhides in al-kharid and banks.
---------------------------------------------------------------
-SETUP-
1.Place char(s) at al-kharid bank.
2.Place hides and cash near the top of the bank.
3.Declare players, and run!
4.Post progress reports please.
History:

v.01 - first release

v.02 - better Ellis finding
- better bank finding
- better walking
- added more antiban

v.03 - fixed some error

v.04 - Added a lot of failsafes
- Better progress report

v.05 - Added BankPin support

V.06 - Fixed up script some more

Credits:
Drizzt - teaching me about TPA's and other stuff - great guy

///////////////////////////////////////////////////////////////}
program TannerPlz;
{.include srl/srl/misc/smart.scar}
{.include SRL/SRL.scar}

Const
Cashtodraw = 30000;//Cash to withdraw, adds a randoms amount on
SmartWorld = 111;//World to run SMART on

var
x, y, i, LoadNum, Tanned, HideDTM, CoinsDTM, BuyDTM, BankDTM, RockColor, CactusColor:integer;

procedure DeclarePlayers;
begin
SRLId:= ''; //Fill these in, or get one from
SRLPassword:= ''; //Stats.srl-forums.com

HowManyPlayers :=2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;

Players[0].Name :='';//username
Players[0].Pass :='';//password
Players[0].Nick :='';//2-4 letters of username
Players[0].Active:=True;//Want to use player?
Players[0].Integers[1]:= 10;//Loads to do
Players[0].Pin := 0000;//bankpin, leave if have none

Players[1].Name :='';//username
Players[1].Pass :='';//password
Players[1].Nick :='';//2-4 letters of username
Players[1].Active:=True;//Want to use player?
Players[1].Integers[1]:= 5;//Loads to do
Players[0].Pin := 0000;//bankpin
end;

procedure FindRockyColor;
var
Rocky: integer;
begin
if not loggedin then exit;
Rocky := BitmapFromString(11, 10, 'beNpjYKAiyLeQB6JJfjptr' +
'qpYFXirCwGlIAqAKtFkY7WEgIJAKWQ1yMogXLgCCMKlAK4G2TFAB6' +
'AZgukSoBqIS+AIq1+AaiAIygcA/OQp8g==');
RockColor := AutoColorThis(Rocky, 20, MMX1, MMY1, MMX2, MMY2);
FreeBitMap(Rocky);
Writeln('Rock Color = ' + inttostr(rockColor));
findcolor(x,y,RockColor,MMX1, MMY1, MMX2, MMY2);
Writeln('x = ' + inttostr(x) + ' and y = ' + inttostr(y));
end;

procedure FindCactusColor;
var
Cactus: integer;
begin
if not loggedin then exit;
cactus := BitmapFromString(11, 11, 'beNpjYCADRBQYoTGQQWC8AV' +
'YFGV6aaAqAJJoJQCkgurCpAiIFRL7R4shqIAogJsAVYDoArgCPL5D' +
'dSZ4C0gAAcOEfiA==');
CactusColor := AutoColorThis(Cactus, 20, MMX1, MMY1, MMX2, MMY2);
FreeBitMap(cactus);
Writeln('CactusColor = ' + inttostr(rockColor));
findcolor(x,y,CactusColor,MMX1, MMY1, MMX2, MMY2);
Writeln('x = ' + inttostr(x) + ' and y = ' + inttostr(y));
end;

Procedure randoms;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
FindLamp('Crafting');
If(FindFight)Then
begin
MakeCompass('N');
RunTo('N', True);
Wait(7000 +Random(3000));
RunTo('S', True);
end;
if NoGameTab xor InBlack then
begin
Logout;
NextPlayer(False);
LoadNum:=0;
MakeCompass('N');
end;
end;

procedure AntiBanz;
begin
if not LoggedIn then Exit;
case Random(40) of
0: begin
HoverSkill('Attack', false);
wait(2000+random(1000));
GameTab(4);
end;
1: PickUpMouse;
2: begin
HoverSkill('Crafting', false);
wait(2000+random(1000));
GameTab(4);
end;
3: RandomRClick;
4: BoredHuman;
5: AlmostLogout;
end;
end;

procedure LoadDTms;
begin
HideDTM := DTMFromString('78DA631464646038C7800276AD5FCFF01F480' +
'36518FE0301A31C907592010D302291405A1CC8BA43400D0B9075' +
'85801A3622EC9204B28E1050C30764DD26A04606C8BA845F0D009' +
'62C0E47');
CoinsDTM := DTMFromString('78DA63BCC7C0C0709001051C5920C1F01F483' +
'302F17F20607C05641C6640038C4824907E08244E1050730D481C' +
'23A0E62C11763D0712C7F1AB01007A381058');
BuyDTM := DTMFromString('78DA633CCBC0C0B09001159CF8C1F01F48310' +
'2F17F2060BC0F642C66C00A18613448CD32026A4E12A16607116A' +
'5E00892504D4AC2342CD2620319F801A50F86C26A0E63690D8484' +
'0CD7E20B19E809ABD40622B7E350065531831');
BankDTM := DTMFromString('78DA63BCCDC4C0B0890105BC79F386E13F906' +
'604E2FF40C07809A8661DAA9AB76F213423940F56B3890835DB88' +
'50B31BBF1A00C9D316E2');
end;

Procedure Startbank;
var
time: Integer;
begin
if not Loggedin then exit;
MakeCompass('N');
MarkTime(time);
repeat
if bankscreen then break;
OpenBank('akb',true,true);
until(BankScreen or (TimeFromMark(time) > 120000));
if Bankscreen then
begin
Fixbank;
Wait(1000);
begin
if FindDTM(HideDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
mouse(x, y, 0, 0, false);
Wait(500);
if ChooseOption('Withdraw X')then
begin
wait(1000 + Random(500));
Typesend(inttostr(27 + random(1000)));
wait(1500 + random(300));
Closebank;
randoms;
AntiBanz;
end else
Writeln('Could not find cowhides!');
end;
end;
end;

Procedure Checkcash;
var
time: Integer;
begin
if not Loggedin then exit;
MakeCompass('N');
MarkTime(time);
repeat
OpenBankQuiet('akb')
if pinscreen then inpin(inttostr(Players[currentplayer].pin));
until(BankScreen or (TimeFromMark(time) > 120000));
if Bankscreen then
begin
if not FindDTM (CoinsDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
if FindDTM(CoinsDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
mouse(x, y, 0, 0, false);
Wait(500);
if ChooseOption('Withdraw X')then
begin
wait(1000 + Random(500));
Typesend(inttostr(Cashtodraw+ random(15000)));
wait(2500 + random(300));
CloseBank;
randoms;
end else
Writeln('Couldnt find any coins, exiting');
end;
end;
FreeDTM(CoinsDTM);
end;

procedure ToTanner;
begin
if not loggedin then exit;
if not RadialWalk(RockColor , 336, 359, 66, 0, 0) or
RadialWalk(CactusColor , 40, 80, 66, 0, 0) or
RadialWalk(CactusColor , 40, 90, 70, 0, 0) then
exit;
writeln('Walking failed!');
FFlag(5);
SymbolAccuracy := 0.85;
repeat
symbolaccuracy := symbolaccuracy - 0.05;
wait(1000);
randoms;
until (FindSymbol(x,y,'tanner'));
if(FindSymbol(x,y,'tanner'))then
Mouse(x, y, 2, 2,true);
FFlag(5);
symbolaccuracy := 0.8
end;

Function Talkandbuy:boolean;
var
x,y,i,m,s: integer;
q: tpoint;
tt : tpointarray;
rr : t2dpointarray;
Color1: array [0..4] of Integer;
begin
m := 0;
Color1[0] := 3235209;
Color1[1] := 4087723;
Color1[2] := 5208796;
Color1[3] := 2703218;
Color1[4] := 2966909;
SetAngle(true);
wait(1000);
Marktime(s);
for i := 0 to 4 do
repeat
Findcolorstolerance(tt,Color1[i],MSx1,MSy1,MSx2,MSy2,4);
rr := TpaToATPAex(tt,5,5);
for i:= 0 to high(rr) do
begin
if not loggedin then exit;
if length(rr[i]) > 1 then
begin
q := MiddleTPA(rr[i]);
if (q.x <> 0) and (q.y <> 0) then
begin
Mouse(q.x,q.y,5,5,False);
wait(500);
if ChooseOption('rade') then
begin
Wait(5000+random(225));
if finddtm(buydtm, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
mouse(x, y, 2, 2, false);
Wait(500);
ChooseOption('All');
Wait(1000);
result := true
Closebank;
randoms;
AntiBanz;
if findBlackChatMessage('anner') then exit;
end;
end;
end;
wait(500);
end;
end;
until(result) or (TimeFromMark(s)>100000);
end;

procedure Tobank;
begin
if not loggedin then exit;
if not RadialWalk(RockColor , 170, 204, 72, 0, 0) then
begin
if findsymbol(x,y,'cookery') then
Mouse(x, y + 10, 2, 2, true);
FFlag(5);
end else
Writeln('Walking has failed');
begin
SymbolAccuracy := 0.85;
repeat
symbolaccuracy := symbolaccuracy - 0.05;
wait(1000);
randoms;
until (FindSymbol(x,y,'bank'));
if(FindSymbol(x,y,'bank'))then
Mouse(x, y, 0, 0,true);
FFlag(5);
symbolaccuracy := 0.8
end;
end;

Procedure Banko;
var
time: Integer;
begin
MarkTime(time);
repeat
if (not(Loggedin)) then break;
OpenBankQuiet('akb')
until(BankScreen or (TimeFromMark(time) > 120000));
if Bankscreen then
begin
Deposit(2, 28, 2);
Tanned := Tanned + 27;
LoadNum := LoadNum + 1;
Players[currentplayer].integers[2] := Players[currentplayer].integers[2] + 27;
ReportVars[0]:= ReportVars[0] + 27;
SendSRLReport;
CloseBank;
randoms;
end;
end;

procedure Proggz;
begin
ClearDebug;
WriteLn(' _____ ___ _ ');
WriteLn('/__ \__ _ _ __ _ __ ___ _ __ / _ \ |____ ');
WriteLn(' / /\/ _` | _ \| _ \ / _ \ __/ /_)/ |_ / ');
WriteLn(' / / | (_| | | | | | | | __/ | / ___/| |/ / ');
WriteLn(' \/ \__,_|_| |_|_| |_|\___|_| \/ |_/___| ');
WriteLn('TannerPlz has been running for ' + Timerunning);
WriteLn('We have tanned ' + inttostr(Tanned) + ' hides altogether.');
for i := 0 to (HowManyPlayers - 1) do
begin
if players[i].integers[2] > 0 then
begin
Writeln('"' +Players[i].nick + '"' + '(' + BooltoStr(players[i].Active) + ')' +' has tanned ' + inttostr(players[i].integers[2]) + ' hides');
end;
end;
WriteLn('==============================================');
end;

begin
smartsetupEx(Smartworld,false,true);
SetTargetDC(smartGetDC);
SetupSRL;
ScriptId:= '724';
DeclarePlayers;
LoginPlayer;
LoadDTMs;
Checkcash;
repeat
Startbank;
ToTanner;
Talkandbuy;
Tobank;
Banko;
Proggz;
if (Players[CurrentPlayer].Integers[1]) = Loadnum then
begin
Logout;
NextPlayer(True);
LoadNum:=0;
MakeCompass('N');
end;
until(false);
end.

——————————————————
<!– END TEMPLATE: formanswers –>

Sir R. M8gic1an

2008-03-27 13:06:57

very good script. i see some advanced stuff and some very nooby mistakes which makes me suspicious. perhaps you forgot to credit someone?

~RM

drizzt

2008-03-27 13:14:18

it's a very nice script, i taught him TPA's and helped him a lot on the beginning stages of the script, it turned out a lot better than i thought. yes from me

JAD

2008-03-27 13:38:46

I would suggest adding some fail safes other than just using AutoColorThis to find the color or to still be able to tan without the bitmaps working.

this:


procedure FindRockyColor;
var
Rocky: integer;
begin
if not loggedin then exit;
Rocky := BitmapFromString(11, 10, 'beNpjYKAiyLeQB6JJfjptr' +
'qpYFXirCwGlIAqAKtFkY7WEgIJAKWQ1yMogXLgCCMKlAK4G2TFAB6' +
'AZgukSoBqIS+AIq1+AaiAIygcA/OQp8g==');
RockColor := AutoColorThis(Rocky, 20, MMX1, MMY1, MMX2, MMY2);
FreeBitMap(Rocky);
Writeln('Rock Color = ' + inttostr(rockColor));
findcolor(x,y,RockColor,MMX1, MMY1, MMX2, MMY2);
Writeln('x = ' + inttostr(x) + ' and y = ' + inttostr(y));
end;

procedure FindCactusColor;
var
Cactus: integer;
begin
if not loggedin then exit;
cactus := BitmapFromString(11, 11, 'beNpjYCADRBQYoTGQQWC8AV' +
'YFGV6aaAqAJJoJQCkgurCpAiIFRL7R4shqIAogJsAVYDoArgCPL5D' +
'dSZ4C0gAAcOEfiA==');
CactusColor := AutoColorThis(Cactus, 20, MMX1, MMY1, MMX2, MMY2);
FreeBitMap(cactus);
Writeln('CactusColor = ' + inttostr(rockColor));
findcolor(x,y,CactusColor,MMX1, MMY1, MMX2, MMY2);
Writeln('x = ' + inttostr(x) + ' and y = ' + inttostr(y));
end;

Could be shortened to this:


procedure DeclareBitmaps;
begin
cactus := BitmapFromString(11, 11, 'beNpjYCADRBQYoTGQQWC8AV' +
'YFGV6aaAqAJJoJQCkgurCpAiIFRL7R4shqIAogJsAVYDoArgCPL5D' +
'dSZ4C0gAAcOEfiA==');
Rocky := BitmapFromString(11, 10, 'beNpjYKAiyLeQB6JJfjptr' +
'qpYFXirCwGlIAqAKtFkY7WEgIJAKWQ1yMogXLgCCMKlAK4G2TFAB6' +
'AZgukSoBqIS+AIq1+AaiAIygcA/OQp8g==');
end;

procedure AutoColorBitmaps(var Color, BMP: Integer;)
begin
if not loggedin then exit;
Color := AutoColorThis(BMP, 20, MMX1, MMY1, MMX2, MMY2);
FreeBitMap(BMP);
Writeln(IntToStr(BMP) + ' = ' + inttostr(rockColor));
findcolor(x,y,Color,MMX1, MMY1, MMX2, MMY2);
Writeln('x = ' + inttostr(x) + ' and y = ' + inttostr(y));
end;

Maybe that's not too much shorter but IMO it looks more professional. :)


You should also, when/if you do a fail safe in the autocoloring, is check if after using FindColor, checking if x and y equal 0,0 after that because that would mean that it didn't find the color.

In randoms, you should call for FindLamp before FindNormalRandoms; because if there was a lamp, FindNormalRandoms would have solved it already (probably).


if NoGameTab xor InBlack then

I think xor should be or, or maybe you meant xor cause I don't know what xor does because I never used it :p

I think it would have found InBlack in the FindNormalRandoms, because FindFastRandoms stuff was put in to FindNormalRandoms, correct me if I'm wrong.

RandomRClick isn't in newer SRL versions from what I know unless that's changed (although you may have gotten that from my tutorial(s) :))

For my shortening of code above, you could put the 2 bitmaps in with the LoadDTM's and that would actually make it shorter :p

Maybe try different bank openers as fail safes instead of repeatedly trying the same one? That may be more effective.

I don't get why you open the bank again in CheckCash procedure.

Your coins DTM may not work with the shape of the coins changing at different amounts, correct me if I'm wrong, but I'd check that out. The reason I say this is because I don't believe you've tested it if it doesn't compile.

In ToTanner, I think with this:


if not RadialWalk(RockColor , 336, 359, 66, 0, 0) or
RadialWalk(CactusColor , 40, 80, 66, 0, 0) or
RadialWalk(CactusColor , 40, 90, 70, 0, 0) then

You meant


if not RadialWalk(RockColor , 336, 359, 66, 0, 0) or
not RadialWalk(CactusColor , 40, 80, 66, 0, 0) or
not RadialWalk(CactusColor , 40, 90, 70, 0, 0) then

You broke a golden rule:


repeat
symbolaccuracy := symbolaccuracy - 0.05;
wait(1000);
randoms;
until (FindSymbol(x,y,'tanner'));

Infinite loop! You should add a fail safe and break out/switch players.



if(FindSymbol(x,y,'tanner'))then
Mouse(x, y, 2, 2,true);
FFlag(5);
symbolaccuracy := 0.8

First of all, you need a begin/end after the if FindSymbol. But what if it didn't find it? The script will continue which would be bad. Fail safe could be used there too.

You need to watch your randomness on waits in TalkAndBuy and other procedures.


if not RadialWalk(RockColor , 170, 204, 72, 0, 0) then
begin
if findsymbol(x,y,'cookery') then
Mouse(x, y + 10, 2, 2, true);
FFlag(5);
end else
Writeln('Walking has failed');

Debugging walking has failed does nothing for the script. You need to switch players or add another fail safe or something there.


In main loop:


repeat
Startbank;
ToTanner;
Talkandbuy;
Tobank;
Banko;
Proggz;
if (Players[CurrentPlayer].Integers[1]) = Loadnum then
begin
Logout;
NextPlayer(True);
LoadNum:=0;
MakeCompass('N');
end;
until(false);

you could REALLY use a if(not(LoggedIn))then NextPlayer(False); in there.


Overall it was a good try, but based on the lack of fail safes, not compiling/testing the script before applying I'm going to have to give it a no.

Good job though and good luck!

~JAD

Richard

2008-03-27 13:58:05

Great script, nice and original, I think it has pretty much everything required.

Yes!

Torrent of Flame

2008-03-27 14:05:01

Wow, JAD that was a long explanation ^.^

I agree with JAD, there are a few things that could be done better, like adding failsafes and neatening up.

Still, It has RadialWalk, etc and the things to get into SRL, and I think Ill vote yes.

JAD

2008-03-27 15:00:43

From: Torrent of Flame
Wow, JAD that was a long explanation ^.^

I agree with JAD, there are a few things that could be done better, like adding failsafes and neatening up.

Still, It has RadialWalk, etc and the things to get into SRL, and I think Ill vote yes.


The reason I didn't give it a yes, no offense, is because he skipped the hardest part. The easiest part of writing a script (IMO) is typing out the whole thing. The part that's hard is testing it is fixing errors. So I think he would have had to spend double the time and effort fixing errors, and he took the easy way out by not doing so.

It's good looking code, it's just not good working code.


Nvm what I said above about the xor thing too :p it compiles.

Torrent of Flame

2008-03-27 15:02:28

Hey, I was complimenting, not saying anything like that.

JAD

2008-03-27 15:16:28

From: Torrent of Flame
Hey, I was complimenting, not saying anything like that.


I didn't even mean to quote you :p I was just stating my second opinion so that future people voting would take that under consideration.

My bad :)

Camaro'

2008-03-28 19:57:21

I barely voted yes.

You are missing some ends;
You have an infinitive loop which JAD pointed out.
Add some more failsafes besides If Not logged in then exit;

Some things can easily be added

if not RadialWalk(RockColor , 170, 204, 72, 0, 0) then
begin
if findsymbol(x,y,'cookery') then
Mouse(x, y + 10, 2, 2, true);
FFlag(5);
end else
Writeln('Walking has failed');

WTF lol.. NextPlayer(false);

nielsie95

2008-03-31 02:12:29

From: cnr sport
WTF lol.. NextPlayer(false);


You should only use NextPlayer in the mainloop.

Negaal

2008-03-31 08:09:52

From: JAD


I think xor should be or, or maybe you meant xor cause I don't know what xor does because I never used it :p



Actually im sure he didn't want to put xor there

true xor true = false
true xor false = true
false xor true = true
false xor false = false

if NoGameTab xor InBlack then
So if both would be true then it would return false. or even if 1 would return true then is returns true. character can be in random in both ways.

Still xor sounds cool:p

Camaro'

2008-03-31 18:53:27

From: nielsie95
You should only use NextPlayer in the mainloop.


Well..thats what i was expecting him to do. :f:

Cazax

2008-03-31 19:06:47

Uh, maybe you read my tut on getting the srl members rank, and you saw that part of antirandoms when i put "if InBlack xor NoGameTab then" becouse i was the guy with the idea of that :) (yeah, xor looks cooler :))

Yes from me.