It is a smallish rectangle on the left side of the character, just about underneath them, that goes literally right to the chat window, like pixel to pixel. with chat window. The very edge of the chat window is black, so that may be where the black comes into play, and the actual window is a majority of white, but how the heck does that have anything to do with whether or not your character is attacking a yak.
I loaded the YA script do use the Public SMART window, and ran the script. It no longer logs you in, and when it searches for a yak, it doesn't even wait 100ms if feels like. :frusty:The problem has only gotten worse!:frusty: Someone please help!
P.S. I'm getting sort of desperate to find where this problem may be at, so if you have an idea what you are doing, please take a look at the scripting for it below and tell me what I could try to solve the following:
a)Log in - It puts in your info, but doesn't click the log in button.
b)Wait before it attacks another yak - It was not waiting long enough before the yak was dead before attacking another one, but now it just simply doesn't wait at all!
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 = 'Username';
SRLStats_Password = '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 = 'Attack';
HPLevel = 74; //The Max constitution (hitpoints) level
MSpeed = 18; //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 = 120; //How long before we take a break? (minutes)
BreakFor = 25; //How long will we break for? (minutes)
Bir = 20; //Random minutes to add/subtract from how long until we break
Bfr = 7; //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 := 'Username';
Pass := 'Password';
Level[SKILL_HITPOINTS] := HPLevel;
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_HITPOINTS;
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;
[B] 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;
[/B]
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;
procedure CrashSMART;
begin
Writeln('You are using CRASHSMART, so we are going to reload your client after the RS update!');
SmartgetFieldObject(1488,'crash');// will crash SMART (and Simba).
// IF THIS DOES NOT CRASH YOUR SIMBA, YOU ARE NOT USING THE PORPER PLUGIN
// AN ACCESS VIOLATION HERE IS NOT THE CRASH; MAKE SURE YOU MOVED THE EDITED PLUGIN
Wait(5000);
Writeln('CRASHSMART Failed: Make sure you are using the proper plugin!');
Writeln('Read more about this feature at villavu.com/forum/showthread.php?t=67864');
TerminateScript;
end;
begin
Smart_Server := 135;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
setupSRL();
SRL_Procs[srl_OnRSUpdate] := @CrashSMART;
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.