SRL Archive - Help

Runescape Script Question


rytoke

2013-01-12 05:51:36

Would the following script run in a Private Server? I can also play the Private Server in a client if that makes a difference, thanks!

Program PowerChopper;

{$DEFINE SMART}
{$i SRL\SRL.simba}

Const
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
BreakEvery = 120; //How Many Minutes To Break After
BreakFor = 5; //How Long To Break For
Version = '1.0b';
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start autoing with! (0 means first char)



Var
TooLong:Integer;

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer :=StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players.BoxRewards := ['mote', 'otsume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;




end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Procedure Antiban;
Begin
Case Random(250) Of
0: Begin StatsGuise ('AntiBan') GameTab(tab_Stats) HoverSkill('Woodcutting', False) GameTab(28) End;
1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse (7000 + Random(500)); End;
2: Begin StatsGuise ('AntiBan') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise ('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise ('AntiBan') GameTab(Tab_Stats) Wait (3000 + Random(500)); GameTab(28); End;
5: Begin StatsGuise ('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28); End;
End;
End;

Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason
Logout;
Stats_Commit;
Writeln(Reason);
TerminateScript;
End;

Function ChopDown:Boolean;
Var
seX, seY, PlusOne, TreeCounter: Integer;
Begin
MarkTime(TooLong);
FindNormalRandoms;
PlusOne:= InvCount +1;
//If FindObjCustom(seX, seY, ['Chop', 'down', 'p d'], [1128488, 1984576, 2510920, 2701360], 10) Then
Sex:=MSCX;
Sey:=MSCY;
If FindObjTPA(SeX, SeY, 2905438, 10, 1, 15, 60, 600, ['Cho']) Then
Begin
StatsGuise('Hooray, we found a tree!');
GetMousePos(Sex, Sey);
Case Random(2) Of
0: Mouse(SeX, SeY, 5, 5, True);
1: Begin
Mouse(SeX, SeY, 5, 5, False);
WaitOption('Chop', 500);
End;
End;

Flag;
MarkTime(TreeCounter);
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Could Not Find Tree');
Repeat
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Could Not Find Tree');
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
Antiban;
Wait(1000);
If InvCount=Plusone Then
Writeln('We Got One!');
Until (InvCount=Plusone) or (TimeFromMark(TreeCounter) > 5000)
End;
End;

Procedure DropLogs;
var
SeX, SeY, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin
MarkTime(TooLong);
LogDTM := DTMFromString('mbQAAAHicY2VgYFjNwsAwB4h3AvFWIF4IxBOZGBimA/FMIO4A4m4gtjHhB6pmRMH/GTABIxYMBgB4vwfV');
LogPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
For I:=0 To 27 Do
Begin
FindNormalRandoms;
StatsGuise('Dropping Log:' + IntToStr(I));
SlotBox:=InvBox(LogPattern);
If FindDTm(LogDTM,SeX,SeY,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(LogPattern,mouse_move);
ChooseOption ('Drop');
End;

End;
MarkTime(TooLong);
End;


begin
SetupSRL;
DeclarePlayers;
Repeat
ChopDown;
If InvFull Then
DropLogs;
Until(false);

end.

okokokok

2013-01-12 05:56:29

I guess it should work, but rsps are very different to rs.
First off:
I don't think your failsafe will work, because the logout in private servers are usually different to the normal rs. Maybe make your own failsafe by making a DTM of the logout.

Second:
In the server i play, they don't have randoms. So i guess FindNormalRandoms is not needed.

I don't know if smart works for private servers. I guess not, but who knows :)

I just started scripting again myself, so i may have missed some things. But i think it would work (the cutting and dropping part).

rytoke

2013-01-12 06:02:54

I open the game (I play in a client saved to Desktop), and start the script after selecting the window in which it should play in but it doesn't actually start the script, I just stand there and do nothing. Any solution you know of?

Thanks for the information if not, it helped!

okokokok

2013-01-12 06:08:39

Well dragging the crosshair thingy means you are running the script without smart. So remove {$DEFINE SMART} at the top. Then it should work.

EDIT: Also in your procedure ChopDown there is a mistake. You are using "Case of". That's fine and the first option is good too. But the second option won't work. Because the uptext for private servers is different. You could make the script right click and make a DTM of the chop option. Then make the script look for that DTM and it should chop. This is also the case in the dropping procedure. Make a DTM of the drop option.

rytoke

2013-01-12 06:14:13

Okay, I did that and it seems to be working, but when I play the script it opens a separate Runescape client and doesn't use the script in the pserver. Anymore ideas? ahhaha
thanks in advance

okokokok

2013-01-12 06:15:30

It's still opening smart? after you removed define smart?

rytoke

2013-01-12 06:16:51

Yep, I disabled Smart from the Smart Client and it doesn't seem to be opening, yet the script still won't run in the pserver. >.<


EDIT; I'm also getting this -

[Hint] C:\Simba\Scripts\PowerChopper.simba(69:10): Variable 'Result' never used at line 68

If it makes a difference..

okokokok

2013-01-12 06:19:11

Gimme a sec. I'll clean up the script in simba and i'll post it here. Also for the colors did you use ACA (Auto Color Aid). It's really usefull. YoHoJo made a great tut for it

rytoke

2013-01-12 06:19:51

Okay thanks a lot man, I was looking into using it but decided I'd sort this out first before I go into more complex stuff ahhaa.

okokokok

2013-01-12 06:32:53

Ok i cleaned it up a bit. Try to use ACA to find the perfect tree colors. Also i cleaned up your layout a bit and removed some procedures you are not going to need on a private server.

Program PowerChopper;
{$i SRL\SRL.simba}

Const
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
BreakEvery = 120; //How Many Minutes To Break After
BreakFor = 5; //How Long To Break For
Version = '1.0b';



Var
TooLong:Integer;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Procedure Antiban;
Begin
Case Random(250) Of
0: Begin StatsGuise ('AntiBan') GameTab(tab_Stats) HoverSkill('Woodcutting', False) GameTab(28) End;
1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse (7000 + Random(500)); End;
2: Begin StatsGuise ('AntiBan') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise ('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise ('AntiBan') GameTab(Tab_Stats) Wait (3000 + Random(500)); GameTab(28); End;
5: Begin StatsGuise ('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28); End;
End;
End;

Function ChopDown:Boolean;
Var x, y, PlusOne, TreeCounter: Integer;

Begin
MarkTime(TooLong);
PlusOne:= InvCount +1;
If FindObjCustom(x, y, ['Chop', 'down', 'p d'], [1128488, 1984576, 2510920, 2701360], 10) Then

Begin
StatsGuise('Hooray, we found a tree!');
GetMousePos(x, y);
Case Random(2) Of
0:
begin
Mouse(x,y,5,5,true);
end;

1:
Begin
Mouse(x, y, 5, 5, True);
End;
End;

Flag;
MarkTime(TreeCounter);

If (TimeFromMark(TooLong) > 30000) Then

Repeat
If (TimeFromMark(TooLong) > 30000) Then
StatsGuise('AntiBan and Waiting');
Antiban;
Wait(1000);

If InvCount=Plusone Then
Writeln('We Got One!');

Until (InvCount=Plusone) or (TimeFromMark(TreeCounter) > 5000)
End;
End;

Procedure DropLogs;
var
SeX, SeY, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin
MarkTime(TooLong);
LogDTM := DTMFromString('mbQAAAHicY2VgYFjNwsAwB4h3AvFWIF4IxB OZGBimA/FMIO4A4m4gtjHhB6pmRMH/GTABIxYMBgB4vwfV');
LogPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19, 23,27,4,8,12,16,20,24,28];
For I:=0 To 27 Do
Begin
FindNormalRandoms;
StatsGuise('Dropping Log:' + IntToStr(I));
SlotBox:=InvBox(LogPattern[I]);

If FindDTm(LogDTM,SeX,SeY,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then

Begin
MouseItem(LogPattern[I],mouse_move);
ChooseOption ('Drop');
End;

End;
MarkTime(TooLong);
End;


begin
SetupSRL;
Repeat
ChopDown;
If InvFull Then
DropLogs;
Until(false);

end.

I'll also put my first cutter up here, so maybe you can get some ideas out of that.

program PortSarimWillowCrusherv1;
{.include SRL\SRL\Misc\SMART.scar}
{.include SRL\SRL.scar}

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

Players[0].Name := ''; //Put your charactername between the ' '.
//This will be used to log u into the game.
Players[0].Pass := ''; //The same as with the name, but now your password
Players[0].Nick := ''; //Enter your Nickname here -> Only use 3-4 letters
Players[0].Active:= True; //True if u want this user to be used in the script
//False if u dont want this user to be used in the script
Players[0].BoxRewards := ['oins'];
end;

function FindAxe: string;
var
Ix, Iy, _Tab: Integer;
I, InvAxe, WieldAxe, FoundAxe: Byte;
begin
Result := '';
if not LoggedIn then exit;
srl_LoadBitmaps([47, 48, 49, 50, 51, 52, 53, 54, 110]);
I := 0;
_Tab := GetCurrentTab;
repeat
case GetCurrentTab of
tab_Equip: begin
for WieldAxe := 0 to 8 do
if FindTransparentBitmapTolerance(srl_GetBitmap(54-WieldAxe + Integer(WieldAxe = 8) * 64),Ix, Iy, clBlack, 566, 285, 606, 327, 10) then
Break;
if I = 0 then
if not GameTab(tab_Inv) then exit;
Inc(I);
end;
tab_Inv: begin
for InvAxe := 0 to 8 do
if FindTransparentBitmapTolerance(srl_GetBitmap(54 - InvAxe + Integer(InvAxe = 8) * 64), Ix, Iy, clBlack, MIX1, MIY1, MIX2, MIY2, 10) then
Break;
if I = 0 then
if not GameTab(tab_Equip) then exit;
Inc(I);
end;
else
if not GameTab(tab_Equip) then exit;
end;
until I = 2;

if (InvAxe = 9) and (WieldAxe = 9) then
begin
Writeln('No axe was found.');
srl_FreeBitmaps;
Exit;
end;

GameTab(_Tab)
FoundAxe := Min(WieldAxe, InvAxe);

case FoundAxe of
0: Result := 'dragon';
1: Result := 'rune';
2: Result := 'addy';
3: Result := 'mith';
4: Result := 'black';
5: Result := 'steel';
6: Result := 'iron';
7: Result := 'bronze';
8: Result := 'adze';
end;

WriteLn('Using ' + Capitalize(Result) + ' axe.');
srl_FreeBitmaps;
end;

procedure AntiCrush; //Anti-ban
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(20) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1:PickUpMouse;
2:
begin
MakeCompass('N');
wait(88+random(133));
MakeCompass('E');
wait(20+random(133));
MakeCompass('S');
wait(20+random(133));
MakeCompass('W');
wait(20+random(133));
MakeCompass('N');
wait(20+random(133));
end;
3:RandomRClick;
4:PickUpMouse;
5:RandomMovement;
6:BoredHuman;
7:ExamineInv;
8:GameTab(1 + Random(15));
9:PickUpMouse;
10:RandomRClick;
11:ExamineInv;
12:
begin
HoverSkill('random', false);
sleepandmovemouse(276 + Random(100));
PickUpMouse;
ChooseOption('Cancel');
setangle(true);
end;
end;
end;

procedure AntiRandoms;
begin
FindNormalRandoms;
LampSkill := 'woodcutting';

LevelUp;
end;

procedure CrushWillow;
var x,y: integer;
begin
MakeCompass('S');
repeat
AntiCrush;
FindNormalRandoms;
if FindObjCustom(x,y,['ill','low'],[3161919,3293505,2898745],7) then
begin
MMouse(x,y,0,0);
Wait(50 + (random(50)));
Mouse(x,y,0,0,false);
repeat
Wait(100 + (random(150)));
ChooseOption('hop');
until not IsUpText('own') or (InvFull);
end;
until(InvFull);
end;

procedure DropWillows;
var
LogDTM, l, i: Integer;
p: TPointArray;
begin
for i := 1 to 28 do
begin
MMouseItem(i);
if(WaitUpTextMulti(['logs', 'ogs'], 1000)) then
begin
DropItem(i);
end;
end;
end;

begin
Smart_Server := 17;
Smart_Members := false;
Smart_Signed := true;
Smart_SuperDetail := false;
SetUpSRL;
ActivateClient;
DeclarePlayers;
While not RSReady do
Wait(200+random(500));
LoginPlayer;
FindAxe;
repeat
AntiCrush;
AntiRandoms;
CrushWillow;
DropWillows;
Until (Not (Loggedin))
end.

It's a pretty old script and not updated. So don't copy anything because it may not work.

Also really do use ACA, because you will need that untill forever haha

EDIT: You will still have to change the option picking with DTMs

rytoke

2013-01-12 06:36:00

Yeah, gonna set it all up now.
Got any idea why it isn't clicking on the tree? or is that because of the tolerance levels?

okokokok

2013-01-12 06:39:43

Tolerance is fine, it's probably the colors. With aca you should get the perfect autocolor function and it should have no problems.

I gotta go now, but i'll be back later. If you have some questions just pm me ;)

rytoke

2013-01-12 06:41:26

Alright, thanks a lot man I'll give ACA a shot now.

rytoke

2013-01-12 12:04:41

I've worked through ACA, Still getting an error where the script won't order the bot to click the maple tree.

rj

2013-01-16 16:44:33

Why didn't you just make a complete new s riot your going to have to remove so much stuff because it won't work on a private server I suggest that you read a tutorial

Elip007

2013-01-22 12:18:57

Where did you get most of this script** I have just started scripting for a RSPS and I gotta tell you, you have stuff in there that shouldn't be there.
For example Antibans don't really work on a private server. I suggest you make your own and implement them in. Though I am pretty sure your server doesn't looks at players to see if they are a bot or not. Check out Includes\SRL\SRL folder and there should be an antiban.simba file. Check that out for some Antibans that you want to use.
Also I don't think you need those SRL Stat Constants for a RSPS because I doubt it will be able to work.

I suggest you start from a fresh new page and rewrite all those codes by yourself. That way you get more scripting experience and you will be able to clean it up and remove some stuff that you don't need in there. Also the tutorial section will help you out a lot!