Log in

View Full Version : Can Someone PLEASE HELP!



I Can Clutch
05-14-2012, 07:30 AM
I dont understand how to make a script work in the web browser instead of the smart client. Can someone please show me what i have to do to make this script work on the browser? I can't figure out how to do it =(



program YA2;

{$DEFINE SMART}

{$i SRL/srl.simba}
{$i SRL/SRL/misc/reports.simba}
{$i SRL/SRL/misc/paintsmart.simba}


Const

//SRL Stats
SRLStats_Username = '';
SRLStats_Password = '';

NumToKill = 0; //Stop script after we've killed this many Yaks (0 for infinite)
WeaponSpeed = 'Fast'; //Fast,Normal,Slow (fast for scimitars/shortbows/darts/slings)
Training = 'Strength';
HPLevel = 73; //Max constitution (hitpoints) level
MSpeed = 20; //The higher this is, the faster the mouse goes!

YakColor = 4211787; //Yak color
YakTol = 2; //Tolerance (recommended you keep this low)

//Break settings
SwitchWorlds = True; //Switch worlds after a break?
BreakIn = 200; //How long before we take a break? (minutes)
BreakFor = 2; //How long will we break for? (minutes)
Bir = 3; //Random minutes to add/subtract from how long until we break
Bfr = 2; //Random minutes to add/subjtract from break duration

Var
KillCount,Exp,HPExp,
WeaponTimer,KillCount_C,
ReportTime,CommitTime: Integer;

//Break variables
w,x,y,z,RealBTime,CurrentBTime,
BreakRounds,TotalBreaks: Integer;

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Level[SKILL_HITPOINTS] := HPLevel;
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Strength;
Active := True;
end;
end;

Procedure LoadVars;
begin

Retaliate(True);
MarkTime(ReportTime);
MarkTime(CommitTime);

w := (BreakIn * 60000);
x := (BreakFor * 60000);
y := RandomRange(-Bir * 60000, Bir * 60000);
z := RandomRange(-Bfr * 60000, Bfr * 60000);

case Lowercase(WeaponSpeed) of
'fast': WeaponTimer := 1200;
'normal': WeaponTimer := 1800;
'slow': WeaponTimer := 3000;
end;

end;

Procedure OnScreen;
var
XPH,XPH2,KPH: Integer;
begin

XPH := Round((Exp * 3600) / (GetTimeRunning / 1000));
XPH2 := Round((HPExp * 3600) / (GetTimeRunning / 1000));
KPH := Round((KillCount * 3600) / (GetTimeRunning / 1000));

SMART_DrawTextMulti(True, True, ['YA2.1 by Grats & Flight','',
''+MsToTime(GetTimeRunning, Time_Abbrev),'',
''+Capitalize(Training)+' XP: '+IntToStr(Exp)+' ('+IntToStr(XPH)+' / hour)','',
'Hitpoints XP: '+IntToStr(HPExp)+' ('+IntToStr(XPH2)+' / hour)','',
'Kills: '+IntToStr(KillCount)+' ('+IntToStr(KPH)+' / hour)'],
Point(10, 200), SmallCharsNS, 16777215);

end;

Procedure Report;
begin
ClearDebug;
SRLProgressReport(ResultDebugBox, 'YA2', 'Grats/Flight', '1.0',
['Run time:', ''+Capitalize(Training)+' XP:', 'Hitpoints XP:', 'Kills:'],
[MsToTime(GetTimeRunning, Time_Abbrev), Exp, HPExp, Killcount]);

MarkTime(ReportTime);
end;

Procedure Commit;
begin
stats_IncVariable('Yaks (Killed)', KillCount_C);
Stats_Commit;
KillCount_C := 0;
MarkTime(CommitTime);
end;

Procedure SafeLogout;
begin
While srl_InFight do
begin
FindNormalRandoms;
Wait(1);
end;

While LoggedIn do
Logout;

end;

Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
X,Y,X2,Y2,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;

randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(A*MP), eX+(A*MP));
Y2 := RandomRange(eY-(A*MP), eY+(A*MP));
WindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := A;
end;

Procedure HumanRandomMouse;
var
randSpeed: extended;
x, y, firstSpeed: integer;
begin
case(Random(10)) of
2..8:
begin
firstSpeed := mouseSpeed;

mouseSpeed := RandomRange(5,10);
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
GetMousePos(x, y);
WindMouse(x, y, RandomRange(x - 75, x + 75), RandomRange(y - 75, y + 75),
30, 55, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);

mouseSpeed := firstSpeed;
end;
end;
end;

Function IsMoving_F: Boolean;
begin
Result := PixelShift(IntToBox(MMCX-30, MMCY-30, MMCX+30, MMCY+30), 200) > 200;
end;

Function IsAttacking: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 135, 280, 185);
Result := (AveragePixelShift(PBox, 250, 500) > 500);
end;

Function IsFighting: Boolean;
var
CTS: Integer;
PPoints,GPA,RPA: TPointArray;
begin
Result := False;

CTS := GetColorToleranceSpeed;
PPoints := TPAFromBox(IntToBox(225, 125, 295, 145));

ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, GPA, 52354, 200, 90, 330, 215, 10);
FindColorsSpiralTolerance(MSCX, MSCY, RPA, 524459, 200, 90, 330, 215, 10);
ColorToleranceSpeed(CTS);

GPA := ClearTPAFromTPA(GPA, PPoints);
RPA := ClearTPAFromTPA(RPA, PPoints);

if ((Length(GPA) > 0) or (Length(RPA) > 0)) then
Result := True;

end;

Function DidAntiban: Boolean;
var
i: Integer;
begin
Result := False;
if not LoggedIn then Exit;

i := Random(450);
case i of
1..45:
begin
HumanRandomMouse;
Result := True;
end;
46:
begin
HoverSkill('Strength', False);
Result := True;
end;
47:
begin
HoverSkill('Attack', False);
Result := True;
end;
48:
begin
HoverSkill('Hitpoints', False);
Result := True;
end;
49..450: Exit;
end;

end;

Function Eat: Boolean;
var
i: Integer;
begin
Result := False;

if Not LoggedIn then Exit;
if (HPPercent >= 60) then Exit;
if InvEmpty then SafeLogout;

for i := 1 to 28 do
begin
FindNormalRandoms;

if ExistsItem(i) then
begin
InvMouse(i, mouse_move);

if WaitUpText('Eat', 300) then
begin
ClickMouse2(True);
Wait(RandomRange(875, 990));
if (HPPercent >= 90) then
Exit;
end;

if (i = 28) then
Exit;

end;

end;
end;

Function FindFreeYaks: TPointArray;
var
B,HPB: TBox;
TP,MHPB,MNPCB: TPoint;
TPA,GPA,RPA,
GPB,RPB,RTPA,PBox: TPointArray;
i,l,CTS,R: Integer;
ATPA: T2DPointArray;
begin
CTS := GetColorToleranceSpeed;
PBox := TPAFromBox(IntToBox(245, 135, 280, 185));
ColorToleranceSpeed(3);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, YakColor, MSX1, MSY1, MSX2, MSY2, YakTol);

if (Length(TPA) < 1) then
begin
ColorToleranceSpeed(CTS);
Exit;
end;

TPA := ClearTPAFromTPA(TPA, PBox);
ATPA := TPAtoATPAEx(TPA, 30, 30);

l := High(ATPA);
SetArrayLength(ATPA, l+1);
for i := 0 to l do
begin
if (Length(ATPA[i]) > 20) then
B := GetTPABounds(ATPA[i])
else
Continue;

with B do
begin

TP := Point(((B.X1+B.X2)/2), B.Y1);

if (TP.X < MSX1) then
TP.X := MSX1;
if (TP.Y < MSY1) then
TP.Y := MSY1;

HPB:= IntToBox(TP.X-30, TP.Y-40, TP.X+30, TP.Y);

if (HPB.X1 < MSX1) then
HPB.X1 := MSX1;
if (HPB.X2 > MSX2) then
HPB.X2 := MSX2;
if (HPB.Y1 < MSY1) then
HPB.Y1 := MSY1;
if (HPB.Y2 > MSY2) then
HPB.Y1 := MSY2;

MHPB := Point(((HPB.x1+HPB.x2)/2), ((HPB.y1+HPB.y2)/2));
MNPCB := Point(((B.x1+B.x2)/2), ((B.y1+B.y2)/2));

ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MNPCB.X, MNPCB.Y, GPA, 52354, B.X1, B.Y1, B.X2, B.Y2, 10);
FindColorsSpiralTolerance(MNPCB.X, MNPCB.Y, RPA, 524459, B.X1, B.Y1, B.X2, B.Y2, 10);
FindColorsSpiralTolerance(MHPB.X, MHPB.Y, GPB, 52354, HPB.X1, HPB.Y1, HPB.X2, HPB.Y2, 10);
FindColorsSpiralTolerance(MHPB.X, MHPB.Y, RPB, 524459, HPB.X1, HPB.Y1, HPB.X2, HPB.Y2, 10);
ColorToleranceSpeed(CTS);

if ((Length(GPA) = 0) and (Length(RPA) = 0)
and (Length(GPB) = 0) and (Length(RPB) = 0)) then
begin
SetArrayLength(RTPA, (Length(RTPA)+1));
RTPA[R] := MNPCB;
Inc(R);
end;

end;

end;

SortTPAFrom(RTPA, Point(MSCX, MSCY));
Result := RTPA;

end;

procedure Attack_A_Yak;
var
T: Integer;
GoOn: Boolean;
Closest: TPoint;
TPA: TPointArray;
label
Search;
begin
if not LoggedIn then Exit;
Eat;

Search:
GoOn := False;
MouseSpeed := RandomRange(14, 22);
TPA := FindFreeYaks;

if (Length(TPA) > 0) then
begin
Closest := TPA[0];
Smart_DrawBoxEx(False, IntToBox(Closest.X-15, Closest.Y-15, Closest.X+15, Closest.Y+15), 63232);
HumanMMouse(Closest.X, Closest.Y, 5, 5);
if WaitUpText('ck Y', 400) then
begin
ClickMouse2(True);
if not DidRedClick then
goto Search;

OnScreen;
end else
goto Search;

FFlag(0);
While IsMoving_F do
Wait(1);

MarkTime(T);
repeat
if not LoggedIn then Exit;
FindNormalRandoms;

if (TimeFromMark(T) > 2000) then
Exit;

if (IsAttacking and IsFighting) then
break;

if FindBlackChatMessage('omeone else is fighting') then
break;

until(false)

Wait(RandomRange(250, 474));
if FindBlackChatMessage('omeone else is fighting') then
goto Search;

GoOn := True;

MarkTime(T)
repeat
if not LoggedIn then Exit;
FindNormalRandoms;
Eat;

if (TimeFromMark(T) > WeaponTimer) then
break;

if IsAttacking then
MarkTime(T);

if not IsFighting then
break;

until(false)

if GoOn then
begin
GoOn := False;
Inc(KillCount);
Inc(KillCount_C);
IncEx(Exp, 200);
IncEx(HPExp, 67);
end;

end;
end;

Function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
Var
h,m,s: integer;
begin
if not LoggedIn then Exit;

if (HowManyPlayers = 1) then
begin
if (GetTimeRunning < ((w) + (y) + BreakRounds)) then Exit
else
if (GetTimeRunning > ((w) + (y) + BreakRounds)) then
begin
RealBTime := ((x+z)/60000);
Writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.');
SafeLogout;
MarkTime(CurrentBTime);
repeat
Wait(21000);
ConvertTime((x+z)-TimeFromMark(CurrentBTime), h, m, s);
ClearDebug;
Writeln('Breaktime left: '+IntToStr(h)+':'+IntToStr(m)+':'+IntToStr(s));
until(TimeFromMark(CurrentBTime)>(x+z));
Writeln('Logging in.');
if SwitchWorlds then
if LoginPlayerToLob then
ChangeWorld(RandomWorld(True, False))
else
LoginPlayer;
Wait(4000);
Result := LoggedIn;
ClickNorth(SRL_ANGLE_HIGH);
IncEx(BreakRounds, (w) + (x));
Inc(TotalBreaks);
Writeln('The next break will occur in about ' + IntToStr(BreakIn) + ' minutes.');
w := (BreakIn * 60000);
x := (BreakFor * 60000);
y := RandomRange(-Bir * 60000, Bir * 60000);
z := RandomRange(-Bfr * 60000, Bfr * 60000);
end;
end;
end;

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

setupSRL();
DeclarePlayers;

LoadVars;
SetupSRLStats(543, SRLStats_Username, SRLStats_Password);

Smart_ClearCanvas;
Wait(RandomRange(500, 675));
OnScreen;

Repeat

if not LoggedIn then
begin
LoginPlayer;
ClickNorth(SRL_ANGLE_HIGH);
end;

BreakHandler(BreakIn,BreakFor,Bir,Bfr);

if (TimeFromMark(ReportTime)>=5000) then
Report;

if (TimeFromMark(CommitTime)>=30000) then
Commit;

if not (NumToKill = 0) then
begin
if (KillCount = NumToKill) then
begin
SafeLogout;
Report;
NextPlayer(False);
end;
end;

FindNormalRandoms;
Attack_A_Yak;

Until(AllPlayersInactive)

end.
hehe i did it :p now can someone try to help me?

Benny
05-14-2012, 07:32 AM
firstly put the script in like this brackets to make it cleaner and secondly why not use the smart manager?

Sirenia
05-14-2012, 07:32 AM
Please use Simba tags t_t

Justin
05-14-2012, 07:32 AM
You left your account details.

I attempted to change the password to then PM you the new password.

You might want to remove it and change all passwords that is the same as the one you have posted.

Sirenia
05-14-2012, 07:34 AM
Remove the Define smart line, start up runescape, drag the client crosshair to the browser client, hit start :)

I Can Clutch
05-14-2012, 07:39 AM
[J]ustin <3 tysm lol and srry guys im new with all this stuff and im feelin really sloppy today :/

YoHoJo
05-14-2012, 07:43 AM
Please don't make multiple threads about same topic.
Also when posting code put it in simba tags so its organized/scrollable.

I Can Clutch
05-14-2012, 07:52 AM
how do i put something in simba tags?

YoHoJo
05-14-2012, 07:55 AM
http://villavu.com/forum/images/icons/simba.png
When posing (sometimes you need to click the 'Go Advanced' button under the post) you press that image ^ and then between the ][ post the code.

Example:
Program New;
{$DEFINE SMART}
{$i SRL\SRL.Simba}
{$i ObjectDTM\ObjDTMInclude.simba}


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Member := False;
Players[0].Active := True;
end;

var

Path: TStringArray;
I: Integer;

procedure Setup;
begin

Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;

ClearDebug;
SetupSRL;

I Can Clutch
05-14-2012, 08:04 AM
oooooo thanks :D