SRL Archive - Outdated / Broken

IPowerMiner


Daniel

2008-01-19 20:33:44

Well, here is the updated version to Revision 10. Please post feedback, because this script, when i was testing, could not find the iron ores in Al-Kharid Mines, it just kept moving it's mouse to clothes.

So, suggestions are appreciated before i release to the Junior Members.

~IP-Drowner

Removed: Removed Username and Password. Thanks Daniel.Blaze :)

Daniel.Blaze

2008-01-19 21:36:21

you left ur pass in the script.

PM me for the new one

Daniel

2008-01-19 21:38:30

Thanks :o

HyperSecret

2008-01-20 16:17:23

may i suggest not using your own include files…just put the functions in the script and use them…i personally wouldnt use because i dont like to go searching for files and placing extra files places and such

in loadcolours procedure you could use a case statement

for FindColorsMulti you could use a TIntegerArray instead of doing all the if find or find or ect…

function FindColorsMulti(Colors: TIntegerArray; xs, ys, xe, ye, ToleranceLevel: Integer): Boolean;
var i: Integer;
begin
for i := 0 to Length(Colors) do
begin
if(FindColorTolerance(x,y,Colors[i],xs,ys,xe,ye,ToleranceLevel)) then Result:=True;
end;
end;

//Use like such

FindColorsMulti([6454502, 486821, 45376580], xs, ys, xe, ye, ToleranceLevel)

just my little things about it, keep it up

Daniel

2008-01-20 21:09:30

From: HyperSecret
may i suggest not using your own include files…just put the functions in the script and use them…i personally wouldnt use because i dont like to go searching for files and placing extra files places and such

in loadcolours procedure you could use a case statement

for FindColorsMulti you could use a TIntegerArray instead of doing all the if find or find or ect…

function FindColorsMulti(Colors: TIntegerArray; xs, ys, xe, ye, ToleranceLevel: Integer): Boolean;
var i: Integer;
begin
for i := 0 to Length(Colors) do
begin
if(FindColorTolerance(x,y,Colors[i],xs,ys,xe,ye,ToleranceLevel)) then Result:=True;
end;
end;

//Use like such

FindColorsMulti([6454502, 486821, 45376580], xs, ys, xe, ye, ToleranceLevel)

just my little things about it, keep it up

So that is how you use TIntegerArray. I tried doing that but it gave me a not enough parameters in script error. Thanks, so i put it in [ & ].

nielsie95

2008-01-24 04:11:47

If you change


RColour : array[1..5] of Integer;
GColour : array[1..6] of Integer;
MSymbol : array[0..4] of Integer;

//TO

RColour, GColour, MSymbol: TIntegerArray;

//And load them like this:

RColour := [5279663, 3695995, 5939396, 5147562, 5015461];



Also it's better to use a case in LoadColours. And what if the user enters for example 'iron' or 'RUNITE'? Then it wont load the colors, so use LowerCase(Players[CurrentPlayer].Strings[0]) to make sure you know what the user means.





1: FindNormalRandoms;
2: FindLamp(Players[CurrentPlayer].Strings[1]); //Middle of the script!

If there's a lamp, FindNormalRandoms will solve it first. So the FindLamp is a bit useless like this, either do FindLamp before FNR or just dump it.




If you make the dtms of your axes an array, you can optimize IP_DetectAxe by using a for-to-do loop.


if(IP_DetectAxe='UW') then
begin
DropToPosition(2,28);
LoadsDone:=LoadsDone+1;
OresMined:=OresMined+27;
ReportVars[0]:=ReportVars[0]+1;
ReportVars[1]:=ReportVars[1]+27;
end;
if(not(IP_DetectAxe='UW')) then
begin
DropAll;
LoadsDone:=LoadsDone+1;
OresMined:=OresMined+28;
ReportVars[0]:=ReportVars[0]+1;
ReportVars[1]:=ReportVars[1]+28;
end;

This will call IP_DetectAxe twice, it's better to use end else here.






{Unsure how to update to SRL[4] Revision #10
procedure GetCompassChange(Angle: String);
begin
case LowerCase(Angle) of
'n' : if(FindCompassAngle=0) then Writeln('Compass Angle is already at specified point.') else MakeCompass('n');
's' : if(FindCompassAngle=180) then Writeln('Compass Angle is already at specified point.') else MakeCompass('s');
'w' : if(FindCompassAngle=90) then Writeln('Compass Angle is already at specified point.') else MakeCompass('w');
'e' : if(FindCompassAngle=270) then Writeln('Compass Angle is already at specified point.') else MakeCompass('e');
end;
end;}

MakeCompass checks if it isn't already on the correct point ;)





function GetActivePlayers: Boolean;
var p: integer;
begin
for p:=0 to HowManyPlayers-1 do
if (Players[p].Active=True) then Exit;
Result := True;

Lil' bit shorter :p






NickNameBMP := CreateBitmapMaskFromText(Players CurrentPlayer].Nick, UpChars)

LoginPlayer (so also NextPlayer) does this for you.




Something about standards:

procedure show;
var //notice the enter after this?
x, y: Integer;
begin
if True then
begin //same startpoint as line above
x := 0;
repeat //same startpoint as line above
y := 0;
until True;
end;
end;