edfromhumanresources
2012-02-22 08:35:21
How Long have You Played Runescape?
10 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java (very strong)
C/C++ (reasonably strong)
Pascal (scar/simba only)
Python, VB, C#, DOTNET, LISP (barely touched)
Database systems i.e. SQL, eXist….
Modelling languages i.e. emphatic, ocl, ATL….
Lower level stuff: VHDL, Verilog, ARM Assembly
The list could go on a bit more but I think that's enough (I'm a 4th year CS student btw)
Are you a member of any other communities?
No other runescape communities right now.
Tell us about yourself…
Please show us one (or multiple) of your scripts.
Here's a link to the thread for my sawmill script:
http://villavu.com/forum/showthread.php?t=73896
And here is the source for my unreleased to public astral crafter which I intend to release in members section if I gain access:
10 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java (very strong)
C/C++ (reasonably strong)
Pascal (scar/simba only)
Python, VB, C#, DOTNET, LISP (barely touched)
Database systems i.e. SQL, eXist….
Modelling languages i.e. emphatic, ocl, ATL….
Lower level stuff: VHDL, Verilog, ARM Assembly
The list could go on a bit more but I think that's enough (I'm a 4th year CS student btw)
Are you a member of any other communities?
No other runescape communities right now.
Tell us about yourself…
From: edfromhumanresources
I'm currently a CS student in the UK from the UK. I spend my days sleeping, attending lectures, missing lectures because I was sleeping, procrastinating on coursework deadlines, rushing to meet coursework deadlines, playing pc games, electronic music, swimming, running, scuba and free diving.
I haven't been playing RS solid for 10 years. I started playing in classic as f2p when I was 11. I played for a few years, then took a massive break for around 8 years or so, and didn't play(bot) again seriously till free trade was reintroduced recently.
Please show us one (or multiple) of your scripts.
Here's a link to the thread for my sawmill script:
http://villavu.com/forum/showthread.php?t=73896
And here is the source for my unreleased to public astral crafter which I intend to release in members section if I gain access:
program EverAstral;
{$i srl/srl/misc/smart.simba}
{$i srl/srl.simba}
{$i sps/sps.simba}
{$i srl/srl/misc/paintsmart.simba}
{$DEFINE LOCAL_DEBUG}
var
x, y : Integer;
essenceDTM, astralRuneDTM, {lawRuneDTM,} cosmicRuneDTM : Integer;
repairPouchSpellDTM, moonclanTeleSpellDTM : Integer;
essenceCrafted, astralsCrafted, moonclanTelesDone, repairPouchesDone : Integer;
bTab, essCol, essRow, astralCol, astralRow, cosmicCol, cosmicRow : Integer;
bankVisionBox, altarVisionBox : TBox;
bankPos, altarPos : TPoint;
altarPath : TPointArray;
const
SmartServer = 76;
essenceXP = 8.7;
essencePrice = 116;
astralPrice = 209;
cosmicPrice = 162;
lawPrice = 363;
numPouches = 4;
procedure DeclarePlayers();
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; //Player name.
Pass := ''; //Player password.
Active := true; //Keep set true.
WorldInfo := [True,0]; //The world to log into.
end;
end;
procedure WriteDbg(str : String);
begin
{$IFDEF LOCAL_DEBUG}
Writeln(str);
{$ENDIF}
end;
procedure AllocateVariables();
begin
WriteDbg('Allocating variables...');
bTab := 8;
essCol := 0;
essRow := 0;
astralCol := 2;
astralRow := 0;
cosmicCol := 1;
cosmicRow := 0;
bankVisionBox.x1 := 230;
bankVisionBox.y1 := 945;
bankVisionBox.x2 := 260;
bankVisionBox.y2 := 970;
bankPos := Point(240,955);
altarVisionBox.x1 := 455;
altarVisionBox.y1 := 1155;
altarVisionBox.x2 := 495;
altarVisionBox.y2 := 1195;
altarPos := Point(465, 1175);
altarPath := [Point(260, 970), Point(285, 970), Point(290, 1015), Point(295, 1045), Point(295, 1075), Point(320, 1100), Point(350, 1130), Point(370, 1150), Point(380, 1190), Point(415, 1195), Point(445, 1185), altarPos];
essenceDTM := DTMFromString('mlwAAAHicY2dgYHBiYmAwAeIAIHYAYl8gNgdiRyBmY2Rg4GSE0GJALATF3ECcnZ4O1M2EgRNjYxm4GLADkDgjHgwFAOSfBLs=');
astralRuneDTM := DTMFromString('mggAAAHicY2NgYGBjY2AQAeIfrAwMrEBaAIh/AdnTGSF4GhAvB+LFQLwQiI+tOQbUxYSBRRiwA0YcGAIACLMIWw==');
cosmicRuneDTM := DTMFromString('mggAAAHicY2NgYOABYiYglgBifgYIkIHS3FB5ASBmhOKb1+WgOlCxCAN2wIgDQwAAyYcCcw==');
moonclanTeleSpellDTM := DTMFromString('mlwAAAHicY2dgYAhnYmAIBeJ4IE4A4gAg9gfiMCB+ApS/DcT3gPglEL8G4gdA/A6IGWaACEYcGDfApQNJFwAgtAla');
repairPouchSpellDTM := DTMFromString('mwQAAAHic42RgYAhnguAoIA4F4kAojoNikFwsIwNDABCHAnEYEEcCcQISnQTERf46QNMY8WIuBsIAvwkQDAcAT4EHaw==');
end;
procedure FreeVariables();
begin
Writeln('Freeing variables.');
FreeDTM(essenceDTM);
FreeDTM(astralRuneDTM);
//FreeDTM(lawRuneDTM);
FreeDTM(cosmicRuneDTM);
FreeDTM(repairPouchSpellDTM);
FreeDTM(moonclanTeleSpellDTM);
end;
procedure SetupScript();
begin
Smart_Server := SmartServer;
Smart_SuperDetail := false;
Smart_Members := true;
Smart_Signed := true;
SetupSRL();
SPS_Setup(RUNESCAPE_SURFACE, ['0_2','1_2']);
DeclarePlayers();
AllocateVariables();
Addonterminate('FreeVariables');
SMART_ClearCanvas();
ClearDebug();
end;
procedure ReportSmart();
var
timeSeconds, essencePH, astralsPH, gpMade, gpHr, teleSpent, repairSpent : Double;
strings, titleString : Array of String;
begin
SetLength(strings, 7);
SetLength(titleString, 1);
timeSeconds := GetTimeRunning() / 1000;
essencePH := essenceCrafted * (3600 / timeSeconds);
astralsPH := astralsCrafted * (3600 / timeSeconds);
teleSpent := moonclanTelesDone * (lawPrice + (2 * astralPrice));
repairSpent := repairPouchesDone * (lawPrice + (2 * astralPrice) + cosmicPrice);
gpMade := (astralsCrafted * astralPrice) - (essenceCrafted * essencePrice) - teleSpent - repairSpent;
gpHR := gpMade * (3600 / timeSeconds);
titleString[0] := 'EverAstral';
strings[0] := ' Time ' + TimeRunning();
strings[1] := ' Essence crafted ' + IntToStr(essenceCrafted);
strings[2] := ' Astrals crafted ' + IntToStr(astralsCrafted);
strings[3] := ' ' + IntToStr(Round(essenceCrafted * essenceXP)) + ' xp';
strings[4] := ' ' + IntToStr(Round(essencePH * essenceXP)) + ' xp/hr';
strings[5] := ' ' + IntToStr(Round(gpMade)) + ' gp';
strings[6] := ' ' + IntToStr(Round(gpHr)) + ' gp/hr';
SMART_DrawTextMulti(true, true, titleString, Point(10, 25), 'BigChars', 12954309);
SMART_DrawTextMulti(false, true, strings, Point(10, 55), 'SmallChars', 13157309);
end;
procedure Report();
var
timeSeconds, essencePH, astralsPH : Double;
begin
timeSeconds := GetTimeRunning() / 1000;
essencePH := essenceCrafted * (3600 / timeSeconds);
astralsPH := astralsCrafted * (3600 / timeSeconds);
Writeln('=================== EverAstral ===================');
Writeln('=================================================');
Writeln('||== Time Running : ' + TimeRunning());
Writeln('||== Essence crafted : ' + IntToStr(essenceCrafted));
Writeln('||== Astrals crafted : ' + IntToStr(astralsCrafted));
Writeln('||== XP per hr : ' + FloatToStr(essencePH * essenceXP));
Writeln('||== XP gained : ' + FloatToStr(essenceCrafted * essenceXP));
Writeln('=================================================');
Writeln('=================================================');
end;
procedure AntiRandom();
begin
WriteDbg('Checking for randoms...');
FindNormalRandoms();
end;
//Modified MSI_Antiban (Because it's pretty good).
procedure AntiBan(HowLong, ChancePerc: Integer);
var
time : Integer;
b : Boolean;
begin
if(not LoggedIn())then Exit;
if (Random(100) > ChancePerc)then
Exit;
WriteDbg('Antiban...');
Case HowLong Of
0..2000:
Case Random(4) Of
0 : HoverSkill('runecrafting', False);
1 : PickUpMouse;
2 : RandomRClick;
3 : begin
b := IsXPBarOpen;
ToggleXPBar(not b);
end;
End;
2001..999999:
begin
time := GetSystemTime + HowLong;
while (time > GetSystemTime) do
begin
Wait(Random(5000));
end;
end;
End;
end;
function FindAltar(var x, y : Integer) : Boolean;
var
oldCTS, i : Integer;
color0, color1 : Integer;
combinedTPA, TPA0, TPA1 : TPointArray;
thePoint: TPoint;
ATPA : Array of TPointArray;
begin
if(not LoggedIn())then Exit;
result := false;
MakeCompass('N');
SetAngle(0);
color0 := 8617345;
color1 := 8420222;
oldCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA0, color0, MSX1, MSY1, MSX2, MSY2, 14);
FindColorsSpiralTolerance(MSCX, MSCY, TPA1, color1, MSX1, MSY1, MSX2, MSY2, 14);
ColorToleranceSpeed(oldCTS);
combinedTPA := CombineTPA(TPA0, TPA1);
if(Length(combinedTPA) > 0)then
begin
ATPA := TPAtoATPAEx(combinedTPA, 50, 50);
//SortATPASize(ATPA, true);
for i := 0 to High(ATPA) do
begin
if Length(ATPA[i]) < 300 then
Continue;
SMART_DrawBox(GetTPABounds(ATPA[i]));
thePoint := MiddleTPA(ATPA[i]);
MMouse(thePoint.x, thePoint.y, 10, 10);
if WaitUpText('ltar', 300) then
begin
GetMousePos(x, y);
result := true;
Break;
end;
end;
ReportSmart();
end;
end;
function FindLunarBank() : Boolean;
var
oldCTS, i : Integer;
color0, color1, color2 : Integer;
combinedTPA, TPA0, TPA1, TPA2 : TPointArray;
thePoint: TPoint;
ATPA : Array of TPointArray;
begin
if(not LoggedIn())then Exit;
result := false;
MakeCompass('N');
SetAngle(0);
color0 := 6975864;
color1 := 7108223;
color2 := 7042171;
oldCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(335, 132, TPA0, color0, MSX1, MSY1, MSX2, MSY2, 7);
FindColorsSpiralTolerance(335, 132, TPA1, color1, MSX1, MSY1, MSX2, MSY2, 7);
FindColorsSpiralTolerance(335, 132, TPA2, color2, MSX1, MSY1, MSX2, MSY2, 7);
ColorToleranceSpeed(oldCTS);
combinedTPA := CombineTPA(TPA0, TPA1);
combinedTPA := CombineTPA(combinedTPA, TPA2);
if(Length(combinedTPA) > 0)then
begin
ATPA := TPAtoATPAEx(combinedTPA, 30, 20);
SortATPAFrom(ATPA, Point(335, 132));
//SortATPASize(ATPA, true);
for i := 0 to High(ATPA) do
begin
if Length(ATPA[i]) < 20 then
Continue;
SMART_DrawBox(GetTPABounds(ATPA[i]));
thePoint := MiddleTPA(ATPA[i]);
MMouse(thePoint.x, thePoint.y, 0, 0);
if WaitUpText('ank booth', 300) then
begin
GetMousePos(x, y);
result := true;
Break;
end;
end;
ReportSmart();
end;
end;
function AtAltar() : Boolean;
begin
result := PointInBox(SPS_GetMyPos(), altarVisionBox);
end;
function AtLunarBank() : Boolean;
begin
result := PointInBox(SPS_GetMyPos(), bankVisionBox);
end;
procedure TeleMoonClan();
begin
if(not LoggedIn())then Exit;
GameTab(tab_Magic);
Wait(300);
if(FindDTM(moonclanTeleSpellDTM, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
MMouse(x, y, 3, 3);
if(WaitUpText('oonclan',300))then
begin
WriteDbg('Found Moonclan teleport; Clicking');
ClickMouse2(1);
Wait(RandomRange(3000,3500));
Inc(moonClanTelesDone);
end else
WriteDbg('Failed to find Moonclan teleport up text');
end else
WriteDbg('Failed to find moonclanTeleSpellDTM.');
GameTab(tab_Inv);
AntiBan(2000, 5);
end;
procedure TravelBank();
begin
if(not LoggedIn())then Exit;
if(SPS_PosOnMM(bankPos))then
begin
WriteDbg('Bank is on MM; Walking.');
SPS_WalkToPos(bankPos);
end else
begin
WriteDbg('Bank is not on MM; Teleporting');
TeleMoonclan();
end;
end;
procedure TravelAltar();
begin
if(not LoggedIn())then Exit;
SPS_WalkPath(altarPath);
end;
function OpenLunarBank() : Boolean;
begin
WriteDbg('Banking...');
//Opens the bank screen if it isn't already.
if(not BankScreen())then
begin
WriteDbg('Bank screen not open.');
//If not in a position where we can open bank then get to one.
if(not AtLunarBank())then
begin
WriteDbg('Not at bank; Traveling to bank.');
TravelBank();
Exit;
end;
//Looks for bank on main screen and opens if found.
if(FindLunarBank())then
begin
WriteDbg('Found lunar bank.');
Mouse(x, y, 0, 0, 1);
if(WaitFunc(@BankScreen, 200, 5000))then
begin
WriteDbg('Opened bank.');
result := true;
end else
WriteDbg('Failed to open bank having found it.');
end else
WriteDbg('Failed to find lunar bank.');
end else
begin
WriteDbg('Bank screen already open.');
result := true;
end;
end;
function FindEssence() : Boolean;
begin
GameTab(tab_Inv);
//Hard to differentiate between law runes and essence always have laws in slot 28
if(FindDTM(essenceDTM, x, y, MIX1, MIY1, MIX2, MIY2))then
result := not PointInBox(Point(x, y), InvBox(28));
WriteDbg('FindEssence() : ' + BoolToStr(result));
end;
function FindAstrals() : Boolean;
begin
GameTab(tab_Inv);
result := FindDTM(astralRuneDTM, x, y, MIX1, MIY1, MIX2, MIY2);
WriteDbg('FindAstrals() : ' + BoolToStr(result));
end;
function FindCosmics() : Boolean;
begin
GameTab(tab_Inv);
result := FindDTM(cosmicRuneDTM, x, y, MIX1, MIY1, MIX2, MIY2);
WriteDbg('FindCosmic() : ' + BoolToStr(result));
end;
procedure DepositAstrals();
begin
if(FindAstrals())then
begin
MMouse(x, y, 3, 3);
if(WaitUpText('stral', 500))then
begin
ClickMouse2(0);
WaitOption('eposit-All', 500);
end;
end;
end;
procedure DepositCosmics();
begin
if(FindCosmics())then
begin
MMouse(x, y, 3, 3);
if(WaitUpText('osmic', 500))then
begin
ClickMouse2(0);
WaitOption('eposit-All', 500);
end;
end;
end;
procedure FillPouches();
var
i : Integer;
thePoint : TPoint;
begin
for i := 1 to numPouches do
begin
if((i = 1) or (i = 3))then
WithDraw(essCol, essRow, -1);
thePoint := ItemCoords(i);
Mouse(thePoint.x, thePoint.y, 3, 3, 0);
WaitOption('ill', 300);
end;
end;
procedure WithdrawEssence();
begin
WriteDbg('WithdrawEssence()');
BankTab(bTab);
FillPouches();
WithDraw(essCol, essRow, -1);
end;
procedure WithdrawAstral();
begin
WriteDbg('WithdrawAstral()');
BankTab(bTab);
WithDraw(astralCol, astralRow, -1);
end;
procedure WithdrawCosmic();
begin
WriteDbg('WithdrawCosmic()');
BankTab(bTab);
WithDraw(cosmicCol, cosmicRow, -1);
end;
procedure RepairPouch(invSlot : Integer);
var
thePoint : TPoint;
begin
GameTab(tab_Magic);
Wait(300);
if(FindDTM(repairPouchSpellDTM, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
MMouse(x, y, 3, 3);
if(WaitUpText('epair',300))then
begin
WriteDbg('Found repair rune pouch spell; Clicking');
ClickMouse2(1);
thePoint := ItemCoords(invSlot);
Mouse(thePoint.x, thePoint.y, 3, 3, 1);
Wait(RandomRange(750,1250));
Inc(repairPouchesDone);
end else
WriteDbg('Failed repair rune pouch spell up text');
end else
WriteDbg('Failed to find repairPouchSpellDTM.');
GameTab(tab_Inv);
end;
procedure CheckAndRepairPouches();
var
i : Integer;
box : TBox;
begin
WriteDbg('Checking for broken pouches...');
for i := 1 to numPouches do
begin
box := InvBox(i);
WriteDbg('Slot ' + IntToStr(i) + ' broken pouch color count : ' + IntToStr(CountColorTolerance(2632751, box.x1, box.y1, box.x2, box.y2, 6)));
if(CountColorTolerance(2632751, box.x1, box.y1, box.x2, box.y2, 6) > 30)then
begin
WriteDbg('Found broken pouch in slot: ' + IntToStr(i));
if(not FindCosmics() or not FindAstrals())then
begin
WriteDbg('We dont have runes for repair; Withdrawing');
if(not OpenLunarBank())then
Exit;
BankTab(bTab);
WithdrawAstral();
WithdrawCosmic();
CloseBank();
end;
RepairPouch(i);
end;
end;
end;
procedure Bank();
begin
if(not LoggedIn())then Exit;
if(not OpenLunarBank())then
Exit;
//The bank should be open if we get to here!
DepositAstrals();
DepositCosmics();
WithdrawEssence();
AntiBan(2000, 5);
end;
procedure CraftRunes();
var
altarX, altarY, i, tempCount : Integer;
begin
if(not LoggedIn())then Exit;
WriteDbg('Crafting runes...');
if(not AtAltar())then //If not in a position where we can craft runes then get to one.
begin
WriteDbg('Not at altar; Traveling to altar.');
TravelAltar();
Exit;
end;
if(FindAltar(altarX, altarY))then //Looks for altar on main screen and crafts runes if found.
begin
WriteDbg('Found altar.');
tempCount := InvCount();
Mouse(altarX, altarY, 0, 0, 1);
for i := 1 to numPouches do
begin
MMouse(ItemCoords(i).x, ItemCoords(i).y, 3, 3);
if((i = 1) or (i = 3))then
begin
Wait(RandomRange(2000,2500));
essenceCrafted := essenceCrafted + (TempCount - InvCount());
ReportSmart();
end;
ClickMouse2(1);
//WaitOption('mpty', 500);
if((i = 2) or (i = 4))then
begin
Wait(RandomRange(700,1000));
FindAltar(altarX, altarY);
tempCount := InvCount();
Mouse(altarX, altarY, 0, 0, 1);
end;
end;
Wait(RandomRange(1500,2000));
essenceCrafted := essenceCrafted + (TempCount - InvCount()) + 1;
WriteDbg('Total Essence Crafted: ' + IntToStr(essenceCrafted));
if(FindAstrals())then
astralsCrafted := astralsCrafted + GetAmountBox(InvBox(CoordsToItem(x, y)));
WriteDbg('Total Astrals Crafted: ' + IntToStr(astralsCrafted));
end else
WriteDbg('Failed to find altar.');
end;
procedure PrintMyPos();
var
myPos : TPoint;
begin
myPos := SPS_GetMyPos();
WriteDbg('My position: ' + IntToStr(myPos.x) + ',' + IntToStr(myPos.y));
end;
begin
SetupScript();
ActivateClient();
while(not LoggedIn())do
LoginPlayer();
repeat
if(not LoggedIn())then Break;
PrintMyPos();
ReportSmart();
if(FindAstrals() or FindCosmics() or not FindEssence())then
begin
CheckAndRepairPouches();
Bank();
end else
CraftRunes();
AntiRandom();
until(false);
end.