*RESERVED for Temporary Functions*
FindWaterColor
function FindWatercolor: Integer;
var
GC, a, l, TestColor, Red, Green, Blue: integer;
var
P: array of Tpoint;
begin
GC := 10324605;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
l := GetArrayLength(P);
for a := 0 to l - 1 do
begin
if rs_OnMinimap(P[a].x, P[a].y) then
begin
TestColor := GetColor(P[a].x, P[a].y);
if SimilarColors(TestColor, GC, 50) then
begin
ColorToRGB(TestColor, Red, Green, Blue);
if InRange(Blue - Green, -11, 49) then
if InRange(Green - Red, -17, 43) then
if InRange(Blue - Red, 2, 62) then
if GetColor(P[a].x + 2, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 1) = TestColor then
if GetColor(P[a].x, P[a].y + 2) = TestColor then
if GetColor(P[a].x + 2, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y) = TestColor then
if GetColor(P[a].x + 2, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 1, P[a].y + 2) = TestColor then
begin
Result := TestColor;
WaterColor := TestColor;
WriteLn('WaterColor = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find Water Color!');
Result := 0;
end;
LogOut
function Logout: Boolean;
var
c, i: Integer;
begin
Result := (not (LoggedIn));
if Result = True then
Exit;
Wait(200 + Random(100));
while (LoggedIn) or (c < 10) do
begin
Inc(c);
MouseBox(744, 4, 759, 18, 1);
if(ClickText('here', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
for i := 0 to 10 do
begin
Wait(1000);
if not(LoggedIn)then
begin
Result := True;
Exit;
end;
end;
end;
end;
GetCurrentTab/TabExists (Fix for LogOut)
{*******************************************************************************
function GetCurrentTab: Integer;
By: Wizzup?
Description: Returns current tab
*******************************************************************************}
function GetCurrentTab: Integer;
var
i: Integer;
b: Boolean;
begin
b := False;
Result := 0;
for i := 1 to 15 do
begin
case i of
1: b := (GetColor(543, 178) = 1580634);
2: b := (GetColor(570, 179) = 1778795);
3: b := (GetColor(604, 174) = 1910385);
4: b := (GetColor(632, 172) = 1910385);
5: b := (GetColor(666, 182) = 1647204);
6: b := (GetColor(699, 177) = 1910385);
7: b := (GetColor(735, 177) = 1778795);
8: b := (GetColor(569, 471) = 1910385);
9: b := (GetColor(598, 471) = 1910385);
10: b := (GetColor(633, 478) = 1778795);
11: b := (GetColor(668, 476) = 1778795);
12: b := (GetColor(703, 481) = 1580634);
13: b := (GetColor(740, 471) = 1778795);
14: b := (GetColor(555, 275) = 2070783);
15: b := (GetColor(533, 475) = 1581150);
end;
if b then
begin
Result := i;
Exit;
end;
end;
end;
{*******************************************************************************
function TabExists(TabNumber: Integer): Boolean;
By: Flyboy
Description: Returns true if tab exists.
Very useful for tutorial Is. as well as a simple double check to make sure
your fully logged in.
*******************************************************************************}
function TabExists(TabNumber: Integer): Boolean;
begin
case TabNumber of
1: Result := (GetColor(533, 177) = 65536);
2: Result := (GetColor(565, 175) = 65536);
3: Result := (GetColor(609, 175) = 1052432);
4: Result := (GetColor(638, 174) = 65536);
5: Result := (GetColor(670, 176) = 65536);
6: Result := (GetColor(708, 171) = 65536);
7: Result := (GetColor(740, 175) = 65536);
8: Result := (GetColor(575, 474) = 65536);
9: Result := (GetColor(605, 474) = 65536);
10: Result := (GetColor(640, 472) = 65536);
11: Result := (GetColor(680, 472) = 65536);
12: Result := (GetColor(710, 470) = 65536);
13: Result := (GetColor(735, 473) = 65536);
14: Result := (GetColor(743, 1) = 65536);
15: Result := (GetColor(537, 477) = 65536);
end;
end;
Login Player
Function LoginPlayer: Boolean;
Var
Tries: Integer;
Begin
If ((CurrentPlayer + 1) > HowManyPlayers) Then
Exit;
MouseBox(361, 168, 400, 173, 1);
Wait(1000 + Random(500));
Mouse(315, 258, 20, 2, True);
Wait(100 + Random(50));
TypeSend(Players[CurrentPlayer].Name);
Mouse(315, 325, 20, 2, True);
Wait(100 + Random(50));
TypeSend(Players[CurrentPlayer].Pass);
Wait(1000 + Random(500));
MouseBox(357, 364, 400, 368, 1);
While (Not (GetColor(316, 396) = 153)) Do
Begin
Inc(Tries);
Wait(100);
If (Tries >= 100) Then
Begin
Players[CurrentPlayer].Active := False;
CurrentPlayer := CurrentPlayer + 1;
MouseBox(337, 401, 420, 408, 1);
Wait(2000 + Random(500));
LogInPlayer;
Exit;
End;
End;
MouseBox(206, 331, 563, 367, 1);
Tries := 0;
While (Not (GetColor(627, 85) = 16777215)) Do
Begin
Inc(Tries);
Wait(100);
If (Tries >= 600) Then
Begin
Players[CurrentPlayer].Active := False;
CurrentPlayer := CurrentPlayer + 1;
MouseBox(337, 401, 420, 408, 1);
Wait(2000 + Random(500));
LogInPlayer;
Exit;
End;
End;
Wait(2000 + Random(500));
Result := True;
End;
function MainMenu: boolean;
var
str:string;
begin
str := GetTextAtEx(342, 179, 10, StatChars, False, True, 0, 1, 7750, 20, False, tr_AllChars);
result := pos('istin', str) > 0;
end;
// 1 = at screen, 2 = performing login, 3 = failed login
function LoginMenu: integer;
var
str: string;
begin
str := GetTextAtEx(342, 195, 10, StatChars, False, True, 0, 1, 12509695, 30, False, tr_AllChars);
if pos('serna', str) > 0 then result := 1;
if pos('rform', str) > 0 then result := 2;
if pos('orgot', str) > 0 then result := 3;
end;
function LoginPlayer: boolean;
var
time, x, y: integer;
begin
if MainMenu then MouseBox(360, 168, 400, 174, 1);
if FindColorTolerance(x, y, 8641531, 297, 330, 462, 366, 10) then
MouseBox(297, 330, 462, 366, 1);
if LoginMenu > 0 then
begin
MouseBox(314, 256, 438, 264, 1);
Wait(100+random(100));
TypeSend(Players[CurrentPlayer].Name);
MouseBox(314, 322, 438, 330, 1);
Wait(100+random(100));
TypeSend(Players[CurrentPlayer].Pass);
MouseBox(360, 362, 396, 370, 1);
end;
while LoginMenu = 2 do wait(100);
while not FindColorTolerance(x, y, 8641531, 297, 330, 462, 366, 10) do wait(100);
MouseBox(297, 330, 462, 366, 1);
MarkTime(time);
while not LoggedIn and (TimeFromMark(time) < 10000) do wait(100);
if (TimeFromMark(time) > 10000) then exit;
if LoggedIn then
begin
result := true;
PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
if Length(Players[CurrentPlayer].NickTPA) < 2 then
begin;
Writeln('Creating the NickTPA.');
if Players[CurrentPlayer].Nick <> '' then
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
else
begin;
Writeln('Nickname isnt set, taking the username instead..');
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
end;
end;
WriteFileString(TheFile, Chr(13) + 'Current player: '+ UpperCase(Players[CurrentPlayer].Name) + Chr(13)); //* Save NAME to file
end;
end;
Set Bar
procedure SetBar(Bar: String; Point: Integer);
var
P: TPoint;
x, y, z: integer;
begin
if (not LoggedIn) then Exit;
if (Point < 0) or (Point > 4) then Exit;
z := GetCurrentTab;
GameTab(11);
Wait(500 +Random(50));
Case (LowerCase(Bar)) Of
'brightness':
Begin
MouseBox(572, 237, 600, 265, 1);
Wait(2000 + Random(500));
If (Not (GetColor(202, 36) = 0)) Then Exit;
Mouse(82 + (31 * Point), 296, 1, 1, True);
Wait(500 + Random(400));
MouseBox(481, 31, 490, 39, 1);
Wait(2000 + Random(500));
While (GetColor(202, 36) = 0) Do
Begin
Wait(2000 + Random(500));
MouseBox(481, 31, 490, 39, 1);
End;
End;
'music':
Begin
MouseBox(627, 234, 656, 265, 1);
Wait(2000 + Random(500));
If (Not (GetColor(211, 56) = 0)) Then Exit;
Mouse(204 + (14 * Point), 176, 1, 1, True);
Wait(500 + Random(400));
MouseBox(323, 50, 331, 58, 1);
Wait(2000 + Random(500));
While (GetColor(211, 56) = 0) Do
Begin
Wait(2000 + Random(500));
MouseBox(323, 50, 331, 58, 1);
End;
End;
'effects':
Begin
MouseBox(627, 234, 656, 265, 1);
Wait(2000 + Random(500));
If (Not (GetColor(211, 56) = 0)) Then Exit;
Mouse(204 + (14 * Point), 176, 1, 1, True);
Wait(500 + Random(400));
MouseBox(323, 50, 331, 58, 1);
Wait(2000 + Random(500));
While (GetColor(211, 56) = 0) Do
Begin
Wait(2000 + Random(500));
MouseBox(323, 50, 331, 58, 1);
End;
End;
'area':
Begin
MouseBox(627, 234, 656, 265, 1);
Wait(2000 + Random(500));
If (Not (GetColor(211, 56) = 0)) Then Exit;
Mouse(204 + (14 * Point), 176, 1, 1, True);
Wait(500 + Random(400));
MouseBox(323, 50, 331, 58, 1);
Wait(2000 + Random(500));
While (GetColor(211, 56) = 0) Do
Begin
Wait(2000 + Random(500));
MouseBox(323, 50, 331, 58, 1);
End;
End;
End;
GameTab(z);
end;
Music Relatedprocedure ChangeMusic(Row, Column: integer);
var
p: TPoint;
x, y: integer;
begin
GameTab(11);
Wait(Random(25));
MouseBox(630, 237, 656, 264, 1);
case Row of
1: p.y := 121;
2: p.y := 177;
3: p.y := 236;
end;
case Column of
1: p.x := 202;
2: p.x := 226;
3: p.x := 253;
4: p.x := 279;
5: p.x := 305;
end;
x := p.x;
y := p.y;
Mouse(x, y, 5, 5, true);
Wait(Random(25));
MouseBox(322, 49, 333, 60, 1);
end;
procedure SetMusicType(t: integer);
begin
GameTab(11);
Wait(Random(25));
MouseBox(630, 237, 656, 264, 1);
case t of
1: Mouse(239, 268, 5, 5, true);
2: Mouse(305, 268, 5, 5, true);
end;
Wait(Random(25));
MouseBox(322, 49, 333, 60, 1);
end;