Simba Code:
{$DEFINE SMART}
{$i AeroLib/AeroLib.Simba}
{$i Reflection/Reflection.Simba}
var
reflectPlayer: TReflectLocalPlayer;
invItem: TReflectInvItem;
function R_TileOnMS(Tile : TPoint; var OutputPoint : TPoint; x : integer = 0; y : integer = 0; z : integer = 0):boolean;
var tempB : TBox;
begin
OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
result := PointInBox(OutputPoint, tempB);
end;
procedure randomMouseInput(pnt:Tpoint; ranx, rany:integer);
begin
case random(3) of
0:humanMMouse(pnt, ranx, rany);
1:missMouse(pnt, ranx, rany);
2:mouse(pnt, ranx, rany, mouse_move);
end;
end;
function R_InteractTile(tile:Tpoint; action:string; x:integer = 0; y:integer = 0; z:integer = 0):boolean;
var RSTile : TPoint;
begin
if R_TileOnMS(Tile, RSTile, x, y, z) then begin
randomMouseInput(rsTile, 3, 3);
if(Reflect.Text.IsUpText(action)) then begin
FastClick(mouse_left);
result := didClick(true, 1000);
end else begin
if TReflectionText.OptionExists(action) then begin
FastClick(mouse_right);
result := Reflect.Text.ChooseOption(action);
end;
if not result then
randomMouseInput(Point(MSCX, MSCY), 500, 500);
end;
end;
end;
Procedure getTile;
var
OurTile : TPoint;
begin
OurTile := Reflect.Tiles.GetGlobalTile;
writeln('Point('+ IntToStr(OurTile.x) + ',' + IntToStr(OurTile.y) +')');
end;
function dismissAllRandoms : boolean;
var i, j, me_indice:integer;
_npcs:TReflectNPCArray;
randoms:tstringarray;
begin
randoms := ['dunce', 'molly', 'niles', 'miles', 'giles', 'sandwich lady',
'drunken dwarf', 'highwayman', 'dr jekyll', 'cap''n hand', 'security guard',
'rick turpentine', 'mysterious old man', 'frog', 'null', 'mime', 'sergeant damien', 'freaky forester','strange plant',
'postie pete', 'tilt', 'flippa', 'leo', 'pillory guard', 'evil bob'];
_npcs.GetAll;
me_indice := TReflectLocalPlayer.GetPlayerIndex;
for i:=0 to high(_npcs) do begin
if (_npcs[i].getInteractingIndex = me_indice) then begin
for j:=0 to high(randoms) do begin
if (pos(randoms[j], lowercase(_npcs[i].getName)) > 0) then begin
if R_InteractTile(_npcs[i].getTile, 'Dismiss', 0, 0, 50) then begin
FFlag(0);
sleep(500+random(2000));
writeln('Dismissed random: '+_npcs[i].getname+' Time Running: '+TimeRunning);
result := True;
end;
end;
end;
end;
end;
end;
procedure AntiBanned;
begin
sleep(10+random(5000));
case random(750) of
1:HoverSkill('random', False);
2:hoverSkill('random', false);
//3:pickUpMouse;
4:SleepAndMoveMouse(random(2500));
5:randomMovement;
6:compassMovement(0, 360, false);
7:boredHuman;
8:sleep(500+random(5000));
9:randomFKeys(false);
10:randomTab(false);
11:checkMovingObjs(false);
12:checkMovingObjs(false);
13:MMouseOffClient('rand');
14:MMouseOffClient('top');
15:MMouseOffClient('bottom');
16:MMouseOffClient('left');
17:MMouseOffClient('right');
18:HoverSkill('random', False);
end;
end;
Procedure teleArena;
begin
if getCurrentTab():=4 then
begin
typeByte(VK_F4);
end
begin
TReflectionMouse.Move(700, 370, 710, 390, mouse_right);
Reflect.Text.ChooseOption('Duel Arena');
writeln('teleported to Castle Wars');
wait(randomrange(1800,3000));
if getCurrentTab():=5 then
typeByte(VK_ESCAPE);
end;
end;
Procedure teleCW;
begin
if getCurrentTab():=4 then
begin
typeByte(VK_F4);
end
begin
TReflectionMouse.Move(700, 370, 710, 390, mouse_right);
Reflect.Text.ChooseOption('Castle Wars');
writeln('teleported to Castle Wars');
wait(randomrange(1800,3000));
if getCurrentTab():=5 then
typeByte(VK_ESCAPE);
end;
end;
Function waitMove(c: Integer): boolean;
var
d : integer;
Begin
random(4000);
dismissAllRandoms;
FFlag(0);
(d = (c/5));
wait(c+random(d));
while reflectplayer.IsAnimating or reflectPlayer.IsMoving do
wait(c-random(d));
end;
Function R_Click(textstr : string): boolean;
begin
FastClick(Mouse_Right);
if ChooseOption(textstr) then begin
FFlag(0);
result := true;
end else
result := false;
end;
Function OpenBank :boolean;
var
Bank: TReflectObject;
begin
waitMove(300);
if TReflectionBank.IsOpen then begin
exit;
end;
FFlag(0);
if Bank.Find(objGame, 'Bank chest', 5) then begin
Reflect.Mouse.Move(Bank.GetMSPoint, 5, 5);
wait(100+random(500));
R_Click('Use Bank chest');
FFlag(0);
end
if TReflectionBank.IsOpen then
begin
result := true
end else
result := true;
end;
Function cRuins(C: Integer): boolean;
begin
if Reflect.Tiles.DistanceFromTile(Point(3309,3251)) < C then
begin
if reflectplayer.IsAnimating or reflectPlayer.IsMoving then
begin
exit;
end;
if R_InteractTile(Point(3312+RandomRange(0,2),3254+RandomRange(0,2)), 'Mysterious ruins', 1, 1, C) then
begin
waitMove(1200);
result := true;
end;
end;
antibanned();
wait(randomRange(600,3000));
end;
Function cAltar(C: Integer): boolean;
begin
if Reflect.Tiles.DistanceFromTile(Point(2585,4838)) < C then
begin
if reflectplayer.IsAnimating or reflectPlayer.IsMoving then
begin
exit;
end;
if R_InteractTile(Point(2585+RandomRange(0,2),4838+RandomRange(0,2)), 'Craft-rune Altar', 1, 1, C) then
begin
waitMove(1200);
result := true;
end;
end;
antibanned();
repeat
wait(randomRange(60,800));
until not TReflectionInventory.IsFull();
if not TReflectionInventory.isFull() then
teleCW;
end;
Procedure WalkBank;
begin
if(getRunEnergy >= (40 +random(40))) and not isUsingRun then begin
toggleRunning(true); end;
if Reflect.Tiles.DistanceFromTile(Point(2444,3083)) > 15 then
begin
writeln('Error 221');
exit;
end;
if Reflect.Tiles.DistanceFromTile(Point(2444,3083)) > 5 then
begin
repeat
reflectPlayer.BlindWalkMM (Point(2444+RandomRange(0, 2),3083+RandomRange(0, 2)),2);
wait(randomRange(800,2000));
until Reflect.Tiles.DistanceFromTile(Point(2444,3083)) < 5;
end;
antibanned();
end;
Procedure WalkAltar;
begin
if(getRunEnergy >= (40 +random(40))) and not isUsingRun then begin
toggleRunning(true); end;
if Reflect.Tiles.DistanceFromTile(Point(2584,4840)) > 20 then
begin
writeln('Error 239');
exit;
end;
if Reflect.Tiles.DistanceFromTile(Point(2584,4840)) > 5 then
begin
reflectPlayer.BlindWalkMM (Point(2584+RandomRange(0, 2),4840+RandomRange(0, 2)),2);
end;
antibanned();
end;
Procedure WalkRuins;
begin
if(getRunEnergy >= (40 +random(40))) and not isUsingRun then begin
toggleRunning(true); end;
if Reflect.Tiles.DistanceFromTile(Point(3311,3253)) > 20 then
begin
writeln('Error 255');
exit;
end;
if Reflect.Tiles.DistanceFromTile(Point(3311,3253)) > 5 then
begin
reflectPlayer.BlindWalkMM (Point(3311+RandomRange(0, 1),3253+RandomRange(0, 1)),2);
end;
antibanned();
end;
procedure WithdrawItems(item: String; amount: Integer; Result: Boolean);
var
iitem: TReflectBankItem;
begin
if iitem.Find(item) then begin
waitMove(250);
iitem.Withdraw(amount);
wait(random(600,1300));
result := true;
end else if not invItem.Find(item) then begin
logoutPlayer;
terminatescript;
result := false;
end;
end
function withDraw: Boolean;
begin
if TReflectionBank.IsOpen then begin
begin
if invItem.Find('Fire rune') then
depositItem(3,-1,100);
if not invitem.Find('Pure essence') then
WithdrawItems('Pure essence', 28, true);
end;
Result := InvItem.Find('Pure essence');
Reflect.Bank.Close;
teleArena;
end;
end;
Procedure mainLoop;
begin
if TReflectionBank.isOpen then
begin
writeln('Withdrawing Items');
withdraw;
end
else if Reflect.Tiles.DistanceFromTile(Point(2444,3083)) < 5 then
begin
writeln('Opening Bank');
openBank;
end
else if Reflect.Tiles.DistanceFromTile(Point(3311,3253)) < 5 then
begin
writeln('Clicking Ruins');
cRuins(15);
end
else if Reflect.Tiles.DistanceFromTile(Point(2584,4840)) < 5 then
begin
writeln('Crafting runes');
cAltar(15);
end
else if not invItem.Find('Pure essence') then
begin
writeln('Walking to Bank');
walkBank;
end
if Reflect.Tiles.DistanceFromTile(Point(3312,3252)) < 20 and TReflectionInventory.IsFull() then
begin
writeln('Walking to Ruins');
walkRuins;
end
else if Reflect.Tiles.DistanceFromTile(Point(2584,4840)) < 30 and TReflectionInventory.IsFull() then
writeln('Walking to Altar');
walkAltar;
end;
begin
initAL;
Reflect.Setup;
reflectPlayer.Create;
if not isLoggedIn() then
if loginPlayer(false) then
setCompass('Random');
setAngle(ANGLE_HIGH);
begin
repeat
mainLoop;
until (false);
end;
end;