SRL Archive - Simba (Testing) Scripts

First Script{Help Me Out}


ScriptKid

2012-01-26 14:55:40

Okay, so I have watch YoHo's tuts and read Griffs' tutorial on forums…I tried to create an Ivy script for my first one(My real goal is an enchanting script).
The first script I made it would click on regular trees and if it right clicked it wouldn't choose chop. And even after I did repeat, until(false); it would just cut one tree and stop. Now this script(Ivy) won't even click the Ivy. It minimizes Simba, and then moves the mouse to the bottom right corner of my screen and stops.

program ChopIvy;
{$i srl/srl.simba}

Procedure DeclarePlayers;
begin

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

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

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;

procedure ChopIvy;
var x, y: integer;
begin
if FindObj(x, y, 'hop', 3959634, 35) then
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1100+random(250));
Until not IsUpText('vy') or (InvFull);
end;



begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
ChopIvy;
end.

Can anyone help me out? I'd really like to learn how and start scripting. Thanks in advance.

Inception

2012-01-26 15:01:26

From: ScriptKid
Okay, so I have watch YoHo's tuts and read Griffs' tutorial on forums…I tried to create an Ivy script for my first one(My real goal is an enchanting script).
The first script I made it would click on regular trees and if it right clicked it wouldn't choose chop. And even after I did repeat, until(false); it would just cut one tree and stop. Now this script(Ivy) won't even click the Ivy. It minimizes Simba, and then moves the mouse to the bottom right corner of my screen and stops.

program ChopIvy;
{$i srl/srl.simba}

Procedure DeclarePlayers;
begin

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

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

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;

procedure ChopIvy;
var x, y: integer;
begin
if FindObj(x, y, 'hop', 3959634, 35) then
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1100+random(250));
Until not IsUpText('vy') or (InvFull);
end;



begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
ChopIvy;
end.

Can anyone help me out? I'd really like to learn how and start scripting. Thanks in advance.


If you didn't set a RuneScape client, you need to enable SMART. Also, did you change the color that it is searching for to match the color of the ivy?

ScriptKid

2012-01-26 15:03:46

From: Inception
If you didn't set a RuneScape client, you need to enable SMART. Also, did you change the color that it is searching for to match the color of the ivy?


procedure ChopIvy;
var x, y: integer;
begin
if FindObj(x, y, 'hop', 3959634, 35) then

This? I'm not sure if I did it right.

Inception

2012-01-26 15:20:06

I would suggest checking out this tutorial: http://villavu.com/forum/showthread.php?t=71074

It should give you quite a bit of useful information for your script.

ScriptKid

2012-01-26 20:02:55

From: Inception
I would suggest checking out this tutorial: http://villavu.com/forum/showthread.php?t=71074

It should give you quite a bit of useful information for your script.


Sorry, thanks. I took a nap earlier and I never replied. I'll take a look at the link, and see if I can't get things fixed.

/E: I used ACA, and this is the result I get.

program ScriptKidIvy;
{.include SRL\SRL.simba}

var
fx, fy: Integer;

Const
Server = 0; // Enter "0" to pick a random server.
Members = True; // Set to true if using an RS-Members account. False if f2p.
BreakEvery = 119; //How Many Minutes To Break After
BreakFor = 11; //How Long To Break For
Version = '1.0';
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start autoing with! (0 means first char)


procedure DeclarePlayers; //This declares the players to be used in the script.
var i:integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Your Runescape username
Pass := ''; //Your Runescape password
Nick := ''; //3 or 4 lowercase letters from your Runescape username. Used as a Nickname.
Active := True; //Set to true if you want to use this player. Set to False to disable this player.
Pin := ''; //Leave blank if the player doesn't have a Bank PIN.
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(5500 + 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(4500 + Random(500)); GameTab(28); End;
5: Begin StatsGuise('AntiBan') GameTab(tab_stats) HoverSkill('random', False); GameTab(28); End;
End;
End;

function FindObject(var fx, fy: Integer): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 0.15);

if not(FindColorsTolerance(arP, 2967888, MSX1, MSY1, MSX2, MSY2, 5)) then
begin
//Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Chop Ivy')) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
//Writeln('FindObject could not find object.');
Exit;
end;
end;

Procedure ChopIvy;
Begin;
FindObject(fx, fy);
GetMousePos(fx, fy);
Mouse(fx, fy, 5, 5, True);
wait(30000);
end;


begin
SetupSRL;
DeclarePlayers;
Antiban;
FindObject(fx, fy);
Repeat
ChopIvy;
Until(false);
end.

After I start it up, clicks first ivy fine. But the script stops and says this..

SRL Compiled in 0 msec
Exception: Range check error at line 68
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]


//E: So I got rid of the range check error but now my script doesn't do anything and bitmaps aren't freed?


I feel like I am so close too >.>

Iambubbleman

2012-02-05 15:18:00

You might want to look into this

I just made my own Ivy script using FindObjCustom


FindObjCustom(x,y,['hop','Ivy'],[2771770,4025428],6);
Mouse(x, y, 0, 0, true);

I know its a bit more complex figuring out when the Ivy's gone and all, but this seems to be a good base, in fact I just made my own Ivy script with FindObjCustom

tehq

2012-02-05 16:15:40

I think there may be some major copying in this script.
From: ScriptKid

Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;

-copied from PMS. (why would you have ore colors in an ivy script o.O)

Also, compare the quality of this section of the script
From: ScriptKid


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(5500 + 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(4500 + Random(500)); GameTab(28); End;
5: Begin StatsGuise('AntiBan') GameTab(tab_stats) HoverSkill('random', False); GameTab(28); End;
End;
End;

function FindObject(var fx, fy: Integer): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 0.15);

if not(FindColorsTolerance(arP, 2967888, MSX1, MSY1, MSX2, MSY2, 5)) then
begin
//Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Chop Ivy')) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
//Writeln('FindObject could not find object.');
Exit;
end;
end;


with this section (perhaps written by yourself)
From: ScriptKid


Procedure ChopIvy;
Begin;
FindObject(fx, fy);
GetMousePos(fx, fy);
Mouse(fx, fy, 5, 5, True);
wait(30000);
end;


I would strongly suggest you write the script on your own; Don't leech off other scripts!

Supertrent1

2012-02-16 23:55:12

He watched YoHoJo's tutorials. YoHoJo suggested they take parts of his scripts as practice. Not saying he should release it, but he could help learn from then. Anyways I will edit again in a min with a few fixes.