Simba Code:
program new;
{$DEFINE SMART}
{$I SRL/SRL.simba}
{$I ObjectDTM\ObjDTMInclude.simba}
var
x,y : Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
SetLength(Players, HowManyPlayers);
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Member := True;
Players[0].Active := True;
end;
function GetAlterBlueColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.25, 2.88);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 15972996, MSX1, MSY1, MSX2, MSY2, 5);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 39.82) and (X <= 48.75) and (Y >= 43.38) and (Y <= 53.07) and (Z >= 81.84) and (Z <= 100.59) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function GetAlterObj(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(2.09, 0.05);
if not(FindColorsTolerance(arP, 5722966, MSX1, MSY1, MSX2, MSY2, 2)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 7.93) and (X <= 9.31) and (Y >= 8.15) and (Y <= 9.54) and (Z >= 9.52) and (Z <= 11.04) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 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 ( Pos('Altar' , GetUpText) > 0) 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;
GetMousePos(fx, fy);
end;
function GetPortalObj(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.85);
if not(FindColorsTolerance(arP, 4359044, MSX1, MSY1, MSX2, MSY2, 12)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 10.08) and (X <= 28.55) and (Y >= 11.77) and (Y <= 32.63) and (Z >= 3.73) and (Z <= 16.36) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 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(300));
if ( Pos('Enter Portal' , GetUpText) > 0) 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;
GetMousePos(fx, fy);
end;
function FindAlter(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.33, 5.04);
if not(FindColorsTolerance(arP, 15515277, 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;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 110) and (R <= 162) and (G >= 179) and (G <= 211) and (B >= 214) and (B <= 254) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 39.82) and (X <= 52.12) and (Y >= 43.38) and (Y <= 59.04) and (Z >= 70.54) and (Z <= 101.57) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 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 (Pos('Enter' , GetUpText) > 0) 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;
GetMousePos(fx, fy);
end;
function IsInBank : Boolean;
begin
//result := ObjDTM_InArea('80:80:9:1:7:49:96:10:7:69:91:10:7:69:78:10:7:69:70:10:7:69:62:10:7:69:53:10:7:69:45:10:7:116:49:10:7:116:74:4:63:98:62:33:132:33:132:98',True);
result := ObjDTM_InArea('80:80:5:1:7:22:50:10:7:61:92:10:7:62:45:10:7:109:41:10:7:109:76:4:54:99:53:36:124:32:125:97',True);
end;
function IsAtAlter: Boolean;
begin
result := ObjDTM_InArea('80:80:5:1:7:107:71:1:7:103:116:1:7:86:133:1:7:61:107:1:7:57:53:4:108:101:67:102:66:58:107:59',True);
end;
function IsAtInnerAlter : Boolean;
begin
if( ObjDTM_InArea('80:80:10:1:7:29:71:1:7:37:87:1:7:37:104:1:7:54:120:1:7:70:112:1:7:86:108:1:7:103:108:1:7:25:55:1:7:120:108:1:7:136:103:4:118:88:42:86:55:13:121:9',True)
or ObjDTM_InArea('80:80:5:1:7:88:123:1:7:31:69:1:7:45:26:1:7:41:117:1:7:119:124:4:47:106:42:20:125:24:143:112',True) or ObjDTM_InArea('80:80:3:1:7:90:123:1:7:42:103:1:7:33:39:4:55:103:51:22:133:29:143:107',True) ) then
begin
result := True;
Exit;
end;
//result := ObjDTM_InArea('80:80:10:1:7:29:71:1:7:37:87:1:7:37:104:1:7:54:120:1:7:70:112:1:7:86:108:1:7:103:108:1:7:25:55:1:7:120:108:1:7:136:103:4:118:88:42:86:55:13:121:9',True);
//result := ObjDTM_InArea('80:80:5:1:7:88:123:1:7:31:69:1:7:45:26:1:7:41:117:1:7:119:124:4:47:106:42:20:125:24:143:112',True);
end;
function WalkToCenter : Boolean;
begin
result := ObjDTM_Walk('89:71:8:1:7:29:56:1:7:29:72:1:7:33:88:1:7:42:104:1:7:42:121:1:7:75:128:1:7:91:124:1:7:107:123:7:64:84:61:39:106:35:114:47:118:80:107:91:76:91',3,80,200,True);
end;
function WalkToPortal : Boolean;
begin
result := ObjDTM_Walk('80:80:4:1:7:86:121:1:7:24:66:1:7:36:100:1:7:53:134:4:57:52:113:80:69:114:53:73',0,80,15,True);
end;
function IsAtClickingPortal : Boolean;
begin
result := ObjDTM_InArea('80:80:4:1:7:86:121:1:7:24:66:1:7:36:100:1:7:53:134:4:57:52:113:80:69:114:53:73',True);
//result := ObjDTM_InArea('68:96:15:1:7:28:94:1:7:36:109:1:7:35:125:1:7:82:129:1:7:97:129:1:7:112:129:1:7:24:79:1:7:24:63:1:7:28:48:1:7:36:36:1:7:128:125:1:7:139:102:1:7:139:87:1:7:128:79:1:7:128:64:4:60:98:60:86:84:86:81:99',True);
end;
function WalkToAlter : Boolean;
var
Path : TStringArray;
I : Integer;
begin //'89:102:6:10:7:69:43:10:7:69:59:10:7:70:87:10:7:113:38:10:7:113:62:10:7:113:70'
Path := ['78:83:14:1:7:45:95:10:7:66:91:10:7:65:71:10:7:65:79:10:7:65:63:10:7:65:54:10:7:65:46:10:7:109:41:10:7:109:58:10:7:109:49:10:7:110:66:10:7:110:74:10:7:110:82:0:7:79:39'
,'32:121:3:1:7:49:95:10:7:69:91:1:7:33:50',
'48:121:5:1:7:98:55:1:7:66:94:1:7:78:115:1:7:57:130:1:7:41:111',
'13:72:8:1:7:90:86:1:7:74:91:1:7:74:107:1:7:90:111:1:7:106:108:1:7:102:120:1:7:62:79:1:7:74:67',
'37:107:7:1:7:82:71:1:7:62:75:1:7:46:71:1:7:42:91:1:7:58:107:1:7:46:115:1:7:58:127',
'59:108:8:1:7:82:91:1:7:98:90:1:7:110:102:1:7:110:118:1:7:35:75:1:7:40:126:1:7:79:133:1:7:94:67'];
for I := 0 to High(Path) do
begin
Writeln('Current Path =>' + Path[I]);
ObjDTM_Walk(Path[I],0,80,200,True);
RunEnergy(60);
if(I = High(Path)) then
begin //Expand radius of is in area alter, and fixing better walkto bank
result := IsAtAlter;
end;
end;
end;
function WalkToBank : Boolean;
var
Path : TStringArray;
I : Integer;
begin
Path := ['123:61:7:1:7:98:71:1:7:95:115:1:7:54:107:1:7:79:132:1:7:115:70:1:7:49:54:1:7:37:104',
'125:60:9:1:7:86:83:1:7:74:91:1:7:59:92:1:7:70:67:1:7:87:103:1:7:95:106:1:7:73:46:1:7:90:50:1:7:110:46',
'128:71:5:1:7:70:71:1:7:49:75:1:7:33:72:1:7:46:108:1:7:49:55',
'130:61:6:1:7:110:73:1:7:86:91:1:7:74:103:1:7:87:115:1:7:103:110:1:7:123:94',
'122:67:3:1:7:62:98:1:7:75:119:1:7:95:59',
'87:62:6:1:7:54:75:1:7:22:115:10:7:74:70:10:7:74:58:10:7:74:50:10:7:74:42',
'54:80:7:10:7:41:44:10:7:42:59:10:7:85:39:10:7:85:63:10:7:42:87:10:7:42:75:10:7:85:70']
for I := 0 to High(Path) do
begin
Writeln('Current Path =>' + Path[I]);
RunEnergy(60);
ObjDTM_Walk(Path[I],2,80,200,True);
if(I = High(Path)) then
begin
repeat
until not IsMoving;
//ObjDTM_Walk('78:83:14:1:7:45:95:10:7:66:91:10:7:65:71:10:7:65:79:10:7:65:63:10:7:65:54:10:7:65:46:10:7:109:41:10:7:109:58:10:7:109:49:10:7:110:66:10:7:110:74:10:7:110:82:0:7:79:39',0,80,100,True); //Expand radius of is in area alter, and fixing better walkto bank
result := IsInBank;
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 PROPER 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 := 5;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
SRL_Procs[srl_OnRSUpdate] := @CrashSMART;
ObjDTM_Setup;
ObjDTM_Debug := True;
DeclarePlayers;
if not LoggedIn then
begin
LogInPlayer;
end;
repeat
if(IsInBank)then
begin
if( (InvCount = 0) or (InvCount < 28) ) then
begin
if not (BankScreen) then
begin
OpenBankFast('veb');
end
else
begin
DepositAll;
Withdraw(0,0,0);
Sleep(800);
end;
end
else
begin
if( InvCount = 28 ) then
begin
WalkToAlter;
Sleep(1000);
end;
end
end;
Writeln('GET');
writeln(IsAtInnerAlter);
if(IsAtAlter) then
begin
if(InvCount = 28) then
begin
writeln('GOGO');
if(FindAlter(X,Y)) then
begin
Mouse(X,Y,0,0,mouse_Left);
Sleep(1000);
end;
end
else
begin
WalkToBank;
end
end;
if(IsAtInnerAlter) then
begin
if(InvCount = 28) then
begin
Writeln('Herp');
if(GetAlterObj(X,Y)) then
begin
Writeln('HERRRRP');
Mouse(X,Y,0,0,mouse_Left);
end
else
begin
WalkToCenter;
end;
end;
if(InvCount < 28) then
begin
if(IsAtClickingPortal) then // WalkToPortal
begin
if(GetPortalObj(X,Y)) then
begin
Mouse(X,Y,0,0,mouse_Left);
Sleep(1000);
end
else
WalkToPortal;
end
else
begin
if not (WalkToPortal) then
begin
writeln('Attempting Manual Click');
if(GetPortalObj(X,Y)) then
begin
Mouse(X,Y,0,0,mouse_Left);
end;
end;
end;
end;
end;
until False;
end.