SRL Archive - OSR Help

Help with climbing ladder


littlered

2012-05-22 14:52:28

First of all I will just say 'Hey everyone' as this is my first thread :-P

As I said im new here, I wasnt planning on writing any threads until I had
contributed something to the community, but things change :-( .

I am currently writing my first script, a mithril and adamant miner for the mining guild resource dungeon.

As far as I know I have the majority of the script working but I have a couple of questions if anyone can help me.

1. What would be the best way to find and click the ladders to leave the mining guild? Is it possible to create a box around the ladders so that it only searches inside that box?

If I did this would I have to make my script always select north etc. to find the box? And if yes would this cause an increased chance of ban, what with it doing the same thing every time (bot like)?

2. I want the script to walk around the mine so it finds the other rocks, due to the addy being on one side and the majority of the mithril at the other side, at the moment the script tends to just camp at one or the other, what would you suggest for this?

Any help is greatly appreciated, and thanks for your time even just reading this

Littlered

Abu

2012-05-22 17:29:32

For 1, yes it is possible but you must keep your camera angle at a certain angle, preferably use ClickNorth(0);
It is bot like but the truth is - I doubt Jagex monitor how you move your camera.

To make the box, imagine a box around the ladders which is big enough to deal with small camera changes.
Now use the color picker tool to select the top-left corner of this imaginary box. Then select the bottom right.
You should now have two co-ordinates, ie; four numbers
When using your color finding function, replace xs, ys, xe and ye with these four numbers.
It will now search within your box.


For the second point - walk around I guess; use RadialWalk.

littlered

2012-05-23 15:51:01

Thanks! Going to try this out soon! And yeah I know I need to walk around but how would.i script it?

Maybe something like:

if findOre = false then
Begin
Radialwalk;

A very crude example but you get the point lol

Btw thanks again!

Littlered

putonajonny

2012-05-23 17:36:48

For the ladder your best bet is to use something like:
  {.include ObjectDTM/ObjDTMInclude.simba}  //if it isn't already

Function FindAndClickLadded : Boolean;
Var
A : array of MMObj;
P : TPoint;
begin

A := GatherMiniMapObjects([MM_LADDER]);
if(GetArrayLength(A) = 0)then
exit;
for i := low(A) to high(A) do
begin
P := A[i].Center;
P := MMtoMS(P);
x := P.x;
y := P.y;
if(FindColorSpiralTolerance(x, y, LadderColour, MSX1, MSY1, MSX2, MSY2, 10))then
begin
MouseBox(x - 5, y - 5, x + 5, y + 5, mouse_move);
if(WaitUpTextMulti(['Ladder', 'adder'], 200+Random(500)))then
begin
ClickMouse2(mouse_Left);
Result := True;
exit;
end;
end;
end;

end;

Let me know if you don't understand anything

xtrapsp

2012-05-24 06:34:23

You could always use the function up op and add paint :) this would make it so that you know what its found? Or add DEBUG paint?