From: WT-Fakawi
Ticcky? or Shady?
if Shady were SRL Members+ he'd be entitled for old timers cup, i don't think he really qulifies for newcomer :p
tickyy has been around since October 2008 (3-4 months) and has managed a fairly decent script in the mean time.
{------------------------------------------------------------------------------]
___________ __ __ Ver 0.1
\__ ___/|__| ____ | | __ ___ __ ___ __
| | | |_/ ___\ | |/ /< | |< | |
| | | |\ \___ | < \___ | \___ |
|____| |__| \___ >|__|_ \ / ____| / ____|
\/ \/ \/ \/
Rimmington Miner
By Tickyy
[------------------------------------------------------------------------------]
[- DESCRIPTION ]
[------------------------------------------------------------------------------]
This Script will Mine And Bank at falador or Mine And Sell at General Store
All Ores(Copper, Tin, Iron, Gold.) are Possible.
Start it At Rimmington Mine.
Note: I used this script for the J Competition.
[------------------------------------------------------------------------------}
program RimmingtonMiner;
{.include SRL\SRL.scar}
{.Include SRL\SRL\Skill\Mining.scar}
procedure DeclarePlayers;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Pin := ''; // Bankpin
Players[0].Active := True;
Players[0].Booleans[0] := True; // Bank or Sell ( True = Bank | False = Sell )
Players[0].Integers[1] := 60; // How many Loads
Players[0].Strings[1] := ''; // Ore Type - See Line 17.
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Pin := ''; // Bankpin
Players[1].Active := False;
Players[1].Booleans[0] := True; // Bank or Sell ( True = Bank | False = Sell )
Players[1].Integers[1] := 60; // How many Loads
Players[1].Strings[1] := ''; // Ore Type - See Line 17.
end;
Const
RunDir = 's'; // Run when at fight.
newcopper = rimmington_Copper;
newtin = rimmington_Tin;
newiron = rimmington_Iron;
newgold = rimmington_Gold;
nub1 = 5865372;
nub2 = 3097926;
var
Loads, Antiban, Ores, x, y, Gasses : Integer;
{==============================================================================]
- DON'T HAVE TO TOUCH ANYTHING BELOW HERE -
[==============================================================================}
function WhichOre : integer;
begin
case Lowercase(Players[CurrentPlayer].Strings[1]) of
'tin' : Result := newtin;
'copper' : Result := newcopper;
'iron' : Result := newiron;
'gold' : Result := newgold;
end;
end;
{ -------------------------------------------------- }
function DeadTree: Integer;
var
arP: TPointArray; // Thanks to ACA2
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 1518397, MMX1, MMY1, MMX2, MMY2, 43);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 1.96) and (H <= 15.27) and (S >= 30.21) and (S <= 100.02) and (L >= 7.82) and (L <= 26.29) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 1.14) and (X <= 6.10) and (Y >= 0.98) and (Y <= 5.99) and (Z >= 0.12) and (Z <= 3.33) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
{ -------------------------------------------------- }
function DTMs(DTM: String): Integer;
begin
case Lowercase(DTM) of
'copper': Result := DTMFromString('78DA63B4676460C86600034608C570BDC6828' +
'11D89CFE8096465A0AAE9C8F74355E3026415A2AA5914A785AAC6' +
'1AC82A43555391E882AA461FC8CA4155E36AA18EAAC600C82A415' +
'5036221AB0100167509FF');
'tin': Result := DTMFromString('78DA63CC616460C86500034608C5D0D3DCC4C' +
'005E5FF0702C612202B03554D5B8E0F5C0D58BC10C82A40559399' +
'9488AA261DC82A43555391E882AA2616C8CA475593146081AA260' +
'6C82A4155036221AB010087290F63');
'gold': Result := DTMFromString('78DA634C61606098C100068C108AE1DA7A690' +
'62E28FF3F10306603195351D554A7B8C1D580C5B380C45C543527' +
'9748A1AA8903120B51D514C53AA2AA890012D350D5240558A0AA0' +
'903127350D55424BAA0AA0901120B50D58058C86A00B5CA1292');
'iron': Result := DTMFromString('78DA639CCEC8C090C300068C108AC1D740858' +
'10BCAFF0F048C7381AC025435D62AD2703560F18540563AAA9A8E' +
'7C3F54359380AC32543545B18EA86A3A81AC5C5435A1AE06A86A3' +
'A80AC1254352016B21A00D6FA0E9E');
end;
end;
procedure FreeThem(DTM: Integer);
begin
FreeDTM(DTM);
end;
{ -------------------------------------------------- }
Procedure ProgressReport;
begin
cleardebug;
WriteLn('============= Rimmington Miner V0.1 ==============|');
WriteLn('|| Loads Done: ' + IntToStr(Loads) + 'Times ');
WriteLn('|| Performed AntiBan: ' + IntToStr(AntiBan) + 'Times ');
WriteLn('|| Ores Banked or Sold: ' + IntToStr(Ores));
WriteLn('|| Ran For: ' + TimeRunning);
WriteLn('==================================================|');
end;
{ -------------------------------------------------- }
Procedure TehStarting;
Begin
ClearDebug;
Wait(1000)
WriteLN(' Rimmington Miner ')
Wait(1500)
WriteLN(' Made By ')
WriteLN('___________ __ __ ')
Wait(250)
WriteLN('\__ ___/|__| ____ | | __ ___ __ ___ __ ')
Wait(250)
WriteLN(' | | | |_/ ___\ | |/ /< | |< | |')
Wait(250)
WriteLN(' | | | |\ \___ | < \___ | \___ |')
Wait(250)
WriteLN(' |____| |__| \___ >|__|_ \ / ____| / ____|')
Wait(250)
WriteLN(' \/ \/ \/ \/ ')
Wait(2000)
End;
{ -------------------------------------------------- }
Procedure OutOfStuck;
Begin
if(not(FindObjRock(x, y, WhichOre)))then
begin
repeat
SetAngle(False);
MakeCompass(Inttostr(Random(360)));
Until FindObjRock(x, y, WhichOre);
end;
end;
{ -------------------------------------------------- }
Procedure RandomCheck;
begin
FindNormalRandoms;
if FindFight then
begin
MakeCompass('n');
mouse(630, 154, 5, 5, True);
fflag(0);
SleepAndMoveMouse(15000+random(5000));
Mouse(630, 15, 5, 5, True);
SleepAndMoveMouse(2000 + random(2000));
fflag(0);
end;
end;
{ -------------------------------------------------- }
procedure AntiBanz;
begin
If(not LoggedIn)then Exit;
Case Random(22) of
0: MMouse(Random(MSX2),Random(MSY2),0,0);
1: HoverSkill('random',false);
2: PickupMouse;
3: GameTab(1+Random(12));
4: SleepAndMoveMouse(400+Random(1500));
5: if Random(2) = 1 then MMouse(1, 338, 515, 165);
6: if Random(2) = 1 then MMouse(515, 1, 250, 503);
7: RandomMovement;
8:
begin
case Random(3) of
0:
begin
KeyDown(VK_RIGHT);
Wait(500+Random(2000));
KeyUp(VK_RIGHT);
end;
1:
begin
KeyDown(VK_Left);
Wait(500+Random(2000));
KeyUp(VK_Left);
end;
2:
begin
case Random(2) of
0:
begin
KeyDown(VK_RIGHT);
Wait(500+Random(1400));
KeyUp(VK_RIGHT);
end;
1:
begin
KeyDown(VK_Left);
Wait(500+Random(1400));
KeyUp(VK_Left);
end;
end;
end;
end;
end;
end;
Gametab(4);
AntiBan := Antiban + 1;
ProgressReport;
end;
{ -------------------------------------------------- }
procedure HandleGas;
begin
Mouse(MMCX + 10, MMCY + 10, 5, 5, True);
SaveScreenshot(ScriptPath + 'Found gas ' + TimeRunning + '.bmp');
Flag;
Inc(Gasses);
end;
{ -------------------------------------------------- }
Procedure WalkToMine;
begin
MakeCompass('n');
RadialRoadWalk(FindFallyRoadColor, 270, 115, 60, 1, 1);
flag;
RadialRoadWalk(FindFallyRoadColor, 145, 205, 73, -1, 1);
flag;
if not RadialRoadWalk(FindRoadColor, 220, 140, 70, 1, 1) then
begin
Writeln('Using Failsafe 2-1!');
Disguise('Using Failsafe!');
RadialWalk(FindRockColor, 210, 150, 73, 2, 2);
end;
if not RadialRoadWalk(FindRoadColor, 220, 140, 73, 2, 2) then
begin
Writeln('Using Failsafe 2-2!');
Disguise('Using Failsafe!');
RadialWalk(FindRockColor, 310, 200, 69, 1, 1);
end;
if not RadialRoadWalk(FindRoadColor, 310, 230, 71, 1, 1) then
begin
Writeln('Using Failsafe 2-3!');
Disguise('Using Failsafe!');
RadialWalk(FindRockColor, 300, 220, 70, 2, 2);
end;
if not RadialWalk(FindRoadColor, 180, 330, 72, 1, 1) then
begin
Writeln('Using Failsafe 2-4!');
Disguise('Using Failsafe!');
RadialWalk(FindRockColor, 145, 295, 73, 2, 2);
end;
RadialWalk(DeadTree, 220, 140, 71, 1, 1);
if not RadialWalk(FindStoneColor, 210, 150, 70, 2, 2) then
begin
Disguise('Using Failsafe!');
RadialWalk(FindRoadColor, 180, 330, 60, 1, 1);
RadialWalk(FindStoneColor, 210, 150, 70, 2, 2);
end;
if (FindSymbol(x, y, 'Mining spot')) then
Begin
Disguise('We are back...');
Mouse(x, y, 5, 5, True);
end;
OutOfStuck;
end;
{ -------------------------------------------------- }
procedure Bank;
var
Tries: Byte;
begin
wait(randomRange(1000, 2000));
SetAngle(True);
if (not(Loggedin)) then exit;
Inc(Tries);
repeat;
OpenBank('veb', True, True);
until (BankScreen) or (PinScreen) or (Tries > 30);
if (PinScreen) then
InPin(Players[CurrentPlayer].Strings[0]);
if (BankScreen) then
begin
Deposit(2, 28, True);
CloseBank
end;
ProgressReport;
WalkToMine;
end;
{ -------------------------------------------------- }
Procedure WalkToBank;
Begin
if (FindSymbol(x, y, 'Mining spot')) then
Begin
Mouse(x, y, 5, 5, True);
end;
MakeCompass('W');
wait(1111);
if not RadialWalk(FindStoneColor, 70, 160, 70, 1, 1) then
begin
Writeln('Using Failsafe 1-1!');
Disguise('Using Failsafe!');
RadialWalk(FindRockColor, 70, 160, 35, 1, 1);
end;
if not RadialRoadWalk(FindRoadColor, 160, 40, 70, 1, 1) then
begin
Writeln('Using Failsafe 1-2!');
Disguise('Using Failsafe!');
RadialWalk(DeadTree, 70, 110, 70, 1, 1);
end;
MakeCompass('n');
wait(1111);
RadialRoadWalk(FindRoadColor, 120, 10, 70, 2, 2);
Wait(RandomRange(100, 300));
RadialRoadWalk(FindRoadColor, 20, 135, 70, 0, 1);
flag;
MakeCompass('W');
wait(randomRange(600, 800));
if not RadialRoadWalk(FindRoadColor, 65, 115, 70, 0, 1) then
begin
Writeln('Using Failsafe 1-3!');
Disguise('Using Failsafe!');
RadialWalk(FindRockColor, 65, 115, 70, 1, 1);
end;
RadialRoadWalk(FindRoadColor, 70, 115, 60, 0, 1);
flag;
RadialRoadWalk(FindRoadColor, 70, 115, 60, 0, 1);
flag;
RadialRoadWalk(FindFallyRoadColor, 30, 120, 70, 1, 2);
if RadialRoadWalk(FindFallyRoadColor, 110, 60, 70, 2, 2) then
begin
SymbolAccuracy := 0.5;
If FindSymbol(x, y, 'Bank') Then
MouseFlag(x, y, 0, 0, 0)
else
SymbolAccuracy := 0.45;
end;
Bank;
end;
{ -------------------------------------------------- }
Procedure ToMinez;
Begin
ProgressReport;
Disguise('Walking to Mine!');
if (FindSymbol(x, y, 'Portal')) then
begin
Writeln('We Found the Portal Symbol');
Mouse(x, y, 2, 2, True);
flag;
end;
RadialWalk(FindRoadColor, 100, 30, 70, 1, 1);
Mouse(808, 222, 1, 1, True);
if (FindSymbol(x, y, 'Mining spot')) then
Begin
Mouse(x, y, 5, 5, True);
Disguise('Found Teh Mine!');
end;
OutOfStuck;
end;
{ -------------------------------------------------- }
function RemainingOres(var X, Y: Integer): String;
var
I: Integer;
begin
for I:= 0 to 3 do
begin
case I of
0: Result:= 'copper';
1: Result:= 'tin';
2: Result:= 'iron';
3: Result:= 'gold';
end;
if(FindDTM(DTMs(Result), X, Y, MIX1, MIY1, MIX2, MIY2)) then
Exit;
end;
Result:= '';
end;
{ -------------------------------------------------- }
procedure SellShit;
var
X, Y, Sold : Integer;
B: TBox;
RO: String;
begin
repeat
Wait(RandomRange(250, 500));
RO:= RemainingOres(X, Y);
Writeln('Remaining Ore = "' + RO + '"');
if(not(RO = '')) then
begin
Writeln('Found ' + Capitalize(RO) + ' at slot ' + IntToStr(CoordsToItem(X, Y)));
B:= InvBox(CoordsToItem(X, Y));
MouseBox(B.X1, B.Y1, B.X2, B.Y2, 2);
Wait(200 + Random(300));
ChooseOption('50');
Wait(1000 + Random(500));
end;
until(RO = '');
ToMinez;
end;
{ -------------------------------------------------- }
Procedure WalkToShop;
begin
if(not LoggedIn)then Exit;
if(InvFull)then
begin
Disguise('Walking to the shop!');
if (FindSymbol(x, y, 'Mining spot')) then Mouse(x, y, 2, 2, True);
MakeCompass('n')
flag;
if not RadialRoadWalk(FindRoadColor, 225, 180, 73, 1, 1) then
begin
Writeln('Using Failsafe!');
Disguise('Using Failsafe!');
Mouse(576, 141, 1, 1, True);
flag
Mouse(581, 131, 1, 1, True);
end;
flag;
RadialRoadWalk(FindRoadColor, 290, 250, 40, 2, 2);
if (FindSymbol(x, y, 'Portal')) then
begin
Writeln('We Found the Portal Symbol');
Mouse(x, y, 5, 5, True);
flag;
end;
if not RadialWalk(FindLadderColor, 300, 200, 70, 1, 1) then
begin
Writeln('Using Failsafe!');
Disguise('Using Failsafe!');
if (FindSymbol(x, y, 'shop')) then
Mouse(x, y, 1, 1, true);
end;
flag;
repeat
Wait(6000);
until (FindObjCustom(x, y, ['hop'], [nub1, nub2], 3));
Wait(Random(150));
Mouse(x, y, 0, 0, False);
ChooseOption('Trade');
wait(2000 + Random(6000));
end;
Sellshit;
end;
{ -------------------------------------------------- }
Procedure Starting;
Begin
Disguise('Setting up.');
Wait(6000);
Setrun(true);
GameTab(4);
SetAngle(false);
if (FindSymbol(x, y, 'Mining spot')) then
Begin
Mouse(x, y, 5, 5, True);
end;
Wait(2500);
if(not(FindObjRock(x, y, WhichOre)))then
begin
MakeCompass('S');
Wait(Random(500));
end;
OutOfStuck;
end;
{ -------------------------------------------------- }
procedure MineOre;
var
f : integer;
begin
Wait(Random(500))
if(not LoggedIn)then Exit;
x := MSCX;
y := MSCY;
if FindObjRock(x, y, WhichOre)then
begin
if(not FindGas(x, y))then
begin
Disguise('Found teh rock... Attempting to mine');
Case (Random(3)) of
0, 2: begin
Wait(random(100));
Mouse(x, y, 2, 2, False);
ChooseOption('Mine');//otherwise it may Examine
end;
1: Mouse(x, y, 2, 2, True);
end;
if(not(FindObjRock(x, y, WhichOre)))then
begin
OutOfStuck;
end;
Wait(Random(50));
Flag;
MarkTime(f);
Disguise('Mining rock...');
Wait(Random(50));
repeat
Wait(Random(200));
RandomCheck;
Wait(Random(50));
case (Random(3))of
0: AntiBanz;
end;
Wait(Random(50));
until (FindGas(x, y))or(FindBlackChatMessage('anage'))or(TimeFromMark(f) > 8000)or(InvFull);
if(FindGas(x, y))then
HandleGas;
end;
if(InvFull) then
begin
if (Players[CurrentPlayer].Booleans[0] = True) then
begin
Disguise('Walking to Bank');
Ores := Ores + 28;
Loads := Loads + 1;
ProgressReport;
WalkToBank;
end else
Disguise('Walking to Shop');
WalkToShop
end;
end;
RandomCheck;
end;
{ -------------------------------------------------- }
Procedure MainLoop;
var
Loads : integer;
begin
Wait(222);
repeat
if(not LoggedIn)then LoginPlayer;
repeat
MineOre;
wait(100);
MineOre;
RandomCheck;
until (Loads >= (Players[CurrentPlayer].Integers[1])) or (not LoggedIn);
NextPlayer(Players[CurrentPlayer].Active);
until false;
end;
{ -------------------------------------------------- }
begin
SetupSRL;
SetupMining;
TehStarting;
DeclarePlayers;
LoginPlayer;
Starting;
Mainloop;
end.
so yes, i say tickyy :p
also, the Promising Newcomer cup still says "best newcomer" when you hover the mouse over it. (AltText / alternative text)
and heysus has been around for 4-5 months (sep 2008) and has done soem quite ncie things:
Reflection include functions:
http://www.villavu.com/forum/showthread.php?t=41074?t=44020&highlight=heysushis script for the competition (with my comments on it)
{
* Technique
* Individuality
* Follow all SRL rules: i.e break out of potential infinite loops etc.
* Creativity
* Content
* Efficiency
* Presentation
* Meeting all Requirements (check: Extra Rules!) ---> yes
* Added Extras
* Script Run
}
{
RIMMINGTON MINER BY HEYSUS
INSTRUCTIONS
1. Start Anywhere (mine, store, or anywhere in between)
2. Press Start
F11: Reset Players
F12: Toggles between Player Report and Randoms Report
}
//fairly crappy script title
Program RimmingtonMiner;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Skill\Mining.scar}
{.Include SRL\SRL\Misc\Users.scar}
type
Response = record
Question: array of string;
Answer: array of string;
Timer: integer;
end;
var
x, y, i, ReportType, RespondTimer, Time, Timer: integer; //do we really need all these vars?
Bmp_Ore, Shopkeepers, RockIndex: integer; // could put all the integer into one
Xp: extended;
RockLocation: TPoint;
AutoResponse: Array of Response; // Auto responder = EXTRA
const
SRL_ID = ''; //SRL Stats //srl stats = EXTRA
SRL_Password = '';
Rock = 'Copper'; // One rock for all players ---> CRAP!
MinTime = 15; //Time per player (minutes)
MaxTime = 25;
Procedure PlayerReport; // gotta print out a proggy to see it...
var
i, Width: integer;
s: string;
begin
ClearReport;
AddToReport(' Player Report (F11 = Reset)');
for i:=0 to High(Players) do
begin
s := ' ' + Players[i].Name;
While Length(s) <= 13 do
s := s + ' ';
case Players[i].Active of //if would be better here
True: s := s + '(Active)';
False: s := s + '(Inactive)';
end;
While Length(s) <= 25 do
s := s + ' ';
s := s + IntToStr(Players[i].Integers[0]) + ' Ore';
While Length(s) <= 35 do
s := s + ' ';
s := s + IntToStr(Round(Players[i].Integers[0]*Xp)) + ' Xp';
if Length(s) > Width then
Width := Length(s);
ChangeReportWidth(Width*9 + 4);
AddToReport(s);
end;
end;
Procedure ProgressReport(s: string); //doesn't look like a great proggy...
var
OreMined: integer;
begin
for i:=0 to High(Players) do
IncEx(OreMined, Players[i].integers[0]);
if s = '' then //no need for begin and end, = lack of standarts
begin
s := GetDebugLine(2);
end else
s := 'Status: ' + s;
if IsFKeyDown(12) then
case ReportType of //could be if...
0: ReportType := 1;
1: ReportType := 0;
end;
if IsFKeyDown(11) then // nice! Local Control = Extra
if GetApplication.Messagebox('Reset Players?', 'Rimmington Miner by Heysus', 1) = 1 then
begin
for i:=0 to High(Players) do
Players[i].Active := true;
Writeln('Players Reset');
Wait(1000);
end;
ClearDebug;
Writeln('Rimmington Miner by Heysus'); // Crappy proggy
Writeln(Capitalize(Rock) + ' Ore Mined: ' + IntToStr(OreMined));
Writeln(s); //uh .... debuggin in a proggy,...
Writeln('Next Player In ' + IntToStr( (Time - TimeFromMark(Timer))/60000) + ' Minutes');
Writeln(TimeRunning);
Writeln('');
case ReportType of
0: begin
Writeln('Press F12 to Show Player Report');
SRLRandomsReport;
end;
1: begin
Writeln('Press F12 to Show Randoms Report');
PlayerReport;
end;
end;
end;
Function StoreScreen: boolean; // very well done -- why not ShopScreen from amount.scar? bad use of SRL
begin
Result := FindTextTPA(2071807, 30, 170, 32, 365, 48, 'Store', upchars, Nothing);
end;
Function Direction(x1, y1, x2, y2: integer): extended; //logic, great
var
x, y, h: extended;
begin
x := (x1 + x2)/2;
y := (y1 + y2)/2;
h := Hypot(x, y);
Result := -1;
case 0 of
x: Result := Degrees(ArcCos(x/h));
y: Result := Degrees(ArcSin(y/h));
h: exit;
end;
if Result = -1 then
Result := Degrees(ArcTan(y/x));
end;
Procedure AutoRespond; // looks farily ok
var
a, b, c: integer;
n: string;
begin
if not LoggedIn then
exit;
if TimeFromMark(RespondTimer) < 5000 then
exit;
LastChatter(n);
if n = Players[CurrentPlayer].Name then
exit;
for a:=0 to High(AutoResponse) do
begin
for b:=0 to High(AutoResponse[a].Question) do
begin
if TimeFromMark(AutoResponse[a].Timer) < 120000 then
exit;
if Pos(Lowercase(AutoResponse[a].Question[b]), Lowercase(GetChatBoxText(8, clBlue))) > 0 then
begin
c := Random(GetArrayLength(AutoResponse[a].Answer));
SaveToChatLog;
AddToSRLLog(Players[CurrentPlayer].Name + ': ' + AutoResponse[a].Answer[c]);
Writeln('Typing Auto Response');
Wait(RandomRange(500, 1500));
Typesend(AutoResponse[a].Answer[c]);
MarkTime(RespondTimer);
MarkTime(AutoResponse[a].Timer);
exit;
end;
end;
end;
end;
Procedure AntiBan;
var
Angle: integer;
begin
if not LoggedIn then
exit;
case Random(750) of
0, 1: HoverSkill('mining',false);
2: HoverSkill('random', false);
3: BoredHuman;
4: SleepAndMoveMouse(250+random(250));
5: RandomRClick;
6: begin //Checks friends list
GameTab(8);
Wait(1000+random(500));
MMouse(MIX1,MIY1,160,240);
Wait(1000+random(500));
GameTab(4);
end;
7, 8: begin
Angle := Round(rs_GetCompassAngleDegrees);
MakeCompass(IntToStr(RandomRange(Angle - 45, Angle + 45)));
end;
9, 10, 11, 12, 13, 14: PickUpMouse; // 9..14
end;
end;
Procedure AntiRandom; //this is being called as anti ban inside of SRL......
begin
ProgressReport(''); //oh god, we're gonna be gettign about 1 million proggies
if not LoggedIn then
exit;
FindNormalRandoms;
AutoRespond;
AntiBan;
if FindFight then
RunAway('s', true, 1, RandomRange(15000, 25000));
end;
Function CharMoving: boolean;
var //smart enought, efficient, but might mess up because of points(players / npcs).
C1, C2, C3, C4: integer; // how about Flag?
begin
Result := false;
C1 := GetColor(MMCX - 25, MMCY - 25);
C2 := GetColor(MMCX + 25, MMCY - 25);
C3 := GetColor(MMCX + 25, MMCY + 25);
C4 := GetColor(MMCX - 25, MMCY + 25);
Wait(500);
if not((GetColor(MMCX - 25, MMCY - 25) = C1)) then
Result := true;
if not((GetColor(MMCX + 25, MMCY - 25) = C2)) then
Result := true;
if not((GetColor(MMCX + 25, MMCY + 25) = C3)) then
Result := true;
if not((GetColor(MMCX - 25, MMCY + 25) = C4)) then
Result := true;
end;
Procedure SetCompass; // meh, bit pointless?
{ Sets the compass in 45 degree increments so your
character is not standing in front of the ore }
var
i, Angle: integer;
begin
Angle := Round(rs_GetCompassAngleDegrees);
for i:=0 to 3 do
if InRange(Angle, i*90 + 30, i*90 + 60) then
exit;
i := Random(4);
MakeCompass(IntToStr(RandomRange(i*90 + 30, i*90 + 60)));
end;
Function SymbolWalk(Symbol: string; XOffset, YOffset: integer): boolean;
// DDTMs weren't working good in Rimmington :(
var
x, y, XMod, YMod: integer;
Angle: extended;
begin
Result := false;
if not LoggedIn then
exit;
if not FindSymbol(x, y, Symbol) then
exit;
//all this logic jsut to get Rx and Ry?
Angle := rs_GetCompassAngleRadians; //pretty and all but not really needed.
x:= x + round(XOffset*cos(Angle) - YOffset*sin(Angle)); //and pointless really cus
y:= y + round(XOffset*sin(Angle) + YOffset*cos(Angle)); // if x and y are on minimap,
//which they will be because we jsut got it
if x > MSCX then //from the symbol finding, MFNF will jsut do
begin //Mouse(x, y, 2, );
XMod := -4; // = Bad use of SRL
end else
XMod := 4; //some things don't need to be done all complex if simple works.
if y > MSCY then
begin
YMod := -4;
end else
YMod := 4;
if Distance(MMCX, MMCY, x, y) > 10 then // good thing, if close to symbol it doesn't move
begin
if MFNF(x, y, XMod, YMod) then
begin
FFlag(30);
Result := true;
end;
end else
Result := true;
AntiRandom; //we don't get any randoms when walking.
end;
Procedure WalktoStore;
var
MMAngle: integer;
Angle: extended;
begin
if not LoggedIn then
exit;
ProgressReport('Walking To Store');
repeat
MMAngle := Round(rs_GetCompassAngleDegrees);
if FindDTMRotated(Shopkeepers, x, y, MMX1, MMY1, MMX2, MMY2, Radians(MMAngle-30), Radians(MMAngle + 30), 0.05, Angle) then
//why only at these angles? where is the compass facing??
begin
if Distance(MMCX, MMCY, x, y) < 20 then
exit;
Mouse(x, y, 0, 0, true);
FFlag(0);
exit;
end;
if not SymbolWalk('store', 0, 0) then
if not SymbolWalk('portal', 14, 12) then
if not SymbolWalk('water', 15, -20) then
if not RadialWalk(FindRoadColor, MMAngle + 190, MMAngle + 260, 65, 1, -1) then
SymbolWalk('mining spot', -15, 20); //what if mining spot is obscured? guessit'll open up at some time..
AntiRandom;
until(false);
Wait(RandomRange(250, 500));
ProgressReport('');
end;
Procedure WalktoMine;
var
MMAngle, t: integer;
Angle: extended;
Rocks: TPointArray;
begin
if not LoggedIn then
exit;
if FindAllRocksRecord(Rocks, RockIndex, false, true) then //if it finds a rock then exit
exit;
if SymbolWalk('mining spot', RockLocation.x, RockLocation.y) then //if it finds the symbol then exit...
exit;
ProgressReport('Walking To Mine');
SymbolWalk('store', 60, -36);
MarkTime(t);
repeat
if SymbolWalk('mining spot', RockLocation.x, RockLocation.y) then
break;
MMAngle := Round(rs_GetCompassAngleDegrees);
if not SymbolWalk('mining spot', 0, 0) then
if not RadialWalk(FindRoadColor, MMAngle + 15, MMAngle + 85, 65, 1, -1) then
if not SymbolWalk('water', 20, -20) then
begin
Angle := rs_GetCompassAngleRadians;
x:= MMCX + round(55*cos(Angle) - 17*sin(Angle));
y:= MMCY + round(55*sin(Angle) + 17*cos(Angle));
end;
AntiRandom;
until(TimeFromMark(t) > 30000);
ProgressReport('');
end;
Function TradeShopkeeper: boolean;
var
i, t: integer;
Colors: Array of integer;
begin
if not LoggedIn then
exit;
if StoreScreen then
begin
Result := true;
exit;
end;
Colors := [12765898, 3032132, 5734044]
While CharMoving do //FFLag(0);
Wait(100);
for i:=0 to 2 do
begin
if FindObjTPA(x, y, Colors[i], 10, 1, 4, 4, 12, ['hop']) then //nice way of finding
begin
Mouse(x, y, 0, 0, false);
Wait(RandomRange(50, 100)); //nice
if ChooseOption('Trade') then
begin
MarkTime(t);
repeat
Wait(100);
until((StoreScreen) or (TimeFromMark(t) > 10000));
Wait(RandomRange(400, 800));
Result := StoreScreen; //what if it didn't open?
exit;
end;
end; //else ??
end;
end;
Procedure SellOre;
begin
if not LoggedIn then
exit;
if not TradeShopkeeper then //meh...
exit;
ProgressReport('Selling Ore');
GameTab(4);
if FindBitmapToleranceIn(Bmp_Ore, x, y, MIX1, MIY1, MIX2, MIY2, 40) then
begin
MMouse(x, y, 4, 4);
Wait(RandomRange(100, 200));
if IsUpText('re') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
Wait(RandomRange(50, 100));
ChooseOption('50');
end;
Wait(RandomRange(300, 600));
end;
CloseWindow;
AntiRandom; //no randoms from selling...
ProgressReport('');
end;
Function FindRocks: boolean;
var
x, y, t: integer;
Angle: extended;
Rocks: TPointArray;
begin
if not LoggedIn then
exit;
if FindAllRocksRecord(Rocks, RockIndex, false, true) then
begin
Result := true;
exit;
end;
Result := false;
case RockIndex of
1, 2: t := GetSystemTime + 1000;
3: t := GetSystemTime + 5000;
4: t := GetSystemTime + 105000;
end;
While GetSystemTime < t do
begin
Wait(250);
AntiRandom;
if FindAllRocksRecord(Rocks, RockIndex, false, true) then
begin
Result := true;
exit;
end;
end;
WalkToMine;
While CharMoving do
Wait(100);
if not FindAllRocksRecord(Rocks, RockIndex, false, true) then
begin
if not FindSymbol(x, y, 'mining spot') then
begin
Writeln('Could not Find Mine Symbol');
TerminateScript; //what if there are other players?!?! huge mistake!
exit;
end;
Angle := rs_GetCompassAngleRadians;
x:= x + round(RockLocation.x*cos(Angle) - RockLocation.y*sin(Angle));
y:= y + round(RockLocation.x*sin(Angle) + RockLocation.y*cos(Angle));
MakeCompass(FloatToStr(Direction(MSCX, MSCY, x, y)));
SetAngle(false); //angle true would work better....
if FindAllRocksRecord(Rocks, RockIndex, false, true) then
begin
Result := true;
exit;
end;
end;
end;
Procedure MineOre;
var
x, y, OreCount, Timeout, T: integer;
RockPos: TPoint;
Rocks: TPointArray;
begin
if not LoggedIn then
exit;
if InvFull then
exit;
SetCompass;
While CharMoving do
Wait(100);
if not FindRocks then
begin
ProgressReport('Could not Find Rocks');
Players[CurrentPlayer].Active := false;
exit;
end;
//Finds rock without gas near it
if not FindGas(x, y) then
begin
x := -100;
y := -100;
end;
FindAllRocksRecord(Rocks, RockIndex, false, true); //then what the hell was FindRocks for?!
if GetArrayLength(Rocks) = 0 then
exit;
SortTPAFrom(Rocks, Point(MSCX, MSCY)); //nice
for i:=0 to High(Rocks) do
begin
if Distance(x, y, Rocks[i].x, Rocks[i].y) > 100 then //so if there was no gas and the rocks were near the edge of the screen?
begin
MMouse(Rocks[i].x, Rocks[i].y, 0, 0);
Wait(RandomRange(100, 150));
if IsUpText('Rock') then
break;
end else
if i = High(Rocks) then
exit;
end;
ProgressReport('Mining');
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
RockPos := Point(x, y);
OreCount := CountItemsIn('inv', 'bmp', Bmp_Ore, [40]);
MarkTime(Timeout);
MarkTime(T);
While TimeFromMark(T) < 1000 do //why only last one sec?
begin
Wait(100);
FindPick; //it's gonna check for it even if you have a perfectly fine pick axe >.>
// if there is blue text from levelign up it'll think u lost the pic and lose an
//awful amount of time looking!
AntiRandom;
if CountItemsIn('inv', 'bmp', Bmp_Ore, [40]) = OreCount + 1 then // if you jsut checked the empty spot
begin //and then checked if an items exists in it....
Inc(Players[CurrentPlayer].integers[0]); //very ineficient...
Inc(ReportVars[0]);
exit;
end;
//Checks if there is ore in the rock
FindAllRocksRecord(Rocks, RockIndex, false, true);//ineficient! u already clicked the rock, in the
if GetArrayLength(Rocks) = 0 then //1000 ms this loop lasts you night as well check for the text!
exit;
SortTPAFrom(Rocks, RockPos);
if Distance(Rocks[0].x, Rocks[0].y, RockPos.x, RockPos.y) < 30 then
begin
RockPos := Rocks[0];
MarkTime(T);
end;
if InvFull then
break;
if TimeFromMark(TimeOut) > (RockIndex/4 + 1)*30000 then //not really going to happen when this loop ends
break; // in 1000 ms....
if FindGas(x, y) then
begin
if Distance(RockPos.x, RockPos.y, x, y) < 100 then //do you really expect gas to appear in 1s
begin
Writeln('Gas Detected');
AddToSRLLog('Gas Detected');
Mouse(MMCX + 8, MMCY + 8, 2, 2, true); //nice
break;
end;
end;
end;
Wait(RandomRange(50, 100));
if CountItemsIn('inv', 'bmp', Bmp_Ore, [40]) = OreCount + 1 then
begin
Inc(Players[CurrentPlayer].integers[0]);
Inc(ReportVars[0]);
end;
end;
Procedure SetupAutoRespond;
begin
SetLength(AutoResponse, 6);
AutoResponse[0].Question := ['hi', 'hello', 'hey', 'helo'];
AutoResponse[0].Answer := ['hi', 'hello', 'hey'];
AutoResponse[1].Question := ['mining level', 'mining lvl', 'minin level',
'minin lvl', 'mine level', 'mine lvl'];
AutoResponse[1].Answer := [IntToStr(GetSkillLevel('mining'))];
AutoResponse[2].Question := ['lol', 'lawl', 'rofl', 'haha', 'lmao'];
AutoResponse[2].Answer := ['lol', 'lawl', 'rofl', 'haha', 'lmao'];
AutoResponse[3].Question := [Players[CurrentPlayer].Nick];
AutoResponse[3].Answer := ['no hablo ingles', 'je ne parle pas anglais', 'I cant talk im muted'];
AutoResponse[4].Question := ['hablo espanol'];
AutoResponse[4].Answer := ['no hablo espanol', 'no comprendo', 'yo vivo en taco bell'];
end;
Procedure SetupPlayer;
begin
if not LoggedIn then
LoginPlayer;
SetAngle(true);
FindPickHeadColor; //what if there is no pick?
SetupAutoRespond;
ProgressReport('');
end;
Procedure Setup;
begin
SetupSRL;
SetupMining;
SRLPlayerForm(True, [], [], [], []); //Strings0 for choosing the rock!
SMARTSetupEx(121, False, True, False); // Extra = SMART --> what if they don't want smart?!
Wait(1000);
SetTargetDC(SmartGetDC);
case Capitalize(Rock) of
'Iron':
begin //Could've used a type.
Bmp_Ore := SRL_GetBitmap(1);
RockIndex := 3;
RockLocation := Point(-35, 6);
Xp := 35;
end;
'Copper':
begin
Bmp_Ore := SRL_GetBitmap(2);
RockIndex := 1;
RockLocation := Point(3, -20);
Xp := 17.5;
end;
'Tin':
begin
Bmp_Ore := SRL_GetBitmap(3);
RockIndex := 2;
RockLocation := Point(25, 16);
Xp := 17.5;
end;
'Gold':
begin
Bmp_Ore := SRL_GetBitmap(6);
RockIndex := 4;
RockLocation := Point(0, 24);
Xp := 65;
end;
end;
if RockIndex = 0 then
begin
Writeln('ERROR: Rock Type Not Recognized');
TerminateScript;
end;
Shopkeepers := DTMFromString('78DA638C6162608865400139A9290C29409A1' +
'188FF03016338504D28AA9AB76F1918F8A16A4080319AB01A00C6' +
'C80B89');
ScriptID := '1146';
SRLID := SRL_ID;
SRLPassword := SRL_Password;
SRL_Procs[0] := @AntiRandom; //procs 0 = antiban
end;
begin
Setup;
RandomNextPlayer(Players[CurrentPlayer].Active); //uh...!
SetupPlayer;
repeat
Time := RandomRange(MinTime*60000, MaxTime*60000); //nice !
MarkTime(Timer);
repeat
case InvFull of // IF !
True: begin
WalkToStore;
SellOre;
end;
False: begin
WalkToMine;
MineOre;
end;
end;
if not LoggedIn then
break;
if Players[CurrentPlayer].Active = false then
break;
until(TimeFromMark(Timer) > Time);
Logout; //next player already logs out... = INEFICIENT
RandomNextPlayer(Players[CurrentPlayer].Active);//
until(false);
end.
commented a lot on some inefficiencies, and some of the comments might sound mean, but those are just to remind me of certain things, he will not see the comments :P
but fairly good to be honest.
his profile:
http://www.srl-forums.com/forum/member.php?u=53004nice amount of work you guys have been doing :)
~RM