SRL Archive - Archive

okokokok - SRL Member Application


okokokok

2013-06-21 06:14:50

How Long have You Played Runescape?
5 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
Pascal


Are you a member of any other communities?
None related to Runescape


Tell us about yourself…
From: okokokok
Well I'm 20 years old and I'm from Holland. I've played RS for around 5 years (with breaks). I joined SRL around 2 years ago. Started scripting a bit back then and took a few major breaks of RS as well as scripting.

Now with RS07 I'm back and also started scripting again. I've done more scripting than ever and also learned alot lately.

Therefore I think that i'm ready to apply and hopefully learn more about scripting for RS and maybe even other programming languages.

Thank you for your time to view my application and script.



Please show us one (or multiple) of your scripts.
program OkOkOkOk_AKCBaller_Application_Version;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$i SRL-OSR\SRL\misc\debug.simba}
{$I SPS/sps-osr.simba}


var
x,y,t,Timeout,LoadsDone,Loads ,LoadsPerHour ,CBallsMade,CBallsPH, TimeDone, CurrentXP, OriginalXP, XPGain, XPGainPH: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Pin := '';
Players[0].Active:= True;
Players[0].LampSkill := Skill_Prayer;

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Pin := '';
Players[1].Active:= True;
Players[1].LampSkill := Skill_Prayer;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Pin := '';
Players[2].Active:= True;
Players[2].LampSkill := Skill_Prayer;

Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Pin := '';
Players[3].Active:= True;
Players[3].LampSkill := Skill_Prayer;
end;

////////////////////////////////////////////
/////////// AntiBan Procedure ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

procedure AntiBan;
begin

FindNormalRandoms;
case Random (1500) of
0..15: RandomRClick;
50..65: PickUpMouse;
90..105: RandomRClick;
115..120: RandomMovement;
160..180: ExamineInv;
230..250:
begin
HoverSkill('random', false);
sleepandmovemouse(276 + Random(100));
PickUpMouse;
ChooseOption('Cancel');
SetAngle(SRL_ANGLE_HIGH);
end;
300..320: BoredHuman;
350..390: PickUpMouse;
420..450: RandomRClick;
280..299: RandomMovement;
460..480: SleepAndMoveMouse(3000 + Random(500));
end;
end;

/////////////////////////////////////////////
/////////// GetXP Adjustment ///////////
/////////// Adjusted by OkOkOkOk ///////////
/////////////////////////////////////////////

function GetXPCustom(skill: variant): integer;
var
MouseTB,b: TBox;
rcc: TPoint;
tpa: TPointArray;
begin
result := -1;

if(not TabExists(tab_Stats)) or (not gameTab(tab_Stats)) then
exit;

rcc:= SkillToPoint(skill);
MouseTB := SkillBoxCoords(rcc.x,rcc.y);
if (MouseTB.X1 < 1) then
exit;

MMouse(MouseTB.X1+2,MouseTB.Y1+2, 1, 1);
wait(400 + random(200));

if (WaitFindColors(tpa, 10551295, MIX1, MIY1, MIX2, MIY2, 0, 3000)) then
begin
b := getTPABounds(tpa);
wait(450 + random(150));
result := strToIntDef(getNumbers(GetTextAtExWrap(b.x1+15, b.y1+2,b.x2-2,
b.y1+13, 0, 5, 1, 0, 0, 'smallChars07')), -1);
end;
end;

////////////////////////////////////////////
/////////// Proggy Report ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

procedure ProgressReport;
begin
ClearDebug;
Loads := (LoadsDone);
TimeDone := (GetTimeRunning/1000);
LoadsPerHour := (3600 * (Loads) / (TimeDone));
CBallsMade := (Loads * 108);
CBallsPH := (3600 * (CBallsMade) / (TimeDone));
CurrentXP := GetXPCustom('smithing');
XPGain := (CurrentXP - OriginalXP);
XPGainPH :=(3600*(XPGain))/((TimeDone));
begin
Writeln('****************************************************************');
Writeln('******************** OkOkOkOk AKCBaller ************************');
Writeln('****************************************************************');
Writeln('Proggy for the player: ' + Players[0].Nick + '');
Writeln('Time running: ' + IntToStr(GetTimeRunning/60000) + ' Minutes ');
Writeln('We have gained: ' + IntToStr(XPGain) + ' Smithing xp / Thats ' + IntToStr(XPGainPH) + ' Smithing xp per hour ');
Writeln('We have done: ' + IntToStr(Loads) + ' Loads / Thats ' + IntToStr(LoadsPerHour) + ' Loads per hour ');
Writeln('We have made: ' + IntToStr(CBallsMade) + ' Cannonballs / Thats ' + IntToStr(CBallsPH) + ' Cannonballs per hour');
end;
end;

//////////////////////////////////////////////////////
/////////// Epic Ultimate North Functions ///////////
/////////// Made by Flight ///////////
//////////////////////////////////////////////////////

{*******************************************************************************
Function GenerateWallDTM(WallType, WallLength: Integer): Integer;
By: Flight
Description: Creates a DTM of a perfectly straight wall.
-WallType : 1 for vertical, 2 for horizontal
-WallLength: Length of the DTM to be generated
*******************************************************************************}
function GenerateWallDTM(WallType, WallLength: Integer): Integer;
var
i: Integer;
TempTDTM: TDTM;
mPnt: TDTMPointDef;
sPnts: array of TDTMPointDef;
begin
SetArrayLength(sPnts, (WallLength-1));
mPnt.x := 0;
mPnt.y := 0;
mPnt.AreaSize := 0;
mPnt.AreaShape := 0;
mPnt.Color := 16119287;
mPnt.Tolerance := 40;

for i:=0 to High(sPnts) do
begin
case WallType of
1:
begin
sPnts[i].x := 0;
sPnts[i].y := i+1;
end;
2:
begin
sPnts[i].x := i+1;
sPnts[i].y := 0;
end;
end;
sPnts[i].AreaSize := 0;
sPnts[i].AreaShape := 0;
sPnts[i].Color := 16119287;
sPnts[i].Tolerance := 40;
end;

TempTDTM.MainPoint := mPnt;
TempTDTM.SubPoints := sPnts;
Result := AddDTM(TempTDTM);
end;

{*******************************************************************************
Function GetLongestWallLength(WallType: Integer): Integer;
By: Flight
Description: Determines the longest wall on your MM at any compass angle.
-WallType: 1 for vertical walls, 2 for horizontal walls
*******************************************************************************}
function GetLongestWallLength(WallType: Integer): Integer;
var
B: TBox;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
ColorToleranceSpeed(1);

FindColorsSpiralTolerance(MMCX, MMCY, TPA, 16119287, MMX1, MMY1, MMX2, MMY2, 40);
if (Length(TPA)<1) then
Exit;

RAaSTPA(TPA, 1);
if (WallType = 1) then
SplitTPAExWrap(TPA, 2, 3, ATPA)
else
SplitTPAExWrap(TPA, 3, 2, ATPA);

SortATPASize(ATPA, True);
B := GetTPABounds(ATPA[0]);
if (WallType = 1) then
Result := (B.Y2-B.Y1)
else
Result := (B.X2-B.X1);
end;

{*******************************************************************************
Function ForceMapNorth: Boolean;
By: Flight
Description: Using auto-generated wall DTMs, this function will attempt to
rotate the compass to near-perfect north. Should it fail it will revert
back to default north.
*******************************************************************************}
Function ForceMapNorth: Boolean;
var
Left: Boolean;
StartAngle: Extended;
X,Y,DTM_VertWall,
DTM_HorWall,T,F,L1,L2: Integer;
label
Start,FuncEnd;
begin
Result := False;
L1 := GetLongestWallLength(1);
L2 := GetLongestWallLength(2);
if (L1 > 50) then
L1 := 50;
if (L2 > 50) then
L2 := 50;

DTM_VertWall := GenerateWallDTM(1, Round(L1*0.85)); //Create a DTM 85% of the length of the longest vertical wall
DTM_HorWall := GenerateWallDTM(2, Round(L2*0.85)); //Create a DTM 85% of the length of the longest horizontal wall

if (FindDTM(DTM_VertWall, X, Y, MMx1, MMy1, MMx2, MMy2) or
FindDTM(DTM_HorWall, X, Y, MMx1, MMy1, MMx2, MMy2)) then
begin
Result := True;
GoTo FuncEnd;
end;

StartAngle := (rs_GetCompassAngleDegrees);
Left := (Round((360 - StartAngle)) mod 360 <= Round((StartAngle + 360)) mod 360);

Start:
if (F > 0) then
MakeCompass('N');

MarkTime(T);
Repeat
TypeByte((Ord(not Left) * 2) + 37); //No holding down, actually press the arrow key
if (FindDTM(DTM_VertWall, X, Y, MMx1, MMy1, MMx2, MMy2) or
FindDTM(DTM_HorWall, X, Y, MMx1, MMy1, MMx2, MMy2)) then
break;
Until(TimeFromMark(T) >= 1000)

FuncEnd:
if ((not FindDTM(DTM_VertWall, X, Y, MMx1, MMy1, MMx2, MMy2)) and
(not FindDTM(DTM_HorWall, X, Y, MMx1, MMy1, MMx2, MMy2))) then
begin
Inc(F);
StartAngle := (rs_GetCompassAngleDegrees);
Left := (Round((360 - StartAngle)) mod 360 <= Round((StartAngle + 360)) mod 360);
if (F < 2) then
GoTo Start;
end else if ((X > 1) and (Y > 1)) then
Result := True;

if not Result then
MakeCompass('N');
FreeDTM(DTM_VertWall);
FreeDTM(DTM_HorWall);
end;

////////////////////////////////////////////
/////////// LevelUpCheck Function //////////
/////////// Made by OkOkOkOk //////////
////////////////////////////////////////////

function LevelUpCheck: Boolean;
var AnvilDTM: Integer;
begin
AnvilDTM := DTMFromString('mwQAAAHic42RgYHABYnUgNgNidyCOBOJYIA4CYjsgNgBiRyYGBiMg1oFiPSAOAeJIII6CstMT4hliw8MZArw9wdjdyQmOo0JCwGJcQLMIYUYiMBwAADqZDXE=');

if finddtm(AnvilDTM,x,y,4,342,516,476) then
begin
writeln('Leveled up!');
result := true;
end;
freedtm(AnvilDTM);
end;

////////////////////////////////////////////
/////////// Smelt Procedures ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

Function NoSteelBar: Boolean;
var SteelbarDTM: Integer;
begin
SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');

if not(finddtm(SteelbarDTM,x,y,MIX1,MIY1,MIX2,MIY2)) then
result := true;

freedtm(SteelbarDTM);
end;

Function SteelBarInBank: Boolean;
var SteelbarDTM: Integer;
begin
SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');

if finddtm(SteelbarDTM,x,y,MSX1,MSY1,MSX2,MSY2) then
result := true;

freedtm(SteelbarDTM);
end;

procedure SmeltCball;
var SteelBarDTM,SteelBarAfterFurnaceDTM, FurnaceDTM: Integer;
begin

AntiBan;
SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');
FurnaceDTM := DTMFromString('mrAAAAHic42BgYJgAxP1APAeIFwDxLCDuAeImIG4D4l1AvBqI1wPxHiA+BsQngfgAEG8CYnMjIzA2NjBg0NPRAdNWpqZwzAVUgw8zEsAwAABEOA+J');
SteelBarAfterFurnaceDTM := DTMFromString('mWAAAAHicY2FgYHgPxF+B+A+UvY6RgWEBEC8C4rlAfHrXVAY7S0s45gKqQcaMaBgEAJNhCrs=');

gametab(tab_inv);
if finddtm(SteelBarDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
mmouse(x,y,0,0);
wait(300 + random(50));
mouse(x,y,0,0,true);
wait(600 + random(100));

if finddtm(FurnaceDTM,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
mmouse(x,y,0,0);
wait(300 + random(50));
mouse(x,y,0,0,true);
wait(3000 + random(50));

if finddtm(SteelBarAfterFurnaceDTM,x,y,4,342,516,476) then
begin
wait(250 + random(50));
mmouse(x,y,0,0);
wait(600 + random(100));
mouse(x,y,0,0,false);
wait(100 + random(50));
if chooseoption('ake All') then
repeat
begin
wait(200 + random(200));
FindNormalRandoms;
wait(200 + random(200));
FindNormalRandoms;
wait(200 + random(200));
FindNormalRandoms;
wait(200 + random(200));
FindNormalRandoms;
wait(200 + random(200));
FindNormalRandoms;
wait(200 + random(200));
FindNormalRandoms;
end;
until (NoSteelBar = true) or (LevelUpCheck = True);
Inc(LoadsDone);
end
else
begin
Players[CurrentPlayer].Active := False;
LogOut;
Exit;
end;
end;
end;

ProgressReport;

if not(loggedin) then
Exit;

freedtm(SteelBarAfterFurnaceDTM);
freedtm(SteelBarDTM);
freedtm(FurnaceDTM);
end;

////////////////////////////////////////////
/////////// PinCheck Function ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

Function PinCheck: Boolean;
var ChestDTM, CoinsDTM: Integer;
begin
ChestDTM := DTMFromString('mwQAAAHic42RgYNjEyMAwC4iXAfFmIN4DxHuh7KVAPBeI1wPVTQbiSVB6BUgfEO+B4rVA/OxhMMOOjiyGGVmhDG56KgwVgXYMevIiYDaIBolzAdURwoxEYDgAADgAFdo=');
CoinsDTM := DTMFromString('m6wAAAHic42ZgYLjOyMCwDYiPAPF5IL4LxE+A+D0QPwbiO0B8FYhPAfF9oPpXQPwOiP8AMSNQ7DmQfgzEt4H4HBBfBuJrQFyUwsOQGsHNwM/Hx9BZIcgQ6s3LYGbABxYDsUHyirL8YJoLqJ5YzEgCRgIAJp0aHQ==');

if finddtm(ChestDTM,x,y,MSX1,MSY1,MSX2,MSY2) or
finddtm(CoinsDTM,x,y,MSX1,MSY1,MSX2,MSY2) then

begin
result := true;
end;
freedtm(ChestDTM);
freedtm(CoinsDTM);
end;

/////////////////////////////////////////////////
/////////// Banking Procedures Report ///////////
/////////// Made by OkOkOkOk ///////////
/////////////////////////////////////////////////

procedure OpenBankBooth;
var
tmpCTS, i, l, r, Count:integer;
BoothTPA:TPointArray;
begin
repeat
tmpCTS := GetToleranceSpeed;

SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.96, 1.07);
FindColorsTolerance(BoothTPA, 5265245, MSX1, MSY1, MSX2, MSY2, 4);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);

L := High(BoothTPA)
marktime(Count);
for i := 0 to L do
begin
r := random(L);
wait(randomrange(60, 200));
MMouse(BoothTPA[r].x, BoothTPA[r].y, 2, 2);
if waituptext('ooth', 300) then
Break;
if timefrommark(Count) > 10000 then
begin
writeln('Could not find bank booth!');
Terminatescript;
end;
end;
clickmouse2(mouse_right);
wait(200 + random(50));
if chooseoption('ank') then
wait(3000 + random(100));

until (bankscreen) or (SteelBarInBank = true) or not(loggedin) or (PinCheck = true);
end;

procedure DepositCball;
var CBallDTM: Integer;
begin
CBallDTM := DTMFromString('mrAAAAHic42BgYMhjguBSKM4F4jQgTgHiLCB+ClRzD4gfAfEbIH4LxO+A+AUQPwFiO0tLBmMDAwZFOTkGAwUFBitTUwZvJyuwOAhzAdXgw4wEMAwAAExZD+s=');

if (PinCheck = true) then
inpin(Players[CurrentPlayer].Pin);

if finddtm(CBallDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
mmouse(x,y,0,0);
wait(500 + random(50));
mouse(x,y,0,0,false);
wait(500 + random(50));

if chooseoption('re All') then
wait(300 + random (50));
end;
if not(loggedin) then
Exit;

end;

procedure WithdrawSteelBar;
var SteelbarDTM: Integer;
begin

SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');

if finddtm(SteelbarDTM,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
mmouse(x,y,0,0);
wait(500 + random(50));
mouse(x,y,0,0,false);
wait(500 + random(50));

if chooseoption('aw All') then
begin
wait(300 + random (50));
closebank;
wait(300 + random(50));
end;
end;
ForceMapNorth;

if not(LoggedIn) then
Exit;
end;

////////////////////////////////////////////
/////////// Walking Procedures ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

procedure ToFurnace;
begin
ForceMapNorth;
setrun(True);
symbolaccuracy := 0.5;
if findsymbol(x,y,'Kebab shop') then
begin
mouse(x,y,0,0,true);
FFlag(0);
wait(3000 + random(100));
end;
symbolaccuracy := 0.8;


symbolaccuracy := 0.5;
if findsymbol(x,y,'furnace') then
begin
mouse(x,y,0,0,true);
FFlag(0);
wait(1000 + random(100));
end
else
begin
Players[CurrentPlayer].Active := False;
LogOut;
Exit;
end;
symbolaccuracy := 0.8;

if not(LoggedIn) then
Exit;
end;

procedure ToBank;
begin
setrun(True);

symbolaccuracy := 0.6;
if findsymbol(x,y,'cook') then
begin
mouse(x,y,0,0,true);
FFlag(0);
wait(3000 + random(100));
end;
symbolaccuracy := 0.8;


symbolaccuracy := 0.4;
if findsymbol(x,y,'bank') then
begin
mouse(x,y,0,0,true);
FFlag(0);
wait(1000 + random(100));
end
else
begin
Players[CurrentPlayer].Active := False;
LogOut;
Exit;
end;
symbolaccuracy := 0.8;

if not(LoggedIn) then
Exit;
end;

////////////////////////////////////////////
/////////// Final Procedures ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

procedure Banking;
begin
ForceMapNorth;
OpenBankBooth;
DepositCball;
WithdrawSteelBar;
end;

Procedure WalkingAndBanking;
begin
ToBank;
Banking;
ToFurnace;
end;

procedure OneRun;
begin
repeat
repeat
setangle(SRL_ANGLE_HIGH);
AntiBan;
FindNormalRandoms;
ForceMapNorth;
SmeltCBall;
WalkingAndBanking;
until (not(LoggedIn));

NextPlayer(Players[CurrentPlayer].Active);
until False;
end;

begin
DeclarePlayers;
SetupSRL;
LoginPlayer;
OriginalXP := GetXPCustom('smithing');
SRL_CombatRandoms := True;
ClearDebug;
begin
repeat
OneRun;
until(false);
end;
end.

Sin

2013-06-21 08:16:32

Hey man, thanks for applying. However, a few things:

Capitalisation: keywords (if/then/begin/end/repeat) look extremely ugly when capitalised. Although it doesnt hinder the script, it's frowned upon.
TPA/ATPA Usage: Your script mainly relies upon DTMs, and to obtain Member you need knowledge of how to use TPAs and ATPAs. Perhaps update the script and add something that shows this?
Global Variables: In your script, you only use x/y, but they're declared globally, and never locally. Reusing global variables is bad practice and could result in bad things occurring (variable failing to set, then you're stuck with the old x/y, and it'll bug out)


Best of luck!

okokokok

2013-06-21 08:22:17

From: Sin
Hey man, thanks for applying. However, a few things:

Capitalisation: keywords (if/then/begin/end/repeat) look extremely ugly when capitalised. Although it doesnt hinder the script, it's frowned upon.
TPA/ATPA Usage: Your script mainly relies upon DTMs, and to obtain Member you need knowledge of how to use TPAs and ATPAs. Perhaps update the script and add something that shows this?
Global Variables: In your script, you only use x/y, but they're declared globally, and never locally. Reusing global variables is bad practice and could result in bad things occurring (variable failing to set, then you're stuck with the old x/y, and it'll bug out)


Best of luck!


Thanks for the advice! I'll try to bug it out a bit. I'll also try to put some TPAs in.
Eventhough i like the capitalised keywords better, I won't that from now on :D

Janilabo

2013-06-21 08:28:09

Do you see anything wrong with the if..then's in these procedures (taken from your script):

procedure DepositCball;
var x,y,CBallDTM: Integer;
begin
CBallDTM := DTMFromString('mrAAAAHic42BgYMhjguBSKM4F4jQgTgHiLCB+ClRzD4gfAfEbIH4LxO+A+AUQPwFiO0tLBmMDAwZFOTkGAwUFBitTUwZvJyuwOAhzAdXgw4wEMAwAAExZD+s=');

If (PinCheck = True) then
InPin(Players[0].Pin);
InPin(Players[1].Pin);
InPin(Players[2].Pin);
InPin(Players[3].Pin);

If FindDTM(CBallDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
MMouse(x,y,0,0);
Wait(500 + random(50));
Mouse(x,y,0,0,false);
Wait(500 + random(50));

If ChooseOption('re All') then
Wait(300 + random (50));
end;

If Not(LoggedIn) then
Exit;

end;

procedure WithdrawSteelBar;
var x,y,SteelbarDTM: Integer;
begin

SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');

If FindDTM(SteelbarDTM,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
MMouse(x,y,0,0);
Wait(500 + random(50));
Mouse(x,y,0,0,false);
Wait(500 + random(50));

If ChooseOption('aw All') then
Wait(300 + random (50));
CloseBank;
Wait(300 + random(50));
end
else
begin
Players[CurrentPlayer].Active := False;
LogOut;
Exit;
end;
ForceMapNorth;

If Not(LoggedIn) then
Exit;
end;

Hint: There is 2 logical flaws.

okokokok

2013-06-21 08:42:19

From: Janilabo
Do you see anything wrong with the if..then's in these procedures (taken from your script):

procedure DepositCball;
var x,y,CBallDTM: Integer;
begin
CBallDTM := DTMFromString('mrAAAAHic42BgYMhjguBSKM4F4jQgTgHiLCB+ClRzD4gfAfEbIH4LxO+A+AUQPwFiO0tLBmMDAwZFOTkGAwUFBitTUwZvJyuwOAhzAdXgw4wEMAwAAExZD+s=');

If (PinCheck = True) then
InPin(Players[0].Pin);
InPin(Players[1].Pin);
InPin(Players[2].Pin);
InPin(Players[3].Pin);

If FindDTM(CBallDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
MMouse(x,y,0,0);
Wait(500 + random(50));
Mouse(x,y,0,0,false);
Wait(500 + random(50));

If ChooseOption('re All') then
Wait(300 + random (50));
end;

If Not(LoggedIn) then
Exit;

end;

procedure WithdrawSteelBar;
var x,y,SteelbarDTM: Integer;
begin

SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');

If FindDTM(SteelbarDTM,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
MMouse(x,y,0,0);
Wait(500 + random(50));
Mouse(x,y,0,0,false);
Wait(500 + random(50));

If ChooseOption('aw All') then
Wait(300 + random (50));
CloseBank;
Wait(300 + random(50));
end
else
begin
Players[CurrentPlayer].Active := False;
LogOut;
Exit;
end;
ForceMapNorth;

If Not(LoggedIn) then
Exit;
end;

Hint: There is 2 logical flaws.


The first one is probably this. Couldn't really figure out how to do it differently when i added it and forgot to look for a way to write this in a different way.

  If (PinCheck = True) then
InPin(Players[0].Pin);
InPin(Players[1].Pin);
InPin(Players[2].Pin);
InPin(Players[3].Pin);

The second flaw is probably that I forgot the begin…end in some parts. For example:
    If ChooseOption('re All') then
Wait(300 + random (50));

and

    If ChooseOption('aw All') then
Wait(300 + random (50));
CloseBank;
Wait(300 + random(50));

Janilabo

2013-06-21 09:08:18

From: okokokok
The first one is probably this. Couldn't really figure out how to do it differently when i added it and forgot to look for a way to write this in a different way.

  If (PinCheck = True) then
InPin(Players[0].Pin);
InPin(Players[1].Pin);
InPin(Players[2].Pin);
InPin(Players[3].Pin);

The second flaw is probably that I forgot the begin…end in some parts. For example:
    If ChooseOption('re All') then
Wait(300 + random (50));

and

    If ChooseOption('aw All') then
Wait(300 + random (50));
CloseBank;
Wait(300 + random(50));
Yeah, you got 2 of those correctly.. :) They were the flaws I was pointing to.

About the third one (middle one): You don't need begin..end; IF you have only single (1) action after em.

So, this one over here isn't a flaw at all:
If ChooseOption('re All') then
Wait(300 + random (50));
That works just fine.

Those other ones were, because you had multiple (1+) actions that you wanted to perform after an if..then.

Glad to see you noticed the flaws!

-Jani

okokokok

2013-06-21 09:25:05

From: Janilabo
Yeah, you got 2 of those correctly.. :) They were the flaws I was pointing to.

About the third one (middle one): You don't need begin..end; IF you have only single (1) action after em.

So, this one over here isn't a flaw at all:
If ChooseOption('re All') then
Wait(300 + random (50));
That works just fine.

Those other ones were, because you had multiple (1+) actions that you wanted to perform after an if..then.

Glad to see you noticed the flaws!

-Jani


:D Kind of sloppy to have such mistakes in there…
Anyway updating the script (if allowed?) without capitalisation, a TPA (banking), global variables (what sin pointed out) and the if statement flaws ;)

The Mayor

2013-06-21 16:26:16

From: Sin
Capitalisation: keywords (if/then/begin/end/repeat) look extremely ugly when capitalised. Although it doesnt hinder the script, it's frowned upon.


Looks like Wizzup? doesn't know how to script then :p I reckon it is just personal preference.

From what I have seen of your activity around the forums you are a good guy :) In terms of your script, TPAs/ATPAs are a must, as Sin pointed out. Even if your script works, you have to show us you have the ability to manipulate TPAs/ATPAs to your needs. This is probably one of the biggest requirements imo, seeing as this is a colour script.

Also just out of curiosity, what is the AnvilDTM of in the levelUp function?


From: okokokok
Anyway updating the script (if allowed?)


People have updated their apps in the past and been accepted. I think of it as handing in an exam and then wanting it back to change your answers :p


Good luck!

Sjoe

2013-06-21 16:44:36

From: The Mayor
Looks like Wizzup? doesn't know how to script then :p I reckon it is just personal preference.

From what I have seen of your activity around the forums you are a good guy :) In terms of your script, TPAs/ATPAs are a must, as Sin pointed out. Even if your script works, you have to show us you have the ability to manipulate TPAs/ATPAs to your needs. This is probably one of the biggest requirements imo, seeing as this is a colour script.

Also just out of curiosity, what is the AnvilDTM of in the levelUp function?


Whenever u level up in OSRS u get message in your Chatbox.

Could use ClickToContinue; too.

okokokok

2013-06-22 05:32:27

From: The Mayor


Also just out of curiosity, what is the AnvilDTM of in the levelUp function?

Good luck!


This is indeed to detect the anvil that pops up when you level up smithing.

Anyway I see everything in life as an oppurtunity to learn something. Some should be chased more then others. For me this is an oppurtunity that falls in the "should be chased more" category. This means that if I'm denied membership, I'll know I just haven't learned enough and just continue to learn more. I really enjoy scripting and that is what makes it (fairly) easy to learn. But to perfect your script, you will need alot more experience and patience. This is what I lack at the moment (And willing to improve that :D).

okokokok

2013-06-24 07:20:18

I did make a new version of the script. Added some TPAs(SplitTPAs) for finding the furnace and the bank. I also sped the script up a bit and fixed walking properly now :)

*******************************************************************
********** OkOkOkOk Al-Kharid Cannonballer V3 *********************
*******************************************************************
Proggy for the player: ….
Time running: 87 Minutes
We have gained: 16972 Smithing xp / Thats 11512 Smithing xp per hour
We have done: 26 Loads / Thats 34 Loads per hour
We have made: 2652 Cannonballs / Thats 1828 Cannonballs per hour

Not that bad of a proggy, but I ran out of steel bars.. :)

EDIT: Didn't upload the script, since I'm not sure if I should.

EDIT2: Another proggy:

*******************************************************************
********** OkOkOkOk Al-Kharid Cannonballer V3 *********************
*******************************************************************
Proggy for the player: …
Time running: 119 Minutes
We have gained: 21667 Smithing xp / Thats 10813 Smithing xp per hour
We have done: 36 Loads / Thats 18 Loads per hour
We have made: 3610 Cannonballs / Thats 1801 Cannonballs per hour

And the script (Since this is the most stable script I've ever made and I'm freaking proud :D):
program OkOkOkOk_AKCBaller_Application_Version3;
{$DEFINE SMART8}
{$DEFINE SimbaDebug}
{$I SRL-OSR/SRL.Simba}
{$i SRL-OSR\SRL\misc\debug.simba}


var
x,y,t,Timeout,LoadsDone,Loads ,LoadsPerHour ,CBallsMade,CBallsPH, TimeDone, CurrentXP, OriginalXP, XPGain, XPGainPH: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Pin := '';
Players[0].Active:= True;
Players[0].LampSkill := Skill_Prayer;

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Pin := '';
Players[1].Active:= True;
Players[1].LampSkill := Skill_Prayer;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Pin := '';
Players[2].Active:= True;
Players[2].LampSkill := Skill_Prayer;

Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Pin := '';
Players[3].Active:= True;
Players[3].LampSkill := Skill_Prayer;
end;

////////////////////////////////////////////
/////////// AntiBan Procedure ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

procedure AntiBan;
begin

FindNormalRandoms;
case Random (1500) of
0..15: RandomRClick;
50..65: PickUpMouse;
90..105: RandomRClick;
115..120: RandomMovement;
160..180: ExamineInv;
230..250:
begin
HoverSkill('smithing', false);
sleepandmovemouse(276 + Random(100));
PickUpMouse;
ChooseOption('Cancel');
SetAngle(SRL_ANGLE_HIGH);
end;
300..320: BoredHuman;
350..390: PickUpMouse;
420..450: RandomRClick;
280..299: RandomMovement;
460..480: SleepAndMoveMouse(3000 + Random(500));
end;
end;

/////////////////////////////////////////////
/////////// GetXP Adjustment ///////////
/////////// Adjusted by OkOkOkOk ///////////
/////////////////////////////////////////////

function GetXPCustom(skill: variant): integer;
var
MouseTB,b: TBox;
rcc: TPoint;
tpa: TPointArray;
begin
result := -1;

if(not TabExists(tab_Stats)) or (not gameTab(tab_Stats)) then
exit;

rcc:= SkillToPoint(skill);
MouseTB := SkillBoxCoords(rcc.x,rcc.y);
if (MouseTB.X1 < 1) then
exit;

MMouse(MouseTB.X1+2,MouseTB.Y1+2, 1, 1);
wait(400 + random(200));

if (WaitFindColors(tpa, 10551295, MIX1, MIY1, MIX2, MIY2, 0, 3000)) then
begin
b := getTPABounds(tpa);
wait(450 + random(150));
result := strToIntDef(getNumbers(GetTextAtExWrap(b.x1+15, b.y1+2,b.x2-2,
b.y1+13, 0, 5, 1, 0, 0, 'smallChars07')), -1);
end;
end;

////////////////////////////////////////////
/////////// Proggy Report ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

procedure ProgressReport;
begin
ClearDebug;
Loads := (LoadsDone);
TimeDone := (GetTimeRunning/1000);
LoadsPerHour := (3600 * (Loads) / (TimeDone));
CurrentXP := GetXPCustom('smithing');
XPGain := (CurrentXP - OriginalXP);
XPGainPH :=(3600 * (XPGain)) / ((TimeDone));
CBallsMade := (XPGain / (640/100));
CBallsPH := (3600 * (CBallsMade) / (TimeDone));
begin
Writeln('*******************************************************************');
Writeln('********** OkOkOkOk Al-Kharid Cannonballer V3 *********************');
Writeln('*******************************************************************');
Writeln('Proggy for the player: ' + Players[0].Nick + '');
Writeln('Time running: ' + IntToStr(GetTimeRunning/60000) + ' Minutes ');
Writeln('We have gained: ' + IntToStr(XPGain) + ' Smithing xp / Thats ' + IntToStr(XPGainPH) + ' Smithing xp per hour ');
Writeln('We have done: ' + IntToStr(Loads) + ' Loads / Thats ' + IntToStr(LoadsPerHour) + ' Loads per hour ');
Writeln('We have made: ' + IntToStr(CBallsMade) + ' Cannonballs / Thats ' + IntToStr(CBallsPH) + ' Cannonballs per hour');
end;
end;

//////////////////////////////////////////////////////
/////////// Epic Ultimate North Functions ///////////
/////////// Made by Flight ///////////
//////////////////////////////////////////////////////

{*******************************************************************************
Function GenerateWallDTM(WallType, WallLength: Integer): Integer;
By: Flight
Description: Creates a DTM of a perfectly straight wall.
-WallType : 1 for vertical, 2 for horizontal
-WallLength: Length of the DTM to be generated
*******************************************************************************}
function GenerateWallDTM(WallType, WallLength: Integer): Integer;
var
i: Integer;
TempTDTM: TDTM;
mPnt: TDTMPointDef;
sPnts: array of TDTMPointDef;
begin
SetArrayLength(sPnts, (WallLength-1));
mPnt.x := 0;
mPnt.y := 0;
mPnt.AreaSize := 0;
mPnt.AreaShape := 0;
mPnt.Color := 16119287;
mPnt.Tolerance := 40;

for i:=0 to High(sPnts) do
begin
case WallType of
1:
begin
sPnts[i].x := 0;
sPnts[i].y := i+1;
end;
2:
begin
sPnts[i].x := i+1;
sPnts[i].y := 0;
end;
end;
sPnts[i].AreaSize := 0;
sPnts[i].AreaShape := 0;
sPnts[i].Color := 16119287;
sPnts[i].Tolerance := 40;
end;

TempTDTM.MainPoint := mPnt;
TempTDTM.SubPoints := sPnts;
Result := AddDTM(TempTDTM);
end;

{*******************************************************************************
Function GetLongestWallLength(WallType: Integer): Integer;
By: Flight
Description: Determines the longest wall on your MM at any compass angle.
-WallType: 1 for vertical walls, 2 for horizontal walls
*******************************************************************************}
function GetLongestWallLength(WallType: Integer): Integer;
var
B: TBox;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
ColorToleranceSpeed(1);

FindColorsSpiralTolerance(MMCX, MMCY, TPA, 16119287, MMX1, MMY1, MMX2, MMY2, 40);
if (Length(TPA)<1) then
Exit;

RAaSTPA(TPA, 1);
if (WallType = 1) then
SplitTPAExWrap(TPA, 2, 3, ATPA)
else
SplitTPAExWrap(TPA, 3, 2, ATPA);

SortATPASize(ATPA, True);
B := GetTPABounds(ATPA[0]);
if (WallType = 1) then
Result := (B.Y2-B.Y1)
else
Result := (B.X2-B.X1);
end;

{*******************************************************************************
Function ForceMapNorth: Boolean;
By: Flight
Description: Using auto-generated wall DTMs, this function will attempt to
rotate the compass to near-perfect north. Should it fail it will revert
back to default north.
*******************************************************************************}
Function ForceMapNorth: Boolean;
var
Left: Boolean;
StartAngle: Extended;
X,Y,DTM_VertWall,
DTM_HorWall,T,F,L1,L2: Integer;
label
Start,FuncEnd;
begin
Result := False;
L1 := GetLongestWallLength(1);
L2 := GetLongestWallLength(2);
if (L1 > 50) then
L1 := 50;
if (L2 > 50) then
L2 := 50;

DTM_VertWall := GenerateWallDTM(1, Round(L1*0.85)); //Create a DTM 85% of the length of the longest vertical wall
DTM_HorWall := GenerateWallDTM(2, Round(L2*0.85)); //Create a DTM 85% of the length of the longest horizontal wall

if (FindDTM(DTM_VertWall, X, Y, MMx1, MMy1, MMx2, MMy2) or
FindDTM(DTM_HorWall, X, Y, MMx1, MMy1, MMx2, MMy2)) then
begin
Result := True;
GoTo FuncEnd;
end;

StartAngle := (rs_GetCompassAngleDegrees);
Left := (Round((360 - StartAngle)) mod 360 <= Round((StartAngle + 360)) mod 360);

Start:
if (F > 0) then
MakeCompass('N');

MarkTime(T);
Repeat
TypeByte((Ord(not Left) * 2) + 37); //No holding down, actually press the arrow key
if (FindDTM(DTM_VertWall, X, Y, MMx1, MMy1, MMx2, MMy2) or
FindDTM(DTM_HorWall, X, Y, MMx1, MMy1, MMx2, MMy2)) then
break;
Until(TimeFromMark(T) >= 1000)

FuncEnd:
if ((not FindDTM(DTM_VertWall, X, Y, MMx1, MMy1, MMx2, MMy2)) and
(not FindDTM(DTM_HorWall, X, Y, MMx1, MMy1, MMx2, MMy2))) then
begin
Inc(F);
StartAngle := (rs_GetCompassAngleDegrees);
Left := (Round((360 - StartAngle)) mod 360 <= Round((StartAngle + 360)) mod 360);
if (F < 2) then
GoTo Start;
end else if ((X > 1) and (Y > 1)) then
Result := True;

if not Result then
MakeCompass('N');
FreeDTM(DTM_VertWall);
FreeDTM(DTM_HorWall);
end;

////////////////////////////////////////////
/////////// LevelUpCheck Function //////////
/////////// Made by OkOkOkOk //////////
////////////////////////////////////////////

function LevelUpCheck: Boolean;
var AnvilDTM: Integer;
begin
AnvilDTM := DTMFromString('mwQAAAHic42RgYHABYnUgNgNidyCOBOJYIA4CYjsgNgBiRyYGBiMg1oFiPSAOAeJIII6CstMT4hliw8MZArw9wdjdyQmOo0JCwGJcQLMIYUYiMBwAADqZDXE=');

if finddtm(AnvilDTM,x,y,4,342,516,476) then
begin
writeln('Leveled up!');
result := true;
end;
freedtm(AnvilDTM);
end;

////////////////////////////////////////////
/////////// Smelt Procedures ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

Function NoSteelBar: Boolean;
var SteelbarDTM: Integer;
begin
SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');

if not(finddtm(SteelbarDTM,x,y,MIX1,MIY1,MIX2,MIY2)) then
result := true;

freedtm(SteelbarDTM);
end;

Function SteelBarInBank: Boolean;
var SteelbarDTM: Integer;
begin
SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');

if finddtm(SteelbarDTM,x,y,MSX1,MSY1,MSX2,MSY2) then
result := true;

freedtm(SteelbarDTM);
end;

Function FindFurnace(var x,y: Integer): Boolean;
var
Fx, Fy: Integer;
FurnaceTPA: TPointArray;
FurnaceATPA: T2DPointArray;
i: Integer;
begin
if FindColorsSpiralTolerance(Fx,Fy,FurnaceTPA,3355448,MSX1,MSY1,MSX2,MSY2,1) then
begin
FurnaceATPA := SplitTPA(FurnaceTPA,100);
for i := 0 to High(FurnaceATPA) do
begin
if MiddleTPAEX(FurnaceATPA[i],Fx,Fy) then
mmouse(Fx,Fy,9,9);
if isuptext('eel ba') then
begin
Fx := x;
Fy := y;
result := true;
end;
exit;
end;
end;
end;

Procedure ClickFurnace;
begin
if (FindFurnace(x,y)) then
begin
wait(200 + random(50));
clickmouse2(mouse_left);
wait(4200 + random(200));
end;
end;

procedure SmeltCball;
var SteelBarDTM,SteelBarAfterFurnaceDTM,t,Timeout: Integer;
begin
MarkTime(t);
Timeout := RandomRange(170000, 173000);

AntiBan;
SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');
SteelBarAfterFurnaceDTM := DTMFromString('mWAAAAHicY2FgYHgPxF+B+A+UvY6RgWEBEC8C4rlAfHrXVAY7S0s45gKqQcaMaBgEAJNhCrs=');

gametab(tab_inv);
if finddtm(SteelBarDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
mmouse(x,y,3,3);
wait(300 + random(50));
mouse(x,y,3,3,true);
wait(600 + random(100));
ClickFurnace;
wait(300 + random(500));

if finddtm(SteelBarAfterFurnaceDTM,x,y,4,342,516,476) then
begin
wait(250 + random(50));
mmouse(x,y,3,3);
wait(600 + random(100));
mouse(x,y,3,3,false);
wait(100 + random(50));

if chooseoption('ake All') then
repeat
begin
wait(30 + random(20));
if FindNormalRandoms then
break;
end;
until (NoSteelBar = true) or (LevelUpCheck = True) or (TimeFromMark(t) > Timeout);
Inc(LoadsDone);
end
else
begin
Players[CurrentPlayer].Active := False;
LogOut;
Exit;
end;
end;

ProgressReport;

if not(loggedin) then
Exit;

freedtm(SteelBarAfterFurnaceDTM);
freedtm(SteelBarDTM);
end;

////////////////////////////////////////////
/////////// PinCheck Function ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

Function PinCheck: Boolean;
var ChestDTM, CoinsDTM: Integer;
begin
ChestDTM := DTMFromString('mwQAAAHic42RgYNjEyMAwC4iXAfFmIN4DxHuh7KVAPBeI1wPVTQbiSVB6BUgfEO+B4rVA/OxhMMOOjiyGGVmhDG56KgwVgXYMevIiYDaIBolzAdURwoxEYDgAADgAFdo=');
CoinsDTM := DTMFromString('m6wAAAHic42ZgYLjOyMCwDYiPAPF5IL4LxE+A+D0QPwbiO0B8FYhPAfF9oPpXQPwOiP8AMSNQ7DmQfgzEt4H4HBBfBuJrQFyUwsOQGsHNwM/Hx9BZIcgQ6s3LYGbABxYDsUHyirL8YJoLqJ5YzEgCRgIAJp0aHQ==');

if finddtm(ChestDTM,x,y,MSX1,MSY1,MSX2,MSY2) or
finddtm(CoinsDTM,x,y,MSX1,MSY1,MSX2,MSY2) then

begin
result := true;
end;
freedtm(ChestDTM);
freedtm(CoinsDTM);
end;

/////////////////////////////////////////////////
/////////// Banking Procedures Report ///////////
/////////// Made by OkOkOkOk ///////////
/////////////////////////////////////////////////

Function FindBooth(var x,y: Integer): Boolean;
var
Bx, By: Integer;
BoothTPA: TPointArray;
BoothATPA: T2DPointArray;
i: Integer;
begin
if FindColorsSpiralTolerance(Bx,By,BoothTPA,3355448,MSX1,MSY1,MSX2,MSY2,1) then
begin
BoothATPA := SplitTPA(BoothTPA,100);
for i := 0 to High(BoothATPA) do
begin
if MiddleTPAEX(BoothATPA[i],Bx,By) then
mmouse(Bx,By,1,1);
if isuptext('ooth') then
begin
Bx := x;
By := y;
result := true;
end;
exit;
end;
end;
end;

Procedure OpenBankBooth;
begin
repeat
if (FindBooth(x,y)) then
begin
wait(200 + random(50));
clickmouse2(mouse_left);
wait(900 + random(200));
end;
until (bankscreen) or (SteelBarInBank = true) or not(loggedin) or (PinCheck = true);
end;

procedure DepositCball;
var CBallDTM: Integer;
begin
CBallDTM := DTMFromString('mrAAAAHic42BgYMhjguBSKM4F4jQgTgHiLCB+ClRzD4gfAfEbIH4LxO+A+AUQPwFiO0tLBmMDAwZFOTkGAwUFBitTUwZvJyuwOAhzAdXgw4wEMAwAAExZD+s=');

if (PinCheck = true) then
inpin(Players[CurrentPlayer].Pin);

if finddtm(CBallDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
mmouse(x,y,3,3);
wait(500 + random(50));
mouse(x,y,3,3,false);
wait(500 + random(50));

if chooseoption('re All') then
wait(300 + random (50));
end;
if not(loggedin) then
Exit;

end;

procedure WithdrawSteelBar;
var SteelbarDTM: Integer;
begin

SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');

if finddtm(SteelbarDTM,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
mmouse(x,y,3,3);
wait(500 + random(50));
mouse(x,y,3,3,false);
wait(500 + random(50));

if chooseoption('aw All') then
begin
wait(300 + random (50));
closebank;
wait(300 + random(50));
end;
end;

if not(LoggedIn) then
Exit;
end;

////////////////////////////////////////////
/////////// Walking Procedures ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

procedure ToFurnace;
begin
setrun(True);
symbolaccuracy := 0.5;
if findsymbol(x,y,'Kebab shop') or
findsymbol(x,y,'cook') then
begin
mouse(x,y,0,0,true);
FFlag(0);
wait(1000 + random(100));
end;
symbolaccuracy := 0.8;


symbolaccuracy := 0.5;
if findsymbol(x,y,'furnace') then
begin
mouse(x,y,0,0,true);
FFlag(0);
wait(800 + random(100));
end;
symbolaccuracy := 0.8;

if not(LoggedIn) then
Exit;
end;

procedure ToBank;
begin
setrun(True);

symbolaccuracy := 0.5;
if findsymbol(x,y,'Kebab shop') then
begin
mouse(x,(y + 45),0,0,true);
FFlag(0);
wait(800 + random(100));
end;
symbolaccuracy := 0.8;

symbolaccuracy := 0.4;
if findsymbol(x,y,'bank') then
begin
mouse(x,y,0,0,true);
FFlag(0);
wait(800 + random(100));
end;
symbolaccuracy := 0.8;

if not(LoggedIn) then
Exit;
end;

////////////////////////////////////////////
/////////// Final Procedures ///////////
/////////// Made by OkOkOkOk ///////////
////////////////////////////////////////////

procedure Banking;
begin
OpenBankBooth;
DepositCball;
WithdrawSteelBar;
end;

Procedure WalkingAndBanking;
begin
ToBank;
Banking;
ToFurnace;
end;

procedure OneRun;
begin
repeat
repeat
setangle(SRL_ANGLE_HIGH);
AntiBan;
FindNormalRandoms;
SmeltCBall;
WalkingAndBanking;
until (not(LoggedIn));

NextPlayer(Players[CurrentPlayer].Active);
until False;
end;

begin
DeclarePlayers;
SetupSRL;
LoginPlayer;
ForceMapNorth;
OriginalXP := GetXPCustom('smithing');
SRL_CombatRandoms := True;
ClearDebug;
begin
repeat
OneRun;
until(false);
end;
end.

DemiseScythe

2013-07-15 15:47:12

http://villavu.com/forum/showthread.php?t=77691

Read the above DTM Tutorial. I would only bother with chapters 1-3 as there are currently better methods for walking and finding objects. Once you get the hang of DTMs, item finding becomes easy. Try to use this technique at least a few more times in your future scripts the next time you try to apply. Until then, keep improving and more importantly, have fun while doing it.

The one thing I would comment the most about your DTM usage is that you load them hundreds of times. Instead of loading them each time a function is called, load them all in the beginning and free them at the end. Helps prevent memory leaks and its just more proper.

Instead of:
Function NoSteelBar: Boolean;
var SteelbarDTM: Integer;
begin
SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+');

if not(finddtm(SteelbarDTM,x,y,MIX1,MIY1,MIX2,MIY2)) then
result := true;

freedtm(SteelbarDTM);
end;

I would do something like:


var SteelbarDTM: Integer; // global var

Function NoSteelBar: Boolean; // function you can call anytime
begin
if not(finddtm(SteelbarDTM,x,y,MIX1,MIY1,MIX2,MIY2)) then
result := true;
end;

////// Main Script loop //////
SteelbarDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIBuIcIC4B4kIgzgbiDCD+C5RnYWRgYAdiBiD+yQDB/4C4srCAwc7SEoxBbBgO8PZk4ALK48KMeDAUAACcIQ7+'); // near the begining.

NoSteelBar; // Can be called anytime during the script.

freedtm(SteelbarDTM); // near the end.

Then that particular DTM is only loaded once during the entire script, yet as it is a global var, you will be able to use it anytime prior to freeing the DTM.

Justin

2013-07-19 07:28:47

Didn't make it this time. Take the suggestions given to you above, check out the tutorial island section and feel free to apply in 4 weeks time. Good start though.

Cheers

Justin.