All pastes #33320 Raw Edit

Include

public text v1 · immutable
#33320 ·published 2005-12-11 21:36 UTC
rendered paste body
Function IsTextAtFromMouse(x, y, Chars: Integer; S: String): Boolean;
var
mx, my: Integer;

begin
  GetMousePos(mx, my);
  Result := IsTextAtEx(mx + x, my + y, S, 0, Chars , False, False, 0, 1, $FFFFFF);
end;

Function IsEvent(dx, dy, Row, Offset, Chars: Integer; S: String): Boolean;
var
x, y: Integer;

begin
  IsTextInAreaEx(dx div 2, dy - 200, dx, dy, x, y, 'Eve', 0, Chars, False, False, 0, 1, $FFFFFF);
  Result := IsTextAtEx(x + 52 + Offset, y + (Row * 16), S, 0, Chars, False, False, 0, 1, $FFFFFF);
end;

Procedure Init(var dx, dy, stx, sty, wax, way, Chars: Integer; var Error: Boolean; var ErrorMsg: String; Client: String);
var
x, y: Integer;

begin
  if not(GetSCARVersion = 203)then
  begin
    ErrorMsg := 'Error: you do not have the required software, please';
    Error := True;
    exit;
  end else if not(FindWindowTitlePart(Client, True))then
  begin
    ErrorMsg := 'Error: Could not find the client specified.';
    Error := True;
    exit;
  end;
  ActivateClient;
  GetClientDimensions(dx, dy);
  SetMouseMode(False);
  if(IsFontSmoothingEnabled)then SetFontSmoothing(False);
  Chars := LoadCharsFromFont2('Arial', 8, False, False, False, False);
  Error := False;
  if(IsTextInAreaEx(0, 0, dx, dy, x, y, 'water', 0, Chars, False, False, 0, 1, $FFFFFF))then
  begin
    wax := x + 10;
    way := y + 5;
  end else
  begin
    Error := True;
    ErrorMsg := 'Error: Failed to find Water Coordinates, please make sure invetory is open.';
    exit;
  end;
  if(IsTextInAreaEx(0, 0, dx, dy, x, y, 'steak', 0, Chars, False, False, 0, 1, $FFFFFF))then
  begin
    MoveMouseSmooth(x, y);
    Wait(100);
    if(IsTextAtFromMouse(15, 4, Chars, 'Pi'))then
    begin
      stx := x + 10;
      sty := y + 20;
    end else if(IsTextAtFromMouse(15, 4, Chars, 'steak'))then
    begin
      stx := x;
      sty := y;
    end;
  end else
  begin
    Error := True;
    ErrorMsg := 'Error: Failed to find Steak Coordinates, please make sure invetory is open.';
    exit;
  end;
end;

Procedure FindBars(var px, py, nx, ny, fx, fy, wx, wy: Integer; dx, dy: Integer);
begin
  FindColorTolerance(px, py, 2694943, dx div 2, dy - 100, (dx div 2) + 20, dy, 0);
  FindColorTolerance(nx, ny, 3644729 , dx - 200, 0, dx, dy, 25);
  FindColorTolerance(fx, fy, 3043228, dx - 200, 0, dx, dy, 25);
  FindColorTolerance(wx, wy, 10971947, dx - 200, 0, dx, dy, 15);
end;

Procedure FindTile(var TileX, TileY: Integer; dx, dy, Chars: Integer; Tile: String);
var
x, y, rep, n: Integer;
begin
  MoveMouseSmooth(dx div 2, dy div 2);
  while not(IsTextAtFromMouse(15, 4, Chars, Tile))and(rep < 150)do
  begin
    GetMousePos(x, y);
    if(x < 100)or(y < 100)or(x > dx - 200)or(y > dy - 160)or(n > 14)then
    begin
      MoveMouseSmooth(dx div 2 + Random(3), dy div 2 - Random(3));
      GetMousePos(x, y);
      n := 2;
    end;
    MoveMouseSmooth(x + (n * Random(10)), y - (n * Random(10)));
    wait(150);
    if(IsTextAtFromMouse(15, 4, Chars, Tile)) then break;
    GetMousePos(x, y);
    MoveMouseSmooth(x - Random(2), y + (n * Random(15)));
    wait(150);
    if(IsTextAtFromMouse(15, 4, Chars, Tile)) then break;
    GetMousePos(x, y);
    MoveMouseSmooth(x - (n * Random(10)), y + Random(2));
    wait(150);
    if(IsTextAtFromMouse(15, 4, Chars, Tile)) then break;
    GetMousePos(x, y);
    MoveMouseSmooth(x - Random(2), y - (n * Random(10)));
    wait(150);
    if(IsTextAtFromMouse(15, 4, Chars, Tile))then break;
    wait(150);
    rep := rep + 1;
    n := n + 1;
  end;
  GetMousePos(TileX, TileY);
end;

Procedure GetMenu(var ErrorMsg: String; var Error: Boolean; x, y, dx, dy, px, py, nx, ny, Option, SubOption, Chars: Integer; Name: String; Progress, Stamina: Boolean);
var
xx, m, yy, rep: Integer;

begin
   MoveMouseSmooth(x, y);
   Wait(300);
   if not(IsTextAtFromMouse(15, 4, Chars, Name))then
   begin
     ErrorMsg := 'Error: Could not find Object! Please edit your constants';
     Error := True;
     exit;
   end;
   while not(IsTextAtFromMouse(-4 ,-14, Chars, Name))do
    begin
      ClickMouse(x, y, False);
      Wait(200);
    end;
    while not(IsTextInAreaEx(x, y, dx - 20, dy - 20, xx, yy, 'this?', 0, Chars, False, False, 0, 1, $FFFFFF))do Wait(100);
    MoveMouse(x, y + 6);
    Wait(100);
    while(FindColorTolerance(xx, yy, 16777215, x + m, y, x + m, y + 2, 0))do m := m + 10;
    GetMousePos(x, y);
    Option := Option - 1;
    MoveMouseSmooth(x, y + (Option * 16));
    Wait(100);
    GetMousePos(x, y);
    if not(SubOption = 0)then
    begin
      SubOption := SubOption - 1;
      MoveMouse(x + m + 10, y);
      Wait(100);
      GetMousePos(x, y);
      MoveMouseSmooth(x, y + (SubOption * 16));
      Wait(100);
      GetMousePos(x, y);
    end;
    if(Progress)then while(GetColor(px, py) = 13408665)do Wait(100);
    if(Stamina)then while not(FindColorTolerance(xx, yy, 3644729, nx, ny , nx, ny + 1, 50))do Wait(100);
    ClickMouse(x, y, True);
    if(Progress)then
    begin
      while(FindColor(x, y, 2694943, px, py, px, py))and(rep < 10)do
      begin
        wait(500);
        rep := rep + 1;
      end;
    end;
end;

Procedure DoubleClick(x, y: Integer);
begin
MoveMouseSmoothEx(x, y, 2, 4, 51, 18, 9);
Wait(50);
ClickMouse(x, y, True);
Wait(20);
ClickMouse(x, y, True);
end;

Procedure DragMouse(x1, y1, x2, y2: Integer; Left: Boolean);
begin
HoldMouse(x1, y1, Left);
MoveMouseSmoothEx(x2, y2, 2, 4, 51, 18, 9);
Wait(100);
ReleaseMouse(x2, y2, Left);
end;

{Procedure ReportStatistics(Count: Integer; ST: LongInt);
var
  RHours, Minutes, Seconds, RMinutes, RSeconds, AvTime: LongInt;
  Time: string;
begin
  Seconds := (GetSystemTime - ST) div 1000;
  Minutes := Seconds div 60;
  RHours :=  Minutes div 60;
  Time := IntToStr(Seconds) + ' Seconds';
  if(Count > 0)then
    AvTime := Seconds/Count;
  if(Minutes <> 0)then
  begin
    RSeconds := Seconds Mod(Minutes * 60);
    Time := IntToStr(Minutes) + ' Minutes and ' + IntToStr(RSeconds) + ' Seconds';
  end;
  if(RHours <> 0)then
  begin
    RMinutes := Minutes Mod(RHours * 60);
    RSeconds := Seconds Mod(Minutes * 60);
    Time := IntToStr(RHours)+' Hours, '+IntToStr(RMinutes) +
    ' Minutes and ' + IntToStr(RSeconds) + ' Seconds';
  end;
  ClearReport;
  AddToReport('Ultra Miner v0.6_134_01');
  AddToReport('I have mined a total of ' + IntToStr(StatOre) + ' ores.');
  AddToReport('I have broken through ' + IntToStr(StatFwd) + ' walls.');
  AddToReport('I have consumed water ' + IntToStr(StatDrink) + ' times.');
  AddToReport('I have eaten steak ' + IntToStr(StatEat) + ' times.');
  AddToReport('I have gotten my pickaxe stuck ' + IntToStr(StatStuck) + 'times.');
  AddToReport('I am averaging ' + IntToStr(avtime) + ' seconds per Ore.');
  AddToReport('I have been mining for ' + Time + '.');
end;  }

Procedure ExitOut;
begin
 ActivateClient;
    SendKeysVB('{F12}', true);
    Wait(5000);
    SendKeys(#13);
end;

Procedure FreeItem(dx, dy, row, offset, Chars: Integer; one: String);
begin
end;