Simba Code:
{==============================================================================]
[==============================================================================]
[ RM Power Crafter ]
[ By: Rasta Magician ]
[==============================================================================]
[ Features ]
[==============================================================================]
[ 1. Debug ]
[ 2. AntiRandoms ]
[ 3. AntiBan ]
[ 4. Multiplayer ]
[ 5. Resting ]
[ 6. Progress Report ]
[ 7. Local Control ]
[ 8. Responder ]
[ 9. Proggy To File ]
[ 10. Smart Cycleing ]
[==============================================================================]
[ Description ]
[==============================================================================]
[ Mines clay, softens it, molds it into bowls(f2p), ]
[ plant pots or pot lids (with needed quest), then fires the clay, drops it ]
[ and repeats the whole thing. All of this happens inside the Crafting Guild ]
[ ]
[==============================================================================]
[ How To Use ]
[==============================================================================]
[ 0. You need level 40 crafting ]
[ 1. Wield a pick ]
[ 2. Wear a brown appron ]
[ 3. Have jugs in inventory (I suggest 4 jugs) ]
[ ]
[==============================================================================]
[ Credits ]
[==============================================================================]
[ SRL Team ]
[ Ed, thx for testing ]
[==============================================================================]
[ RM Power Crafter by Rasta Magician ]
[==============================================================================]
[==============================================================================}
{
add one more text for moulding clay
mold and fire menu colors changed place
}
program RMScript;
{$DEFINE SMART }
{$DEFINE Reflection}
//{$DEFINE FORM }
{$IFDEF SMART }
{.include srl/srl/misc/Smart.scar}
{$ENDIF}
{.include srl/srl.scar}
{$IFDEF Reflection}
{.include SRL\SRL\Reflection\Reflection.scar}
{$ENDIF}
{.include srl/srl/skill/mining.scar}
{$IFDEF FORM }
{.include srl/srl/misc/users.scar}
{$ENDIF}
Const
WorkTime = (30*60*1000); //10 mins
RestTime = (3*60*1000); //3 mins
IsMember = true;
UseDebug = True;
UseResponder = True;
SaveProggyToFile = True;
ScriptName = 'RM Power Crafter';
Version = '2.0';
YourSRLID = ''; //your SRLID
YourSRLPass = ''; //your SRL Stats pass
MyScriptID = '1199'; // don't touch
var
Rested, Worked, Loads,
PickColor, LadderColor, OvenColor,
ClayDTM, SoftDTM, JugDTM, WJugDTM, GemDTM,
JugCount, ClayCount,
ClayMined :integer;
ProggyStr: string;
function IsSameIntArray(i1, i2:TIntegerArray):boolean;
var i:integer;
begin
Result := false;
if Length(i1) <> Length(i2) then exit;
Result := true;
for i:= 0 to high(i1) do
if i1[i] <> i2[i] then
Result := False;
end;
//for debugging TPAs, to help me perfect my finders
//by Wizzup?
Function DebugTPA(Points: TPointArray; BmpName: String): Boolean;
Var
Width, Height, ClientBMP, I, L: Integer;
xs, ys, xe, ye: Integer;
Begin
Try
Begin
xe := xs xor xs;
ye := ys xor ys;
xs := 1 shl 20;
ys := 1 shl 20;
For I := 0 To High(Points) Do
Begin
xs := Min(xs, Points[i].X);
ys := Min(ys, Points[i].Y);
xe := Max(xe, Points[i].X);
ye := Max(ye, Points[i].Y);
End;
Width := xe - xs;
Height := ye - ys;
DisplayDebugImgWindow(0, 0);
DisplayDebugImgWindow(Width, Height);
ClientBMP := BitmapFromString(Width, Height, '');
CopyClientToBitmap(ClientBMP, xs, ys, xe, ye);
For I := 0 To High(Points) Do
FastSetPixel(ClientBMP, Points[i].X - xs, Points[i].Y - ys, 255);
If BmpName <> '' Then
SaveBitmap(ClientBMP, ScriptPath + BmpName + '.bmp');
SafeDrawBitmap(ClientBMP, GetDebugCanvas, 0, 0);
DisplayDebugImgWindow(Width, Height);
FreeBitmap(ClientBMP);
End
Except
FreeBitmap(ClientBMP);
End;
Result := True;
End;
//Declaring players
Procedure DeclarePlayers;
begin
{$IFDEF Form}
SRLPlayerForm(True, [], [], [], []);
exit
{$ENDIF}
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name :='RMagician';
Players[0].Pass :='Th1sIsN0tMyPW!';
Players[0].Nick :='agi';
Players[0].Active := True;
end;
//Used for debugging and finding errors
Procedure RMDebug(s:string);
var name:string;
begin
if not UseDebug then exit;
try name := Players[CurrentPlayer].Name +' : '; except name:= '' end;
writeln(name+TheTime+' - '+s);
end;
//local control, F12 to activate and then text. used to check on proggies and
//to reactivate players
//untested with smart, might not work
{$IFDEF SMART}
procedure Proggy; forward;
Procedure EasyRC;
var i:integer;
begin
if not IsFKeyDown(12) then exit;
LogOut;
Proggy;
writeln('Fresh proggie on your right');
writeln('');
writeln('--- MENU ---');
writeln('F9 --> Status');
writeln('F10 --> Reset All');
writeln('F11 --> manage players');
writeln('F1 --> Keep on autoing');
writeln('--- End Menu --- ');
writeln('');
wait(2000);
repeat
if IsFKeyDown(9) then //status
begin
for i:=0 to High(players) do
writeln(IntToStr(i)+': '+Players[i].Nick+' - '+BoolToStr(Players[i].Active));
end;
if IsFKeyDown(10) then //Reset All
begin
for i:= 0 to High(Players) do
Players[i].Active := true;
writeln('Reset all :) ');
end;
if IsFKeyDown(11) then // Manage Players
begin
end;
if IsFKeyDown(1) then break;
until(false)
writeln('Restarting to auto :)');
LoginPlayer;
end;
{$ELSE}
//local control, F12 to activate and then text. used to check on proggies and
//to reactivate players
//untested with smart, might not work
Procedure EasyRC;
var
i, h1, h2, x, y:integer;
s, str: string;
begin
if not LoggedIn then exit;
if IsFKeyDown(12) then
begin
RMDebug('Trying to use Easy RC');
h1 := GetClientWindowHandle;
GetMousePos(x, y);
SetClientPos(False);
Disguise('RM Easy RC');
if FindWindowTitlePart('RM Easy RC', false) then writeln('Using Easy RC');
h2 := GetClientWindowHandle;
SetOnTop(h1, False);
SetOnTop(h2, True);
SetClientWindowHandle(h2);
wait(100);
ActivateClient;
wait(100);
repeat
s:= ReadLn('What to do?'+chr(13)+'Status / Reset N / Reset All / Proggy / Exit');
lowercase(s);
if (s = 'exit') or (s = '') then break;
if s= 'status' then
begin
for i:= 0 to High(Players) do
if not Players[i].Active then str:= str+chr(13)+Players[i].Name;
readln('these are set to false: '+chr(13)+str+chr(13)+'Press ok');
end;
if s = 'proggy' then
begin
Readln(ProggyStr+chr(13)+'Press ok');
end;
if Pos('reset', s) > 0 then
begin
str := TrimLetters(Trim(s));
if str = '' then
begin
for i:= 0 to High(Players) do
Players[i].Active:= True;
ReadLn('All Players Active'+chr(13)+'Press ok');
end else
try begin
i:= StrToInt(str);
Players[i].Active := True;
Readln('activated player: '+str+chr(13)+'Press ok');
end except break end;
end;
until(false)
SetOnTop(h2, False);
SetOnTop(h1, True);
SetClientWindowHandle(h1);
ActivateClient;
MMouse(x, y, 2, 2);
wait(3000);
Disguise(' A: '+IntToStr(PlayersActive)+'/'+IntToStr(Length(Players))+' Loads: '+IntToStr(loads));
RMDebug('Done using Easy RC');
end;
end;
{$ENDIF}
type
MyChat = record
Chatter: TStringArray;
Said: TStringArray;
LastResponded: integer;
end;
var
Trigger: Array of Array[0..1] of TStringArray; //questions, could make more triggers... if i
Answers: Array of TStringArray; //find i need them
RMTalks: MyChat;
Responses: Integer;
// to setup the questions qnd qnswers for the auto responder
procedure SetupRespond;
begin
SetLength(RMTalks.Chatter, 8);
SetLength(RMTalks.Said, 8);
SetLength(Trigger, 7); //how many questions
SetLength(Answers, Length(Trigger));
//you can have as many trigger words and rows as you want
//you can have as many answers as you want
Trigger[0][0]:= ['wc', 'woodcutting']; // trigger words 1
Trigger[0][1]:= ['lvl', 'level']; // trigger words 2
//Trigger[0][2]:= ['','','','','','']; // trigger words 3
Answers[0]:= [
'My Woodcutting Level is: '+IntToStr(Players[CurrentPlayer].Level[20]), //answer 1
'Wc: '+IntToStr(Players[CurrentPlayer].Level[20]), //answer 2
IntToStr(Players[CurrentPlayer].Level[20])+' wc lvl', //answer 3
'my wcing lvl is '+IntToStr(Players[CurrentPlayer].Level[20]) //answer 4
]
Trigger[1][0] := ['axe'];
Trigger[1][1] := ['which', 'what'];
Answers[1] := [
'I''m using a '+Players[CurrentPlayer].Strings[2]+' axe',
Players[CurrentPlayer].Strings[2],
'my axe is made out of '+Players[CurrentPlayer].Strings[2]
]
Trigger[2][0]:= ['good place', 'train'];
Trigger[2][1]:= ['woodcutting', 'wc'];
Answers[2] := [
'Try Training Woodcutting at Draynor',
'Draynor', 'Varrock', 'Edgy', 'Fally',
'Try Training Woodcutting at Edgeville',
'Try Training Woodcutting at Varrock Palace',
'Try Training Woodcutting at South of Falador'
]
Trigger[3][0]:= ['fish', 'fishing', '><>', '<><']; // trigger words 1
Trigger[3][1]:= ['lvl', 'level', 'levl', 'lvel']; // trigger words 2
//Trigger[3][2]:= ['','','','','','']; // trigger words 3
Answers[3]:= [
'My Fishing Level is: '+IntToStr(Players[CurrentPlayer].Level[17]), //answer 1
'Fishing: '+IntToStr(Players[CurrentPlayer].Level[17]), //answer 2
IntToStr(Players[CurrentPlayer].Level[17])+' '+chr(62)+chr(60)+chr(62)+' lvl', //answer 3
'my fishy lvl is '+IntToStr(Players[CurrentPlayer].Level[17]) //answer 4
]
Trigger[5][0]:= ['place', 'train'];
Trigger[5][1]:= ['fishing', '><>', 'fish'];
Answers[5] := [
'Try Training fishing at Draynor',
'Draynor', 'Edgy', 'Al-Kharid', 'Karamja',
'Try Training fishing at Edgeville',
'Try Training fishing at Al-Kharid, close to bank',
'Try Training fishing at lumbridge'
]
Trigger[6][0]:= ['hi','hey', 'hello', 'sup?']; // trigger words 1
Trigger[6][1]:= ['']; // trigger words 2
Answers[6]:= ['hi','hey', 'hello', 'sup?', 'how do you do?'] ;
end;
//from srl, modded for any line
function GetChatTextLine(var chat: string; line:integer): Boolean;
var
x, y: Integer;
textP: TPoint;
begin
if not LoggedIn then exit;
textP := TextCoords(line);
if findcolor(x, y, 16711680, textp.x, textp.y, textp.x + 200, textp.y + 14) then
begin
chat := LowerCase(Trim(GetTextAtEx(x - 3, textp.y - 2, 0, SmallChars, False,
False, -1, 1, 16711680, 60, False, tr_allChars)));
Result := True;
end;
end;
//from srl, modded for any line
function GetChatterLine(var name: string; line:integer): Boolean;
var
i: Integer;
textP: TPoint;
begin
if not LoggedIn then exit;
textP := TextCoords(line);
name := LowerCase(Trim(GetTextAtEx(textP.x - 2, textP.y - 2, 0, SmallChars, False, False, 0, 1,
0, 60, False, tr_allChars)))
i := Pos(':', name)
if (i <> 0) then
begin
Delete(name, i, i);
Result := True;
end;
end;
//my responder, used as antiban to look more human
procedure RMRespond;
var
str: string;
i, h, t, k, triggered:integer;
TSA:TStringArray;
begin
if not LoggedIn then exit;
if (TimeFromMark(RMTalks.LastResponded) < 60000+Random(30000)) then exit;
SetLength(TSA, 8)
str:='';
TSA:=['', '', '', '', '', '', '', ''];
RMTalks.said := ['', '', '', '', '', '', '', ''];
triggered := 0;
// Getting text on all the lines
for i:= 7 DownTo 0 do
begin
GetChatterLine(RMTalks.Chatter[i], i+1);
if Pos(Lowercase(Players[CurrentPlayer].Nick), Lowercase(RMTalks.Chatter[i])) > 0 then
break; //if we already answered, it means we already checked further up.
GetChatTextLine(RMTalks.said[i], i+1);
TSA[i] := RMTalks.said[i];
end;
for i:=High(TSA) DownTo 0 do //all text lines
for h:= 0 to High(Trigger) do //questions
begin
triggered:= 0;
for t:=0 to High(Trigger[h]) do //How many triggers
for k:=0 to High(Trigger[h][t]) do //specific trigger
if Pos(Trigger[h][t][k], TSA[i]) > 0 then
begin
Inc(triggered);
if triggered >= 2 then
begin
Inc(Responses);
str:=(Answers[h][Random(Length(Answers[h]))]);
TypeSend(AddMistakes(str, RandomRange(10, 30)));
RMDebug('Question: '+Trigger[h][0][0]+ ' ' + Trigger[h][t][k]);
RMDebug('Responding: ' + str);
str := '';
MarkTime(RMTalks.LastResponded);
triggered := 0;
SetupRespond;
exit;
end; //end if
break;
end; //end if
//end k loop
end; //end h loop
//end of i loop
end;
//making sure we solve those annoying randoms :)
Function NoRandoms: boolean;
var
x, y:integer;
s:string;
begin
if not LoggedIn then exit;
Result := False;
GetMousePos(x, y);
if UseResponder then RMRespond;
if ClickToContinue then
begin
MMouse(x, y, 3, 3);
Result := True;
end;
if FindNormalRandoms then Result:=true;
if FindFight then
begin
//none of the run aways check for randoms....
case random(4) of
0: s:='n';
1: s:='w';
2: s:='s';
3: s:='e';
end;
RMDebug('running to ' + s + ' and waiting for 8 - 10 s');
RunTo(s, True);
SleepAndMoveMouse(RandomRange(8000, 10000));
case s of
'n': s:= 'S';
's': s:= 'N';
'w': s:= 'E';
'e': s:= 'W';
end;
RMDebug('Returning to ' + s);
RunTo(s, True);
Result:=True;
NoRandoms;
end;
EasyRc;
end;
//Progress report
procedure Proggy;
var
JX2, i, i2, xph:integer;
str: string;
begin
ClearReport;
SRLRandomsReport;
AddToReport('');
AddToReport('[====== '+Padr(ScriptName+' '+Version, 27)+' ======]');
AddToReport('[ By Rasta Magician ]');
AddToReport('[=========================================]');
AddToReport('[ ' + Padr('Written ' + (TheTime) + ' on ' + (TheDate(3)) + '.', 40) + ']')
AddToReport('[ '+ Padr(TimeRunning, 40)+']');
AddToReport('[ ' + Padr('Players: ' + IntToStr(PlayersActive)+ ' / ' + IntToStr(HowManyPlayers), 40) + ']');
AddToReport('[ ' + Padr('Current Player: ' + Players[CurrentPlayer].Nick, 40) + ']');
AddToReport('[ '+ Padr('Loads: '+IntToStr(Loads), 40)+']');
AddToReport('[ '+ Padr('Clay Mined: '+IntToStr(ClayMined), 40)+']');
AddToReport('[ '+ Padr('Mining XP: '+IntToStr(ClayMined*5), 40)+']');
AddToReport('[ '+ Padr('=== CRAFTING XP ===', 40)+']');
xph := Round((ClayMined*40*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Lids: '+IntToStr(xph)+' xp/h', 40)+']');
xph := Round((ClayMined*37.5*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Plant Pots: '+IntToStr(xph)+' xp/h', 40)+']');
xph := Round((ClayMined*33*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Bowls: '+IntToStr(xph)+' xp/h', 40)+']');
xph := Round((ClayMined*25*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Dishes: '+IntToStr(xph)+' xp/h', 40)+']');
xph := Round((ClayMined*12.6*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Pots: '+IntToStr(xph)+' xp/h', 40)+']');
AddToReport('[ '+ Padr('=== CRAFTING XP ===', 40)+']')
AddToReport('[ '+Padr('Rested: '+IntToStr(Rested), 40)+']');
AddToReport('[================== RM ===================]');
ProggyStr := '';
ProggyStr := ProggyStr + chr(13) + ('[====== '+Padr(ScriptName+' '+Version, 27)+' ======]');
ProggyStr := ProggyStr + chr(13) + ('[ By Rasta Magician ]');
ProggyStr := ProggyStr + chr(13) + ('[=========================================]');
ProggyStr := ProggyStr + chr(13) + ('[ ' + Padr('Written ' + (TheTime) + ' on ' + (TheDate(3)) + '.', 40) + ']');
ProggyStr := ProggyStr + chr(13) + ('[ '+ Padr(TimeRunning, 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[ ' + Padr('Players: ' + IntToStr(PlayersActive)+ ' / ' + IntToStr(HowManyPlayers), 40) + ']');
ProggyStr := ProggyStr + chr(13) + ('[ '+ Padr('Loads: '+IntToStr(Loads), 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[ '+ Padr('Clay Mined: '+IntToStr(ClayMined), 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[ '+Padr('Rested: '+IntToStr(Rested), 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[================== RM ===================]');
AddToReport('[ P | A | L | Mins | Rand ' + Padl(']', 13));
AddToReport('[-----------------------------------------]');
ProggyStr := ProggyStr + chr(13) + ('[ P | A | L | Mins | Rand ' + Padl(']', 13));
ProggyStr := ProggyStr + chr(13) + ('[-----------------------------------------]');
for i:= 0 to HowManyPlayers - 1 do
begin
str := '[ ' + Padr(Players[i].Nick, 4) + ' | ';
if Players[i].Active then
str := str + 'T | '
else
str := str + 'F | ';
str := str + Padr(IntToStr(Players[i].Banked), 2) + ' | ' + Padr(IntToStr(Players[i].Worked), 5) +'| ';
str := str + Padr(Players[i].Rand, 16) + ' ]';
AddToReport(str);
ProggyStr := ProggyStr + chr(13) + str;
end;
str := ScriptName+' '+Version
i := length(str);
if (i mod 2) <> 0 then
i2 := 1;
AddToReport('[-----------------------------------------]');
AddToReport('[====== '+Padl('', 14 - Trunc(i/2)) + str + Padr('', 13 + i2 - Trunc(i/2))+' ======]');
AddToReport('[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]');
ProggyStr := ProggyStr + chr(13) + ('[-----------------------------------------]');
ProggyStr := ProggyStr + chr(13) + ('[====== '+Padl('', 14 - Trunc(i/2)) + str + Padr('', 13 + i2 - Trunc(i/2))+' ======]');
ProggyStr := ProggyStr + chr(13) + ('[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]');
if SaveProggyToFile then
begin
JX2 := ReWriteFile((ScriptPath + ScriptName +' '+ Version + '.txt'), False);
WriteFileString(JX2, ProggyStr);
CloseFile(JX2);
RMDebug('Progress report saved to: ' + ScriptPath + ScriptName + ' ' + Version + '.txt');
end;
Disguise(' A: '+IntToStr(PlayersActive) + '/' + IntToStr(HowManyPlayers) +
' Loads: ' + IntToStr(Loads));
end;
//Antiban, basically just picks up the mouse, increases mouse speed
//clicks a tab and resets everything back to the original.
//just to make sure we stay logged in.
procedure FastSwitchTabs;
var x, y, i, h:integer;
begin
if not LoggedIn then exit;
RMDebug('Inactive Move');
GetMousePos(x, y);
PickUpMouse;
IncEx(MouseSpeed, 10);
i := GetCurrentTab;
repeat
h := 1+Random(12);
until(h <> i)
GameTab(h);
wait(500+Random(500));
GameTab(i);
MMouse(x, y, 3, 3);
DecEx(MouseSpeed, 10);
end;
//will take "Time" + Random(1000) to complete the action, will return to original angle
// By Rasta Magician, heavily based on RandomMovement by Krazy_Meerkat
// will always move the compass around unlike in RandomMovement
procedure CompassMove(Time:Integer);
var
Keys: array of Integer;
I: Integer;
Deg: Extended;
begin
if not LoggedIn then exit;
Keys := [VK_RIGHT, VK_LEFT];
I := Random(2);
ActivateClient;
Deg := rs_GetCompassAngleDegrees;
Wait(100 + random(50));
KeyDown(Keys[I]);
Wait(Round(Time/2) + random(500));
KeyUp(Keys[I]);
Wait(Round(Time/2) + random(500));
MakeCompass(FloatToStr(Deg));
end;
//Random Right Click Return by Rasta Magician,
//Will right-click anywhere on he main map, choose "Cancel" and return the
//mouse to it's original position
procedure RRClickReturn;
var x, y:integer;
begin
if not LoggedIn then exit;
IncEx(MouseSpeed, 7);
GetMousePos(x, y);
ActivateClient;
Mouse(MSX1, MSY1, MSX2, MSY2, False);
wait(100 + Random(50));
ChooseOption('ancel');
wait(50 + Random(100));
MMouse(x, y, 3, 3);
DecEx(MouseSpeed, 7);
end;
//just antiban with a percentage
Procedure AntiBan(percentage: integer);
var p: integer;
begin
if not Loggedin then exit;
if random(100) <= percentage then
begin
case random(14) of
0, 1: FastSwitchTabs;
2, 3: CompassMove(1000);
4, 5: RRClickReturn;
6, 7: SleepAndMoveMouse(2000);
8, 9: HoverSkill('random', false);
//10, 11: DoEmote(Random(37)+1);
12, 13: PickUpMouse;
end;
Gametab(4);
end;
end;
{$IFDEF SMART}
Procedure SetupSmart(world: integer);
begin
SmartSetupEx(world, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
end;
{$ENDIF}
//Used to set up all the necessary things before the script starts running
Procedure SetupScript;
begin
ClearDebug;
Disguise(ScriptName + ' ' + Version);
{$IFDEF SMART}
SetupSmart(100);
{$IFDEF Reflection}
RMDebug('Checking hooks, if they''re outdated un-define reflection to run this');
SetupReflection;
{$ENDIF}
{$ENDIF}
SetupSRL;
DeclarePlayers;
if UseResponder then SetupRespond;
SRLID := YourSRLID;
SRLPassword := YourSRLPass;
ScriptID := MyScriptID;
ActivateClient;
LoginPlayer;
end;
//for prepqring the playe and making sure he has all the requirements
procedure SetupPlayer;
begin
if not LoggedIn then exit;
SetGraphics(4, 'current', 'always', 'off', 'low', 'few', 'off', 'few', 'off');
CloseWindow;
MarkTime(Worked);
GameTab(4);
wait(500);
JugCount := CountItems(JugDTM, 'dtm', []);
RMDebug('Player has '+IntToStr(JugCount)+' jugs');
SetAngle(true);
end;
//switching palyers, or in case of jsut one player making it rest
// "not playing" for a while decreases the chance of getting a lot of randoms
procedure SwitchPlayers;
var Time: integer;
begin
if (TimeFromMark(Worked) >= (WorkTime + Random(3*60*1000)) )or(not LoggedIn) then
begin
if PlayersActive > 1 then
NextPlayer(Players[CurrentPlayer].Active)
else begin
if not LoggedIn then TerminateScript;
LogOut;
RMDebug('resting....');
Time := GetSystemTime;
while (GetSystemTime - Time < RestTime) do
Disguise('Rest: '+IntToStr(Round((RestTime - (GetSystemTime - Time))/1000))+' s');
Disguise(' A: '+IntToStr(PlayersActive) + '/' + IntToStr(HowManyPlayers) +
' Loads: ' + IntToStr(Loads));
ActivateClient;
LoginPlayer;
Inc(Rested);
MarkTime(Worked);
end;
SetupPlayer;
end;
end;
procedure LoadDTMS;
begin
ClayDTM := DTMFromString('78DA6374626260E066644006D31BC218FE036' +
'990E87F206004A96146550391859140DA03A8868D801A2FA01A4E' +
'026A40760910506389E9660C353640351CF8D50000D181089F');
SoftDTM := DTMFromString('78DA63B4676260E060644006B9417C0CFF813' +
'448F43F10303A01D5FC6740038C4824900E00AA6163C4AFC605A8' +
'4698801A33A01A3E026A2C816A5808A8F106AAE125A0C69AB07B0' +
'05BEC0953');
JugDTM := DTMFromString('78DA637462626078C68002DA6A6B184480342' +
'310FF0702465BA09AEB0C6880918115AA06CCF304AAB949408D37' +
'50CD3D026ABC806ADE1150630754F391801A4BA09AA744B8F93DA' +
'61A0674735E1350630154F39C801A1BEC7E4751E38C3D9C51D4F8' +
'03D53C2242CD1322ECFA44408D37613703001F0C187A');
WJugDTM := DTMFromString('78DA63CC656260B8CB80024ACBCF31F003694' +
'620FE0F048CE94035D719D00023032B540D985784690E869A72A0' +
'9AD704D46403D57C22A02609A8E60501352037DFC7AF060021030' +
'F2C');
end;
procedure FreeDTMS;
begin
FreeDTM(ClayDTM);
FreeDTM(SoftDTM);
FreeDTM(JugDTM);
FreeDTM(WJugDTM);
end;
//Just a few things it does when the script ends.
procedure ScriptTerminate;
begin
Proggy;
FreeDTMS;
writeln('');
writeln('Thank for using my script, Rasta Magician');
writeln('Script stopped at ' + TheTime + ' ' + TheDate(3));
writeln('Please post the Progress Report');
end;
function AutoColorOven: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
//try begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.60, 8.58);
if not (FindColorsTolerance(arP, 661291, MMX1, MMY1, MMX2, MMY2, 6)) 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
if (rs_OnMinimap(arP[i].x, arP[i].y)) 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 except end;
end;
function AutoColorOven2: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
//try begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.13, 1.16);
if not (FindColorsTolerance(arP, 1126745, MMX1, MMY1, MMX2, MMY2, 4)) 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
if (rs_OnMinimap(arP[i].x, arP[i].y)) 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 except end;
end;
function AutoColorPick: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
// try begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.38, 1.13);
if not (FindColorsTolerance(arP, 2903683, MMX1, MMY1, MMX2, MMY2, 6)) then
begin
Writeln('Failed to find the color, no result. - pick');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
if (rs_OnMinimap(arP[i].x, arP[i].y)) 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. - pick');
// end except end;
end;
function AutoColorWaterSymbol: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
// try begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.32);
if not (FindColorsTolerance(arP, 15549204, MMX1, MMY1, MMX2, MMY2, 10)) then
begin
Writeln('Failed to find the color, no result. - Water');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
if (rs_OnMinimap(arP[i].x, arP[i].y)) 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. - water');
// end except end;
end;
procedure DoTheColors;
var x, y: integer;
begin
{
PickColor := AutoColorPick;
LadderColor := FindLadderColor;
OvenColor := AutoColorOven;
if OvenColor = 0 then
OvenColor := AutoColorOven2;
if LadderColor = 0 then
LadderColor := AutoColorWaterSymbol;
}
end;
Function Relocate(place: string): boolean;
var
ATPA: T2DPointArray;
TPA : TPointArray;
TP: TPoint;
Color: boolean;
Str: string;
begin
if GetMMLevels('run', str) >= 25 then
SetRun(true);
Color := True;
{$IFDEF Reflection}
RMDebug('[REF] Relocating.. '+place);
Color := False;
RMDebug('before case');
case lowercase(place) of
'mine': if not WalkToTile(Point(2939, 3282), 1, 2) then Color := true;
'water': if not WalkToTile(Point(2933, 3280), 1, 2) then Color := true;
'wheel': if not WalkToTile(Point(2936, 3288), 1, 2) then Color := true;
'oven': if not WalkToTile(Point(2930, 3290), 1, 2) then Color := true;
end;
RMDebug('aafter case');
if Color then
RMDebug('reflection failed, trying color')
else begin
RMDebug('At '+place);
Result := true;
wait(750+random(500));
exit;
end;
{$ENDIF}
Result := true;
RMDebug('Relocating.. '+place);
case lowercase(place) of
'mine':
begin
if PickColor = 0 then
begin
PickColor := AutoColorPick;
if PickColor = 0 then
begin
LogOut;
Players[CurrentPlayer].Rand := 'AC Fail';
exit;
end;
end;
if FindColorsTolerance(TPA, PickColor, MMX1, MMY1, MMX2, MMY2, 0) then
begin
ATPA := SplitTPA(TPA, 1);
SortATPAFrom(ATPA, IntToPoint(MMX2, MMY2));
SortTPAFrom(ATPA[0], IntToPoint(MMX2, MMY2));
TP := ATPA[0][0];
Mouse(TP.x, TP.y + 8, 3, 3, true);
end else Result := false;
end;
'water':
begin
if LadderColor = 0 then
begin
LadderColor := FindLadderColor;
if LadderColor = 0 then
LadderColor := AutoColorWaterSymbol;
if LadderColor = 0 then
begin
LogOut;
Players[CurrentPlayer].Rand := 'AC Fail';
exit;
end;
end;
if FindColorsTolerance(TPA, LadderColor, MMX1, MMY1, MMX2, MMY2, 0) then
begin
ATPA := SplitTPA(TPA, 2);
SortATPASize(ATPA, true);
TP := MiddleTPA(ATPA[0]);
Mouse(TP.x, TP.y, 3, 3, true);
end else Result := false;
end;
'wheel':
begin
if OvenColor = 0 then
begin
OvenColor := AutoColorOven;
if OvenColor = 0 then
OvenColor := AutoColorOven2;
if OvenColor = 0 then
begin
LogOut;
Players[CurrentPlayer].Rand := 'AC Fail';
exit;
end;
end;
if FindColorsTolerance(TPA, OvenColor, MMX1, MMY1, MMX2, MMY2, 0) then
begin
ATPA := SplitTPA(TPA, 2);
SortATPAFrom(ATPA, IntToPoint(MMX2, MMY1));
SortTPAFrom(ATPA[0], IntToPoint(MMX2, MMY1));
TP := ATPA[0][0];
Mouse(TP.x, TP.y, 3, 3, true);
end else Result := false;
end;
'oven':
begin
if OvenColor = 0 then
begin
OvenColor := AutoColorOven;
if OvenColor = 0 then
OvenColor := AutoColorOven2;
if OvenColor = 0 then
begin
LogOut;
Players[CurrentPlayer].Rand := 'AC Fail';
exit;
end;
end;
if FindColorsTolerance(TPA, OvenColor, MMX1, MMY1, MMX2, MMY2, 0) then
begin
SortTPAFrom(TPA, IntToPoint(MMX1, MMCY));
TP := TPA[0];
Mouse(TP.x, TP.y, 3, 3, true);
end else Result := false;
end;
end;
if not Result then
begin
RMDebug('failed at relocating to ' + place);
exit;
end;
FFlag(0);
wait(1000+Random(750));
// RMDebug('Arrived at destination. We hope to see you again soon, with RM Airways');
end;
function FindIt(var fx, fy: Integer; CTS, Color, Tol, H, W:integer; SCS2M1, SCS2M2:extended; text:TStringArray): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(SCS2M1, SCS2M2);
if not(FindColorsTolerance(arP, Color, MSX1, MSY1, MSX2, MSY2, Tol)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, H, W);
arL := High(ararP);
for i := 0 to arL do
begin
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 0, 0);
Wait(350);
if IsUpTextMultiCustom(text) 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 Find(s: string): boolean;
var x, y:integer;
begin
case lowercase(s) of
'clay': Result := FindIt(x, y, 2, 7250880, 9, 10, 10, 0.03, 1.24, ['ine', 'ock']);
'water': Result := FindIt(x, y, 1, 11172192, 10, 5, 5, 0.2, 0.2, ['ink']);
'wheel': Result := FindIt(x, y, 2, 8290185, 2, 20, 20, 0.08, 0.25, ['otter''s', 'heel']);
'oven': Result := FindIt(x, y, 4, 660057, 4, 5, 5, 0.06, 0.40, ['ven']);
end;
if Result then
Mouse(x, y, 0, 0, true);
RMDebug('Looking for '+s+'... Found? '+BoolToStr(Result));
end;
Procedure MineIt;
var x, y, t, tries:integer;
begin
if not LoggedIn then exit;
if InvFull then exit;
if not Relocate('mine') then exit;
MarkTime(t);
repeat
if not LoggedIn then break;
{
if FindDTM(GemDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
DropItem(CoordsToItem(x, y));
wait(200+Random(100));
Inc(ReportVars[2]);
end;
}
if InvFull then break;
if Find('clay') then
begin
Tries := 0;
x := GetSystemTime;
repeat
wait(100);
FindNormalRandoms;
if GetSystemTime - x >= 5000 then break;
until(FindBlackChatMessage('swing your'))
if GetSystemTime - x >= 5000 then Continue;
x := GetSystemTime;
repeat
wait(100);
FindNormalRandoms;
if GetSystemTime - x >= 5000 then break;
until(FindBlackChatMessage('manage to mine'))
end else Inc(Tries);
if Tries >= 5 then
if not Relocate('mine') then
break;
until(InvFull)or(TimeFromMark(t) >= (60*5000))
ClayCount := CountItems(ClayDTM, 'dtm', []);
ClayMined := ClayMined + ClayCount;
ReportVars[1] := ClayCount;
IncEx(Players[CurrentPlayer].Integers[0], ClayCount);
end;
Procedure SoftenClay;
var x, y, WaterCount, ClayCount, i, Time:integer;
begin
if not LoggedIn then exit;
if not InvFull then exit;
Gametab(4);
ClayCount := CountItems(ClayDTM, 'dtm', []);
if ClayCount <= 0 then exit;
JugCount := CountItems(JugDTM, 'dtm', []);
RMDebug('2 - Player has '+IntToStr(JugCount)+' jugs');
if JugCount <= 0 then
begin
RMDebug('Player has no jugs!');
Players[CurrentPlayer].active := false;
LogOut;
exit;
end;
Time := GetSystemTime;
if not Relocate('water') then exit;
repeat
if not LoggedIn then break;
if not FindDTM(ClayDTM, x, y, MIX1, MIY1, MIX2, MIY2) then break;
if FindDTM(JugDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 3, 3, true);
wait(350+Random(500));
if Find('water')then
begin
FFlag(0);
Wait(355*JugCount+500+Random(500));
WaterCount := CountItems(WJugDTM, 'dtm', []);
RMDebug(IntToStr(WaterCount)+' jugs are filled with water');
if not WaterCount = JugCount then
begin
for i:= 0 to 5 do
begin
wait(500);
WaterCount := CountItems(WJugDTM, 'dtm', []);
if WaterCount = JugCount then break;
end;
if not WaterCount = JugCount then
begin
RMDebug('something wrong with filling the jugs...');
Continue;
end;
end;
ClayCount := CountItems(ClayDTM, 'dtm', []);
RMDebug('Player has '+IntToStr(ClayCount)+' clay');
Mouse(x, y, 3, 3, true); //clicking jug again
if FindDTM(ClayDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 3, 3, true);
wait(200+random(100));
MMouse(247, 406, 18, 15);
for i:= 0 to 9 do
begin
wait(100);
if GetColor(254, 412) = 938605 then break;
end;
GetMousePos(x,y);
Mouse(x, y, 0, 0, false);
wait(250);
if not ChooseOption('All') then
begin
RMDebug('problem choosing option');
Continue;
end;
wait(1000+ 750*WaterCount + Random(500));
if not CountItems(ClayDTM, 'dtm', []) = (ClayCount - WaterCount) then
if not CountItems(ClayDTM, 'dtm', []) = 0 then
begin
for i:= 0 to 5 do
begin
wait(500);
if CountItems(ClayDTM, 'dtm', []) = 0 then
exit;
if CountItems(ClayDTM, 'dtm', []) = (ClayCount - WaterCount) then
break;
end;
end else break;
if not CountItems(ClayDTM, 'dtm', []) = (ClayCount - WaterCount) then
if not CountItems(ClayDTM, 'dtm', []) = 0 then
begin
RMDebug('Problem softening the clay....');
Continue;
end;
end;
end else begin
RMDebug('Couldn''t find the water');
if not Relocate('water') then break;
Continue;
end;
end else begin
RMDebug('found no jug');
LogOut;
Players[CurrentPlayer].Active := false;
exit;
end;
until(GetSystemTime - Time >= 60*5000)
end;
Procedure MoldClay;
var
x, y, i, SoftCount, Time:integer;
TPA: TPointArray;
TP: TPoint;
CFound: boolean;
begin
if not LoggedIn Then exit;
if not InvFull then exit;
if FindDTM(ClayDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
exit;
SoftCount := CountItems(SoftDTM, 'dtm', []);
if SoftCount <= 0 then exit;
if not Relocate('wheel') then exit;
if IsMember then
TP := IntToPoint(MCX2, MCY2)
else
TP := IntToPoint(314, 448);
repeat
if not LoggedIn then break;
CFound := false;
Gametab(4);
if FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 3, 3, true);
if Find('wheel') then
begin
FFlag(0);
for i:= 0 to 9 do
begin
wait(200);
if FindColor(x, y, 128, 229, 350, 239, 360) then //won't break as often as getcolor
begin
CFound := true;
break;
end;
end;
if not CFound then continue;
if FindColorsTolerance(TPA, 0, 61, 439, 467, 457, 0) then
begin
SortTPAFrom(TPA, TP);
Mouse(TPA[0].x, TPA[0].y - 50, 3, 3, false);
wait(750);
if not ChooseOption('ake X') then
begin
RMDebug('Problems choosing X');
Continue;
end else begin
wait(350+Random(250));
TypeSend(IntToStr(RandomRange(28, 99)));
i := GetSystemTime;
repeat
wait(250);
Antiban(RandomRange(2,4));
if not FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
break;
until((GetSystemTime - i) >= 750*SoftCount)
i := GetSystemTime;
repeat
wait(100);
Antiban(RandomRange(2,5));
if not FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
break;
until((GetSystemTime - i) >= 30000)
if FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
RMDebug('Something went wrong with moudling');
Continue;
end;
end;
end;
end;
end else begin
RMDebug('could not find soft clay');
break;
end;
SoftCount := CountItems(SoftDTM, 'dtm', []);
if SoftCount <= 0 then break;
if not Relocate('wheel') then break;
until (false);
end;
Procedure FireClay;
var
i, x, y, Time, TimeIt: integer;
TPA, CTPA: TPointArray;
TIA: TIntegerArray;
TB: TBox;
TP: TPoint;
CFound: boolean;
begin
if not LoggedIn Then exit;
if not InvFull then exit;
if FindDTM(ClayDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
exit;
if FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
exit;
if not Relocate('oven') then exit;
if IsMember then
TP := IntToPoint(MCX2, MCY2)
else
TP := IntToPoint(314, 448);
Gametab(4);
Time := GetSystemTime;
repeat
if not LoggedIn then break;
CFound := false;
for i:= 28 Downto 1 do
begin
TB := InvBox(i);
if not FindDTM(JugDTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
begin
SetLength(CTPA, 6);
CTPA[0] := Point(TB.x1 + 20, TB.y1 + 5);
CTPA[1] := Point(TB.x1 + 20, TB.y1 + 10);
CTPA[2] := Point(TB.x1 + 20, TB.y1 + 15);
CTPA[3] := Point(TB.x1 + 20, TB.y1 + 20);
CTPA[4] := Point(TB.x1 + 20, TB.y1 + 25);
CTPA[5] := Point(TB.x1 + 20, TB.y1 + 30);
TIA := GetColors(CTPA);
end;
end;
if Find('oven') then
begin
FFlag(0);
for i:= 0 to 9 do
begin
wait(200);
if FindColor(x, y, 128, 229, 350, 239, 360) then //won't break as often as getcolor
begin
CFound := true;
break;
end;
end;
if not CFound then continue;
if FindColorsTolerance(TPA, 0, 61, 438, 467, 457, 0) then
begin
SortTPAFrom(TPA, TP);
Mouse(TPA[0].x, TPA[0].y - 50, 3, 3, false);
wait(100);
if not ChooseOption('ake X') then
begin
RMDebug('Problems choosing X');
Continue;
end else begin
wait(350+Random(250));
TypeSend(IntToStr(RandomRange(28, 99)));
wait(1000);
TimeIt := GetSystemTime;
repeat
wait(250);
if FindNPCChatText('t have any', Nothing) then
break;
if IsChatBoxTextAnyLine('have any more', 0) then
break;
if random(100) <= 5 then CompassMove(1000);
NoRandoms;
until(GetSystemTime - TimeIt >= (4000*26))
if not IsChatBoxTextAnyLine('have any more', 0) then
if not FindNPCChatText('t have any', Nothing) then
Continue;
RMDebug('done waiting for fired stuff');
for x := 0 to 9 do
begin
if not IsSameIntArray(TIA, GetColors(CTPA)) then
break;
wait(750);
end;
RMDebug('all is done, dropping now');
for i:= 1 to 28 do
begin
if i mod 3 = 0 then
NoRandoms;
TB := InvBox(i);
if not FindDTM(JugDTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
begin
DropItem(i);
wait(200+Random(150));
end;
end;
Inc(Loads);
Inc(Players[CurrentPlayer].Banked);
Inc(ReportVars[0]);
RMDebug('done dropping');
break;
end;
end else begin
RMDebug('Could not find the text color....');
Continue;
end;
end else begin
RMDebug('Problems Finding the Oven');
if not Relocate('oven') then break;
Continue;
end;
if GetSystemTime - Time >= 60000 then
break;
until(false)
end;
begin
SetupScript;
SetupPlayer;
DoTheColors;
LoadDTMS;
repeat
if not LoggedIn then break;
MineIt;
SoftenClay;
MoldClay;
FireClay;
Proggy;
SwitchPlayers;
until(false)
end.{==============================================================================]
[==============================================================================]
[ RM Power Crafter ]
[ By: Rasta Magician ]
[==============================================================================]
[ Features ]
[==============================================================================]
[ 1. Debug ]
[ 2. AntiRandoms ]
[ 3. AntiBan ]
[ 4. Multiplayer ]
[ 5. Resting ]
[ 6. Progress Report ]
[ 7. Local Control ]
[ 8. Responder ]
[ 9. Proggy To File ]
[ 10. Smart Cycleing ]
[==============================================================================]
[ Description ]
[==============================================================================]
[ Mines clay, softens it, molds it into bowls(f2p), ]
[ plant pots or pot lids (with needed quest), then fires the clay, drops it ]
[ and repeats the whole thing. All of this happens inside the Crafting Guild ]
[ ]
[==============================================================================]
[ How To Use ]
[==============================================================================]
[ 0. You need level 40 crafting ]
[ 1. Wield a pick ]
[ 2. Wear a brown appron ]
[ 3. Have jugs in inventory (I suggest 4 jugs) ]
[ ]
[==============================================================================]
[ Credits ]
[==============================================================================]
[ SRL Team ]
[ Ed, thx for testing ]
[==============================================================================]
[ RM Power Crafter by Rasta Magician ]
[==============================================================================]
[==============================================================================}
{
add one more text for moulding clay
mold and fire menu colors changed place
}
program RMScript;
{$DEFINE SMART }
{$DEFINE Reflection}
//{$DEFINE FORM }
{$IFDEF SMART }
{.include srl/srl/misc/Smart.scar}
{$ENDIF}
{.include srl/srl.scar}
{$IFDEF Reflection}
{.include SRL\SRL\Reflection\Reflection.scar}
{$ENDIF}
{.include srl/srl/skill/mining.scar}
{$IFDEF FORM }
{.include srl/srl/misc/users.scar}
{$ENDIF}
Const
WorkTime = (30*60*1000); //10 mins
RestTime = (3*60*1000); //3 mins
IsMember = true;
UseDebug = True;
UseResponder = True;
SaveProggyToFile = True;
ScriptName = 'RM Power Crafter';
Version = '2.0';
YourSRLID = ''; //your SRLID
YourSRLPass = ''; //your SRL Stats pass
MyScriptID = '1199'; // don't touch
var
Rested, Worked, Loads,
PickColor, LadderColor, OvenColor,
ClayDTM, SoftDTM, JugDTM, WJugDTM, GemDTM,
JugCount, ClayCount,
ClayMined :integer;
ProggyStr: string;
function IsSameIntArray(i1, i2:TIntegerArray):boolean;
var i:integer;
begin
Result := false;
if Length(i1) <> Length(i2) then exit;
Result := true;
for i:= 0 to high(i1) do
if i1[i] <> i2[i] then
Result := False;
end;
//for debugging TPAs, to help me perfect my finders
//by Wizzup?
Function DebugTPA(Points: TPointArray; BmpName: String): Boolean;
Var
Width, Height, ClientBMP, I, L: Integer;
xs, ys, xe, ye: Integer;
Begin
Try
Begin
xe := xs xor xs;
ye := ys xor ys;
xs := 1 shl 20;
ys := 1 shl 20;
For I := 0 To High(Points) Do
Begin
xs := Min(xs, Points[i].X);
ys := Min(ys, Points[i].Y);
xe := Max(xe, Points[i].X);
ye := Max(ye, Points[i].Y);
End;
Width := xe - xs;
Height := ye - ys;
DisplayDebugImgWindow(0, 0);
DisplayDebugImgWindow(Width, Height);
ClientBMP := BitmapFromString(Width, Height, '');
CopyClientToBitmap(ClientBMP, xs, ys, xe, ye);
For I := 0 To High(Points) Do
FastSetPixel(ClientBMP, Points[i].X - xs, Points[i].Y - ys, 255);
If BmpName <> '' Then
SaveBitmap(ClientBMP, ScriptPath + BmpName + '.bmp');
SafeDrawBitmap(ClientBMP, GetDebugCanvas, 0, 0);
DisplayDebugImgWindow(Width, Height);
FreeBitmap(ClientBMP);
End
Except
FreeBitmap(ClientBMP);
End;
Result := True;
End;
//Declaring players
Procedure DeclarePlayers;
begin
{$IFDEF Form}
SRLPlayerForm(True, [], [], [], []);
exit
{$ENDIF}
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name :='RMagician';
Players[0].Pass :='Th1sIsN0tMyPW!';
Players[0].Nick :='agi';
Players[0].Active := True;
end;
//Used for debugging and finding errors
Procedure RMDebug(s:string);
var name:string;
begin
if not UseDebug then exit;
try name := Players[CurrentPlayer].Name +' : '; except name:= '' end;
writeln(name+TheTime+' - '+s);
end;
//local control, F12 to activate and then text. used to check on proggies and
//to reactivate players
//untested with smart, might not work
{$IFDEF SMART}
procedure Proggy; forward;
Procedure EasyRC;
var i:integer;
begin
if not IsFKeyDown(12) then exit;
LogOut;
Proggy;
writeln('Fresh proggie on your right');
writeln('');
writeln('--- MENU ---');
writeln('F9 --> Status');
writeln('F10 --> Reset All');
writeln('F11 --> manage players');
writeln('F1 --> Keep on autoing');
writeln('--- End Menu --- ');
writeln('');
wait(2000);
repeat
if IsFKeyDown(9) then //status
begin
for i:=0 to High(players) do
writeln(IntToStr(i)+': '+Players[i].Nick+' - '+BoolToStr(Players[i].Active));
end;
if IsFKeyDown(10) then //Reset All
begin
for i:= 0 to High(Players) do
Players[i].Active := true;
writeln('Reset all :) ');
end;
if IsFKeyDown(11) then // Manage Players
begin
end;
if IsFKeyDown(1) then break;
until(false)
writeln('Restarting to auto :)');
LoginPlayer;
end;
{$ELSE}
//local control, F12 to activate and then text. used to check on proggies and
//to reactivate players
//untested with smart, might not work
Procedure EasyRC;
var
i, h1, h2, x, y:integer;
s, str: string;
begin
if not LoggedIn then exit;
if IsFKeyDown(12) then
begin
RMDebug('Trying to use Easy RC');
h1 := GetClientWindowHandle;
GetMousePos(x, y);
SetClientPos(False);
Disguise('RM Easy RC');
if FindWindowTitlePart('RM Easy RC', false) then writeln('Using Easy RC');
h2 := GetClientWindowHandle;
SetOnTop(h1, False);
SetOnTop(h2, True);
SetClientWindowHandle(h2);
wait(100);
ActivateClient;
wait(100);
repeat
s:= ReadLn('What to do?'+chr(13)+'Status / Reset N / Reset All / Proggy / Exit');
lowercase(s);
if (s = 'exit') or (s = '') then break;
if s= 'status' then
begin
for i:= 0 to High(Players) do
if not Players[i].Active then str:= str+chr(13)+Players[i].Name;
readln('these are set to false: '+chr(13)+str+chr(13)+'Press ok');
end;
if s = 'proggy' then
begin
Readln(ProggyStr+chr(13)+'Press ok');
end;
if Pos('reset', s) > 0 then
begin
str := TrimLetters(Trim(s));
if str = '' then
begin
for i:= 0 to High(Players) do
Players[i].Active:= True;
ReadLn('All Players Active'+chr(13)+'Press ok');
end else
try begin
i:= StrToInt(str);
Players[i].Active := True;
Readln('activated player: '+str+chr(13)+'Press ok');
end except break end;
end;
until(false)
SetOnTop(h2, False);
SetOnTop(h1, True);
SetClientWindowHandle(h1);
ActivateClient;
MMouse(x, y, 2, 2);
wait(3000);
Disguise(' A: '+IntToStr(PlayersActive)+'/'+IntToStr(Length(Players))+' Loads: '+IntToStr(loads));
RMDebug('Done using Easy RC');
end;
end;
{$ENDIF}
type
MyChat = record
Chatter: TStringArray;
Said: TStringArray;
LastResponded: integer;
end;
var
Trigger: Array of Array[0..1] of TStringArray; //questions, could make more triggers... if i
Answers: Array of TStringArray; //find i need them
RMTalks: MyChat;
Responses: Integer;
// to setup the questions qnd qnswers for the auto responder
procedure SetupRespond;
begin
SetLength(RMTalks.Chatter, 8);
SetLength(RMTalks.Said, 8);
SetLength(Trigger, 7); //how many questions
SetLength(Answers, Length(Trigger));
//you can have as many trigger words and rows as you want
//you can have as many answers as you want
Trigger[0][0]:= ['wc', 'woodcutting']; // trigger words 1
Trigger[0][1]:= ['lvl', 'level']; // trigger words 2
//Trigger[0][2]:= ['','','','','','']; // trigger words 3
Answers[0]:= [
'My Woodcutting Level is: '+IntToStr(Players[CurrentPlayer].Level[20]), //answer 1
'Wc: '+IntToStr(Players[CurrentPlayer].Level[20]), //answer 2
IntToStr(Players[CurrentPlayer].Level[20])+' wc lvl', //answer 3
'my wcing lvl is '+IntToStr(Players[CurrentPlayer].Level[20]) //answer 4
]
Trigger[1][0] := ['axe'];
Trigger[1][1] := ['which', 'what'];
Answers[1] := [
'I''m using a '+Players[CurrentPlayer].Strings[2]+' axe',
Players[CurrentPlayer].Strings[2],
'my axe is made out of '+Players[CurrentPlayer].Strings[2]
]
Trigger[2][0]:= ['good place', 'train'];
Trigger[2][1]:= ['woodcutting', 'wc'];
Answers[2] := [
'Try Training Woodcutting at Draynor',
'Draynor', 'Varrock', 'Edgy', 'Fally',
'Try Training Woodcutting at Edgeville',
'Try Training Woodcutting at Varrock Palace',
'Try Training Woodcutting at South of Falador'
]
Trigger[3][0]:= ['fish', 'fishing', '><>', '<><']; // trigger words 1
Trigger[3][1]:= ['lvl', 'level', 'levl', 'lvel']; // trigger words 2
//Trigger[3][2]:= ['','','','','','']; // trigger words 3
Answers[3]:= [
'My Fishing Level is: '+IntToStr(Players[CurrentPlayer].Level[17]), //answer 1
'Fishing: '+IntToStr(Players[CurrentPlayer].Level[17]), //answer 2
IntToStr(Players[CurrentPlayer].Level[17])+' '+chr(62)+chr(60)+chr(62)+' lvl', //answer 3
'my fishy lvl is '+IntToStr(Players[CurrentPlayer].Level[17]) //answer 4
]
Trigger[5][0]:= ['place', 'train'];
Trigger[5][1]:= ['fishing', '><>', 'fish'];
Answers[5] := [
'Try Training fishing at Draynor',
'Draynor', 'Edgy', 'Al-Kharid', 'Karamja',
'Try Training fishing at Edgeville',
'Try Training fishing at Al-Kharid, close to bank',
'Try Training fishing at lumbridge'
]
Trigger[6][0]:= ['hi','hey', 'hello', 'sup?']; // trigger words 1
Trigger[6][1]:= ['']; // trigger words 2
Answers[6]:= ['hi','hey', 'hello', 'sup?', 'how do you do?'] ;
end;
//from srl, modded for any line
function GetChatTextLine(var chat: string; line:integer): Boolean;
var
x, y: Integer;
textP: TPoint;
begin
if not LoggedIn then exit;
textP := TextCoords(line);
if findcolor(x, y, 16711680, textp.x, textp.y, textp.x + 200, textp.y + 14) then
begin
chat := LowerCase(Trim(GetTextAtEx(x - 3, textp.y - 2, 0, SmallChars, False,
False, -1, 1, 16711680, 60, False, tr_allChars)));
Result := True;
end;
end;
//from srl, modded for any line
function GetChatterLine(var name: string; line:integer): Boolean;
var
i: Integer;
textP: TPoint;
begin
if not LoggedIn then exit;
textP := TextCoords(line);
name := LowerCase(Trim(GetTextAtEx(textP.x - 2, textP.y - 2, 0, SmallChars, False, False, 0, 1,
0, 60, False, tr_allChars)))
i := Pos(':', name)
if (i <> 0) then
begin
Delete(name, i, i);
Result := True;
end;
end;
//my responder, used as antiban to look more human
procedure RMRespond;
var
str: string;
i, h, t, k, triggered:integer;
TSA:TStringArray;
begin
if not LoggedIn then exit;
if (TimeFromMark(RMTalks.LastResponded) < 60000+Random(30000)) then exit;
SetLength(TSA, 8)
str:='';
TSA:=['', '', '', '', '', '', '', ''];
RMTalks.said := ['', '', '', '', '', '', '', ''];
triggered := 0;
// Getting text on all the lines
for i:= 7 DownTo 0 do
begin
GetChatterLine(RMTalks.Chatter[i], i+1);
if Pos(Lowercase(Players[CurrentPlayer].Nick), Lowercase(RMTalks.Chatter[i])) > 0 then
break; //if we already answered, it means we already checked further up.
GetChatTextLine(RMTalks.said[i], i+1);
TSA[i] := RMTalks.said[i];
end;
for i:=High(TSA) DownTo 0 do //all text lines
for h:= 0 to High(Trigger) do //questions
begin
triggered:= 0;
for t:=0 to High(Trigger[h]) do //How many triggers
for k:=0 to High(Trigger[h][t]) do //specific trigger
if Pos(Trigger[h][t][k], TSA[i]) > 0 then
begin
Inc(triggered);
if triggered >= 2 then
begin
Inc(Responses);
str:=(Answers[h][Random(Length(Answers[h]))]);
TypeSend(AddMistakes(str, RandomRange(10, 30)));
RMDebug('Question: '+Trigger[h][0][0]+ ' ' + Trigger[h][t][k]);
RMDebug('Responding: ' + str);
str := '';
MarkTime(RMTalks.LastResponded);
triggered := 0;
SetupRespond;
exit;
end; //end if
break;
end; //end if
//end k loop
end; //end h loop
//end of i loop
end;
//making sure we solve those annoying randoms :)
Function NoRandoms: boolean;
var
x, y:integer;
s:string;
begin
if not LoggedIn then exit;
Result := False;
GetMousePos(x, y);
if UseResponder then RMRespond;
if ClickToContinue then
begin
MMouse(x, y, 3, 3);
Result := True;
end;
if FindNormalRandoms then Result:=true;
if FindFight then
begin
//none of the run aways check for randoms....
case random(4) of
0: s:='n';
1: s:='w';
2: s:='s';
3: s:='e';
end;
RMDebug('running to ' + s + ' and waiting for 8 - 10 s');
RunTo(s, True);
SleepAndMoveMouse(RandomRange(8000, 10000));
case s of
'n': s:= 'S';
's': s:= 'N';
'w': s:= 'E';
'e': s:= 'W';
end;
RMDebug('Returning to ' + s);
RunTo(s, True);
Result:=True;
NoRandoms;
end;
EasyRc;
end;
//Progress report
procedure Proggy;
var
JX2, i, i2, xph:integer;
str: string;
begin
ClearReport;
SRLRandomsReport;
AddToReport('');
AddToReport('[====== '+Padr(ScriptName+' '+Version, 27)+' ======]');
AddToReport('[ By Rasta Magician ]');
AddToReport('[=========================================]');
AddToReport('[ ' + Padr('Written ' + (TheTime) + ' on ' + (TheDate(3)) + '.', 40) + ']')
AddToReport('[ '+ Padr(TimeRunning, 40)+']');
AddToReport('[ ' + Padr('Players: ' + IntToStr(PlayersActive)+ ' / ' + IntToStr(HowManyPlayers), 40) + ']');
AddToReport('[ ' + Padr('Current Player: ' + Players[CurrentPlayer].Nick, 40) + ']');
AddToReport('[ '+ Padr('Loads: '+IntToStr(Loads), 40)+']');
AddToReport('[ '+ Padr('Clay Mined: '+IntToStr(ClayMined), 40)+']');
AddToReport('[ '+ Padr('Mining XP: '+IntToStr(ClayMined*5), 40)+']');
AddToReport('[ '+ Padr('=== CRAFTING XP ===', 40)+']');
xph := Round((ClayMined*40*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Lids: '+IntToStr(xph)+' xp/h', 40)+']');
xph := Round((ClayMined*37.5*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Plant Pots: '+IntToStr(xph)+' xp/h', 40)+']');
xph := Round((ClayMined*33*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Bowls: '+IntToStr(xph)+' xp/h', 40)+']');
xph := Round((ClayMined*25*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Dishes: '+IntToStr(xph)+' xp/h', 40)+']');
xph := Round((ClayMined*12.6*3600*1000) / GetTimeRunning);
AddToReport('[ '+ Padr('Pots: '+IntToStr(xph)+' xp/h', 40)+']');
AddToReport('[ '+ Padr('=== CRAFTING XP ===', 40)+']')
AddToReport('[ '+Padr('Rested: '+IntToStr(Rested), 40)+']');
AddToReport('[================== RM ===================]');
ProggyStr := '';
ProggyStr := ProggyStr + chr(13) + ('[====== '+Padr(ScriptName+' '+Version, 27)+' ======]');
ProggyStr := ProggyStr + chr(13) + ('[ By Rasta Magician ]');
ProggyStr := ProggyStr + chr(13) + ('[=========================================]');
ProggyStr := ProggyStr + chr(13) + ('[ ' + Padr('Written ' + (TheTime) + ' on ' + (TheDate(3)) + '.', 40) + ']');
ProggyStr := ProggyStr + chr(13) + ('[ '+ Padr(TimeRunning, 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[ ' + Padr('Players: ' + IntToStr(PlayersActive)+ ' / ' + IntToStr(HowManyPlayers), 40) + ']');
ProggyStr := ProggyStr + chr(13) + ('[ '+ Padr('Loads: '+IntToStr(Loads), 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[ '+ Padr('Clay Mined: '+IntToStr(ClayMined), 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[ '+Padr('Rested: '+IntToStr(Rested), 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[================== RM ===================]');
AddToReport('[ P | A | L | Mins | Rand ' + Padl(']', 13));
AddToReport('[-----------------------------------------]');
ProggyStr := ProggyStr + chr(13) + ('[ P | A | L | Mins | Rand ' + Padl(']', 13));
ProggyStr := ProggyStr + chr(13) + ('[-----------------------------------------]');
for i:= 0 to HowManyPlayers - 1 do
begin
str := '[ ' + Padr(Players[i].Nick, 4) + ' | ';
if Players[i].Active then
str := str + 'T | '
else
str := str + 'F | ';
str := str + Padr(IntToStr(Players[i].Banked), 2) + ' | ' + Padr(IntToStr(Players[i].Worked), 5) +'| ';
str := str + Padr(Players[i].Rand, 16) + ' ]';
AddToReport(str);
ProggyStr := ProggyStr + chr(13) + str;
end;
str := ScriptName+' '+Version
i := length(str);
if (i mod 2) <> 0 then
i2 := 1;
AddToReport('[-----------------------------------------]');
AddToReport('[====== '+Padl('', 14 - Trunc(i/2)) + str + Padr('', 13 + i2 - Trunc(i/2))+' ======]');
AddToReport('[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]');
ProggyStr := ProggyStr + chr(13) + ('[-----------------------------------------]');
ProggyStr := ProggyStr + chr(13) + ('[====== '+Padl('', 14 - Trunc(i/2)) + str + Padr('', 13 + i2 - Trunc(i/2))+' ======]');
ProggyStr := ProggyStr + chr(13) + ('[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]');
if SaveProggyToFile then
begin
JX2 := ReWriteFile((ScriptPath + ScriptName +' '+ Version + '.txt'), False);
WriteFileString(JX2, ProggyStr);
CloseFile(JX2);
RMDebug('Progress report saved to: ' + ScriptPath + ScriptName + ' ' + Version + '.txt');
end;
Disguise(' A: '+IntToStr(PlayersActive) + '/' + IntToStr(HowManyPlayers) +
' Loads: ' + IntToStr(Loads));
end;
//Antiban, basically just picks up the mouse, increases mouse speed
//clicks a tab and resets everything back to the original.
//just to make sure we stay logged in.
procedure FastSwitchTabs;
var x, y, i, h:integer;
begin
if not LoggedIn then exit;
RMDebug('Inactive Move');
GetMousePos(x, y);
PickUpMouse;
IncEx(MouseSpeed, 10);
i := GetCurrentTab;
repeat
h := 1+Random(12);
until(h <> i)
GameTab(h);
wait(500+Random(500));
GameTab(i);
MMouse(x, y, 3, 3);
DecEx(MouseSpeed, 10);
end;
//will take "Time" + Random(1000) to complete the action, will return to original angle
// By Rasta Magician, heavily based on RandomMovement by Krazy_Meerkat
// will always move the compass around unlike in RandomMovement
procedure CompassMove(Time:Integer);
var
Keys: array of Integer;
I: Integer;
Deg: Extended;
begin
if not LoggedIn then exit;
Keys := [VK_RIGHT, VK_LEFT];
I := Random(2);
ActivateClient;
Deg := rs_GetCompassAngleDegrees;
Wait(100 + random(50));
KeyDown(Keys[I]);
Wait(Round(Time/2) + random(500));
KeyUp(Keys[I]);
Wait(Round(Time/2) + random(500));
MakeCompass(FloatToStr(Deg));
end;
//Random Right Click Return by Rasta Magician,
//Will right-click anywhere on he main map, choose "Cancel" and return the
//mouse to it's original position
procedure RRClickReturn;
var x, y:integer;
begin
if not LoggedIn then exit;
IncEx(MouseSpeed, 7);
GetMousePos(x, y);
ActivateClient;
Mouse(MSX1, MSY1, MSX2, MSY2, False);
wait(100 + Random(50));
ChooseOption('ancel');
wait(50 + Random(100));
MMouse(x, y, 3, 3);
DecEx(MouseSpeed, 7);
end;
//just antiban with a percentage
Procedure AntiBan(percentage: integer);
var p: integer;
begin
if not Loggedin then exit;
if random(100) <= percentage then
begin
case random(14) of
0, 1: FastSwitchTabs;
2, 3: CompassMove(1000);
4, 5: RRClickReturn;
6, 7: SleepAndMoveMouse(2000);
8, 9: HoverSkill('random', false);
//10, 11: DoEmote(Random(37)+1);
12, 13: PickUpMouse;
end;
Gametab(4);
end;
end;
{$IFDEF SMART}
Procedure SetupSmart(world: integer);
begin
SmartSetupEx(world, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
end;
{$ENDIF}
//Used to set up all the necessary things before the script starts running
Procedure SetupScript;
begin
ClearDebug;
Disguise(ScriptName + ' ' + Version);
{$IFDEF SMART}
SetupSmart(100);
{$IFDEF Reflection}
RMDebug('Checking hooks, if they''re outdated un-define reflection to run this');
SetupReflection;
{$ENDIF}
{$ENDIF}
SetupSRL;
DeclarePlayers;
if UseResponder then SetupRespond;
SRLID := YourSRLID;
SRLPassword := YourSRLPass;
ScriptID := MyScriptID;
ActivateClient;
LoginPlayer;
end;
//for prepqring the playe and making sure he has all the requirements
procedure SetupPlayer;
begin
if not LoggedIn then exit;
SetGraphics(4, 'current', 'always', 'off', 'low', 'few', 'off', 'few', 'off');
CloseWindow;
MarkTime(Worked);
GameTab(4);
wait(500);
JugCount := CountItems(JugDTM, 'dtm', []);
RMDebug('Player has '+IntToStr(JugCount)+' jugs');
SetAngle(true);
end;
//switching palyers, or in case of jsut one player making it rest
// "not playing" for a while decreases the chance of getting a lot of randoms
procedure SwitchPlayers;
var Time: integer;
begin
if (TimeFromMark(Worked) >= (WorkTime + Random(3*60*1000)) )or(not LoggedIn) then
begin
if PlayersActive > 1 then
NextPlayer(Players[CurrentPlayer].Active)
else begin
if not LoggedIn then TerminateScript;
LogOut;
RMDebug('resting....');
Time := GetSystemTime;
while (GetSystemTime - Time < RestTime) do
Disguise('Rest: '+IntToStr(Round((RestTime - (GetSystemTime - Time))/1000))+' s');
Disguise(' A: '+IntToStr(PlayersActive) + '/' + IntToStr(HowManyPlayers) +
' Loads: ' + IntToStr(Loads));
ActivateClient;
LoginPlayer;
Inc(Rested);
MarkTime(Worked);
end;
SetupPlayer;
end;
end;
procedure LoadDTMS;
begin
ClayDTM := DTMFromString('78DA6374626260E066644006D31BC218FE036' +
'990E87F206004A96146550391859140DA03A8868D801A2FA01A4E' +
'026A40760910506389E9660C353640351CF8D50000D181089F');
SoftDTM := DTMFromString('78DA63B4676260E060644006B9417C0CFF813' +
'448F43F10303A01D5FC6740038C4824900E00AA6163C4AFC605A8' +
'4698801A33A01A3E026A2C816A5808A8F106AAE125A0C69AB07B0' +
'05BEC0953');
JugDTM := DTMFromString('78DA637462626078C68002DA6A6B184480342' +
'310FF0702465BA09AEB0C6880918115AA06CCF304AAB949408D37' +
'50CD3D026ABC806ADE1150630754F391801A4BA09AA744B8F93DA' +
'61A0674735E1350630154F39C801A1BEC7E4751E38C3D9C51D4F8' +
'03D53C2242CD1322ECFA44408D37613703001F0C187A');
WJugDTM := DTMFromString('78DA63CC656260B8CB80024ACBCF31F003694' +
'620FE0F048CE94035D719D00023032B540D985784690E869A72A0' +
'9AD704D46403D57C22A02609A8E60501352037DFC7AF060021030' +
'F2C');
end;
procedure FreeDTMS;
begin
FreeDTM(ClayDTM);
FreeDTM(SoftDTM);
FreeDTM(JugDTM);
FreeDTM(WJugDTM);
end;
//Just a few things it does when the script ends.
procedure ScriptTerminate;
begin
Proggy;
FreeDTMS;
writeln('');
writeln('Thank for using my script, Rasta Magician');
writeln('Script stopped at ' + TheTime + ' ' + TheDate(3));
writeln('Please post the Progress Report');
end;
function AutoColorOven: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
//try begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.60, 8.58);
if not (FindColorsTolerance(arP, 661291, MMX1, MMY1, MMX2, MMY2, 6)) 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
if (rs_OnMinimap(arP[i].x, arP[i].y)) 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 except end;
end;
function AutoColorOven2: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
//try begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.13, 1.16);
if not (FindColorsTolerance(arP, 1126745, MMX1, MMY1, MMX2, MMY2, 4)) 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
if (rs_OnMinimap(arP[i].x, arP[i].y)) 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 except end;
end;
function AutoColorPick: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
// try begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.38, 1.13);
if not (FindColorsTolerance(arP, 2903683, MMX1, MMY1, MMX2, MMY2, 6)) then
begin
Writeln('Failed to find the color, no result. - pick');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
if (rs_OnMinimap(arP[i].x, arP[i].y)) 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. - pick');
// end except end;
end;
function AutoColorWaterSymbol: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
// try begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.32);
if not (FindColorsTolerance(arP, 15549204, MMX1, MMY1, MMX2, MMY2, 10)) then
begin
Writeln('Failed to find the color, no result. - Water');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
if (rs_OnMinimap(arP[i].x, arP[i].y)) 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. - water');
// end except end;
end;
procedure DoTheColors;
var x, y: integer;
begin
{
PickColor := AutoColorPick;
LadderColor := FindLadderColor;
OvenColor := AutoColorOven;
if OvenColor = 0 then
OvenColor := AutoColorOven2;
if LadderColor = 0 then
LadderColor := AutoColorWaterSymbol;
}
end;
Function Relocate(place: string): boolean;
var
ATPA: T2DPointArray;
TPA : TPointArray;
TP: TPoint;
Color: boolean;
Str: string;
begin
if GetMMLevels('run', str) >= 25 then
SetRun(true);
Color := True;
{$IFDEF Reflection}
RMDebug('[REF] Relocating.. '+place);
Color := False;
RMDebug('before case');
case lowercase(place) of
'mine': if not WalkToTile(Point(2939, 3282), 1, 2) then Color := true;
'water': if not WalkToTile(Point(2933, 3280), 1, 2) then Color := true;
'wheel': if not WalkToTile(Point(2936, 3288), 1, 2) then Color := true;
'oven': if not WalkToTile(Point(2930, 3290), 1, 2) then Color := true;
end;
RMDebug('aafter case');
if Color then
RMDebug('reflection failed, trying color')
else begin
RMDebug('At '+place);
Result := true;
wait(750+random(500));
exit;
end;
{$ENDIF}
Result := true;
RMDebug('Relocating.. '+place);
case lowercase(place) of
'mine':
begin
if PickColor = 0 then
begin
PickColor := AutoColorPick;
if PickColor = 0 then
begin
LogOut;
Players[CurrentPlayer].Rand := 'AC Fail';
exit;
end;
end;
if FindColorsTolerance(TPA, PickColor, MMX1, MMY1, MMX2, MMY2, 0) then
begin
ATPA := SplitTPA(TPA, 1);
SortATPAFrom(ATPA, IntToPoint(MMX2, MMY2));
SortTPAFrom(ATPA[0], IntToPoint(MMX2, MMY2));
TP := ATPA[0][0];
Mouse(TP.x, TP.y + 8, 3, 3, true);
end else Result := false;
end;
'water':
begin
if LadderColor = 0 then
begin
LadderColor := FindLadderColor;
if LadderColor = 0 then
LadderColor := AutoColorWaterSymbol;
if LadderColor = 0 then
begin
LogOut;
Players[CurrentPlayer].Rand := 'AC Fail';
exit;
end;
end;
if FindColorsTolerance(TPA, LadderColor, MMX1, MMY1, MMX2, MMY2, 0) then
begin
ATPA := SplitTPA(TPA, 2);
SortATPASize(ATPA, true);
TP := MiddleTPA(ATPA[0]);
Mouse(TP.x, TP.y, 3, 3, true);
end else Result := false;
end;
'wheel':
begin
if OvenColor = 0 then
begin
OvenColor := AutoColorOven;
if OvenColor = 0 then
OvenColor := AutoColorOven2;
if OvenColor = 0 then
begin
LogOut;
Players[CurrentPlayer].Rand := 'AC Fail';
exit;
end;
end;
if FindColorsTolerance(TPA, OvenColor, MMX1, MMY1, MMX2, MMY2, 0) then
begin
ATPA := SplitTPA(TPA, 2);
SortATPAFrom(ATPA, IntToPoint(MMX2, MMY1));
SortTPAFrom(ATPA[0], IntToPoint(MMX2, MMY1));
TP := ATPA[0][0];
Mouse(TP.x, TP.y, 3, 3, true);
end else Result := false;
end;
'oven':
begin
if OvenColor = 0 then
begin
OvenColor := AutoColorOven;
if OvenColor = 0 then
OvenColor := AutoColorOven2;
if OvenColor = 0 then
begin
LogOut;
Players[CurrentPlayer].Rand := 'AC Fail';
exit;
end;
end;
if FindColorsTolerance(TPA, OvenColor, MMX1, MMY1, MMX2, MMY2, 0) then
begin
SortTPAFrom(TPA, IntToPoint(MMX1, MMCY));
TP := TPA[0];
Mouse(TP.x, TP.y, 3, 3, true);
end else Result := false;
end;
end;
if not Result then
begin
RMDebug('failed at relocating to ' + place);
exit;
end;
FFlag(0);
wait(1000+Random(750));
// RMDebug('Arrived at destination. We hope to see you again soon, with RM Airways');
end;
function FindIt(var fx, fy: Integer; CTS, Color, Tol, H, W:integer; SCS2M1, SCS2M2:extended; text:TStringArray): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(SCS2M1, SCS2M2);
if not(FindColorsTolerance(arP, Color, MSX1, MSY1, MSX2, MSY2, Tol)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, H, W);
arL := High(ararP);
for i := 0 to arL do
begin
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 0, 0);
Wait(350);
if IsUpTextMultiCustom(text) 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 Find(s: string): boolean;
var x, y:integer;
begin
case lowercase(s) of
'clay': Result := FindIt(x, y, 2, 7250880, 9, 10, 10, 0.03, 1.24, ['ine', 'ock']);
'water': Result := FindIt(x, y, 1, 11172192, 10, 5, 5, 0.2, 0.2, ['ink']);
'wheel': Result := FindIt(x, y, 2, 8290185, 2, 20, 20, 0.08, 0.25, ['otter''s', 'heel']);
'oven': Result := FindIt(x, y, 4, 660057, 4, 5, 5, 0.06, 0.40, ['ven']);
end;
if Result then
Mouse(x, y, 0, 0, true);
RMDebug('Looking for '+s+'... Found? '+BoolToStr(Result));
end;
Procedure MineIt;
var x, y, t, tries:integer;
begin
if not LoggedIn then exit;
if InvFull then exit;
if not Relocate('mine') then exit;
MarkTime(t);
repeat
if not LoggedIn then break;
{
if FindDTM(GemDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
DropItem(CoordsToItem(x, y));
wait(200+Random(100));
Inc(ReportVars[2]);
end;
}
if InvFull then break;
if Find('clay') then
begin
Tries := 0;
x := GetSystemTime;
repeat
wait(100);
FindNormalRandoms;
if GetSystemTime - x >= 5000 then break;
until(FindBlackChatMessage('swing your'))
if GetSystemTime - x >= 5000 then Continue;
x := GetSystemTime;
repeat
wait(100);
FindNormalRandoms;
if GetSystemTime - x >= 5000 then break;
until(FindBlackChatMessage('manage to mine'))
end else Inc(Tries);
if Tries >= 5 then
if not Relocate('mine') then
break;
until(InvFull)or(TimeFromMark(t) >= (60*5000))
ClayCount := CountItems(ClayDTM, 'dtm', []);
ClayMined := ClayMined + ClayCount;
ReportVars[1] := ClayCount;
IncEx(Players[CurrentPlayer].Integers[0], ClayCount);
end;
Procedure SoftenClay;
var x, y, WaterCount, ClayCount, i, Time:integer;
begin
if not LoggedIn then exit;
if not InvFull then exit;
Gametab(4);
ClayCount := CountItems(ClayDTM, 'dtm', []);
if ClayCount <= 0 then exit;
JugCount := CountItems(JugDTM, 'dtm', []);
RMDebug('2 - Player has '+IntToStr(JugCount)+' jugs');
if JugCount <= 0 then
begin
RMDebug('Player has no jugs!');
Players[CurrentPlayer].active := false;
LogOut;
exit;
end;
Time := GetSystemTime;
if not Relocate('water') then exit;
repeat
if not LoggedIn then break;
if not FindDTM(ClayDTM, x, y, MIX1, MIY1, MIX2, MIY2) then break;
if FindDTM(JugDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 3, 3, true);
wait(350+Random(500));
if Find('water')then
begin
FFlag(0);
Wait(355*JugCount+500+Random(500));
WaterCount := CountItems(WJugDTM, 'dtm', []);
RMDebug(IntToStr(WaterCount)+' jugs are filled with water');
if not WaterCount = JugCount then
begin
for i:= 0 to 5 do
begin
wait(500);
WaterCount := CountItems(WJugDTM, 'dtm', []);
if WaterCount = JugCount then break;
end;
if not WaterCount = JugCount then
begin
RMDebug('something wrong with filling the jugs...');
Continue;
end;
end;
ClayCount := CountItems(ClayDTM, 'dtm', []);
RMDebug('Player has '+IntToStr(ClayCount)+' clay');
Mouse(x, y, 3, 3, true); //clicking jug again
if FindDTM(ClayDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 3, 3, true);
wait(200+random(100));
MMouse(247, 406, 18, 15);
for i:= 0 to 9 do
begin
wait(100);
if GetColor(254, 412) = 938605 then break;
end;
GetMousePos(x,y);
Mouse(x, y, 0, 0, false);
wait(250);
if not ChooseOption('All') then
begin
RMDebug('problem choosing option');
Continue;
end;
wait(1000+ 750*WaterCount + Random(500));
if not CountItems(ClayDTM, 'dtm', []) = (ClayCount - WaterCount) then
if not CountItems(ClayDTM, 'dtm', []) = 0 then
begin
for i:= 0 to 5 do
begin
wait(500);
if CountItems(ClayDTM, 'dtm', []) = 0 then
exit;
if CountItems(ClayDTM, 'dtm', []) = (ClayCount - WaterCount) then
break;
end;
end else break;
if not CountItems(ClayDTM, 'dtm', []) = (ClayCount - WaterCount) then
if not CountItems(ClayDTM, 'dtm', []) = 0 then
begin
RMDebug('Problem softening the clay....');
Continue;
end;
end;
end else begin
RMDebug('Couldn''t find the water');
if not Relocate('water') then break;
Continue;
end;
end else begin
RMDebug('found no jug');
LogOut;
Players[CurrentPlayer].Active := false;
exit;
end;
until(GetSystemTime - Time >= 60*5000)
end;
Procedure MoldClay;
var
x, y, i, SoftCount, Time:integer;
TPA: TPointArray;
TP: TPoint;
CFound: boolean;
begin
if not LoggedIn Then exit;
if not InvFull then exit;
if FindDTM(ClayDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
exit;
SoftCount := CountItems(SoftDTM, 'dtm', []);
if SoftCount <= 0 then exit;
if not Relocate('wheel') then exit;
if IsMember then
TP := IntToPoint(MCX2, MCY2)
else
TP := IntToPoint(314, 448);
repeat
if not LoggedIn then break;
CFound := false;
Gametab(4);
if FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 3, 3, true);
if Find('wheel') then
begin
FFlag(0);
for i:= 0 to 9 do
begin
wait(200);
if FindColor(x, y, 128, 229, 350, 239, 360) then //won't break as often as getcolor
begin
CFound := true;
break;
end;
end;
if not CFound then continue;
if FindColorsTolerance(TPA, 0, 61, 439, 467, 457, 0) then
begin
SortTPAFrom(TPA, TP);
Mouse(TPA[0].x, TPA[0].y - 50, 3, 3, false);
wait(750);
if not ChooseOption('ake X') then
begin
RMDebug('Problems choosing X');
Continue;
end else begin
wait(350+Random(250));
TypeSend(IntToStr(RandomRange(28, 99)));
i := GetSystemTime;
repeat
wait(250);
Antiban(RandomRange(2,4));
if not FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
break;
until((GetSystemTime - i) >= 750*SoftCount)
i := GetSystemTime;
repeat
wait(100);
Antiban(RandomRange(2,5));
if not FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
break;
until((GetSystemTime - i) >= 30000)
if FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
RMDebug('Something went wrong with moudling');
Continue;
end;
end;
end;
end;
end else begin
RMDebug('could not find soft clay');
break;
end;
SoftCount := CountItems(SoftDTM, 'dtm', []);
if SoftCount <= 0 then break;
if not Relocate('wheel') then break;
until (false);
end;
Procedure FireClay;
var
i, x, y, Time, TimeIt: integer;
TPA, CTPA: TPointArray;
TIA: TIntegerArray;
TB: TBox;
TP: TPoint;
CFound: boolean;
begin
if not LoggedIn Then exit;
if not InvFull then exit;
if FindDTM(ClayDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
exit;
if FindDTM(SoftDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
exit;
if not Relocate('oven') then exit;
if IsMember then
TP := IntToPoint(MCX2, MCY2)
else
TP := IntToPoint(314, 448);
Gametab(4);
Time := GetSystemTime;
repeat
if not LoggedIn then break;
CFound := false;
for i:= 28 Downto 1 do
begin
TB := InvBox(i);
if not FindDTM(JugDTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
begin
SetLength(CTPA, 6);
CTPA[0] := Point(TB.x1 + 20, TB.y1 + 5);
CTPA[1] := Point(TB.x1 + 20, TB.y1 + 10);
CTPA[2] := Point(TB.x1 + 20, TB.y1 + 15);
CTPA[3] := Point(TB.x1 + 20, TB.y1 + 20);
CTPA[4] := Point(TB.x1 + 20, TB.y1 + 25);
CTPA[5] := Point(TB.x1 + 20, TB.y1 + 30);
TIA := GetColors(CTPA);
end;
end;
if Find('oven') then
begin
FFlag(0);
for i:= 0 to 9 do
begin
wait(200);
if FindColor(x, y, 128, 229, 350, 239, 360) then //won't break as often as getcolor
begin
CFound := true;
break;
end;
end;
if not CFound then continue;
if FindColorsTolerance(TPA, 0, 61, 438, 467, 457, 0) then
begin
SortTPAFrom(TPA, TP);
Mouse(TPA[0].x, TPA[0].y - 50, 3, 3, false);
wait(100);
if not ChooseOption('ake X') then
begin
RMDebug('Problems choosing X');
Continue;
end else begin
wait(350+Random(250));
TypeSend(IntToStr(RandomRange(28, 99)));
wait(1000);
TimeIt := GetSystemTime;
repeat
wait(250);
if FindNPCChatText('t have any', Nothing) then
break;
if IsChatBoxTextAnyLine('have any more', 0) then
break;
if random(100) <= 5 then CompassMove(1000);
NoRandoms;
until(GetSystemTime - TimeIt >= (4000*26))
if not IsChatBoxTextAnyLine('have any more', 0) then
if not FindNPCChatText('t have any', Nothing) then
Continue;
RMDebug('done waiting for fired stuff');
for x := 0 to 9 do
begin
if not IsSameIntArray(TIA, GetColors(CTPA)) then
break;
wait(750);
end;
RMDebug('all is done, dropping now');
for i:= 1 to 28 do
begin
if i mod 3 = 0 then
NoRandoms;
TB := InvBox(i);
if not FindDTM(JugDTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
begin
DropItem(i);
wait(200+Random(150));
end;
end;
Inc(Loads);
Inc(Players[CurrentPlayer].Banked);
Inc(ReportVars[0]);
RMDebug('done dropping');
break;
end;
end else begin
RMDebug('Could not find the text color....');
Continue;
end;
end else begin
RMDebug('Problems Finding the Oven');
if not Relocate('oven') then break;
Continue;
end;
if GetSystemTime - Time >= 60000 then
break;
until(false)
end;
begin
SetupScript;
SetupPlayer;
DoTheColors;
LoadDTMS;
repeat
if not LoggedIn then break;
MineIt;
SoftenClay;
MoldClay;
FireClay;
Proggy;
SwitchPlayers;
until(false)
end.