SRL Archive - OSR Help

What is going wrong here?


Athylus

2014-07-01 17:39:41

Hey all. Nearly finished my woodcutting script and I am planning on sharing it with the community as well, because if this part is done then it works like a charm. Gets you those early lvls you know. Here is the code:

procedure ChopTree;
var
x, y, Retry: Integer;

begin

Retry := 0;

repeat
if not Chopping then
begin
begin
FindNormalRandoms;
Inc(Retry);
WriteLn('Attempt number ' + Retry + ' to find the tree');
if(Retry > 3) then //Line 168
begin
WriteLn('Could not find tree, walking to trees');
Exit;
end;
end;
if FindObj(x, y, 'hop do', TreeColor, 5) then
begin
WriteLn('Tree found');
Mouse(x, y, 5, 5, false);
ChooseOption('Chop down');
Wait(200 + random(450));
end;
end else
begin
WriteLn('Chopping...');
Wait(200);
end;
until(InvFull);
end;

Type mismatch at line 168. What's going on? Here's basically what I want: I want this procedure to look for trees, and if it doesn't find them in 3-4 tries then I want it to exit and go to the next part in the main loop.

Haxz

2014-07-01 17:43:22

If Retry > 3

Athylus

2014-07-01 17:46:53

lulz… thanks. *slaps forehead*

Edit: Still same error.

Haxz

2014-07-01 17:49:28

Your first script? Congrats :D

Athylus

2014-07-01 17:56:37

Third, made a potato picker about a year ago (god that script sucked balls). Made a tanner earlier, and this is my third script! So I'm proud, it's doing good so far. Thanks!

KeepBotting

2014-07-01 19:18:22

what's line 168?

Athylus

2014-07-01 19:27:06

I put a //line 168 to the right of it, thought it was clear. Let me edit. It is "If(Retry > 3) then"

masterBB

2014-07-01 19:27:28

WriteLn('Attempt number ' + IntToStr(Retry) + ' to find the tree');

Athylus

2014-07-01 19:31:53

It's compiled now, going to test it tomorrow. Thanks a lot Bart!

(Super gozer, dankjewel!!)

rj

2014-07-01 20:41:17

From: Athylus
It's compiled now, going to test it tomorrow. Thanks a lot Bart!

(Super gozer, dankjewel!!)


off topic: dank jewel? Are we talking about some good weed here or what?

KeepBotting

2014-07-01 21:54:13

From: Robert
off topic: dank jewel? Are we talking about some good weed here or what?

It's Dutch. It means useful knowledge.

Ian

2014-07-01 22:17:53

From: KeepBotting
It's Dutch. It means useful knowledge.


Doesn't it mean thank you?

KeepBotting

2014-07-01 22:20:55

From: BMWxi
Doesn't it mean thank you?


Google Translate sucks ass.

Athylus

2014-07-02 08:26:42

Haha yeah I noticed he was dutch. I basically said: "Great lad, thank you!"

Anyway, going to test it right now.

Edit: Minor problem just showed up… is it possible to make an area out of tiles and then check if you are in that area?

KeepBotting

2014-07-02 20:55:02

From: Athylus
Haha yeah I noticed he was dutch. I basically said: "Great lad, thank you!"

Anyway, going to test it right now.

Edit: Minor problem just showed up… is it possible to make an area out of tiles and then check if you are in that area?

sps.getPlayerPos()

Athylus

2014-07-06 16:26:18

From: KeepBotting
sps.getPlayerPos()

Thanks, but I'm using R_inPolygon now. :) I've tried SPS b4 but couldnt make it work. Is it more accurate than reflection though? I noticed reflection can click like 5 tiles away from the position I indicated.

KeepBotting

2014-07-06 18:05:18

From: Athylus
Thanks, but I'm using R_inPolygon now. :) I've tried SPS b4 but couldnt make it work. Is it more accurate than reflection though? I noticed reflection can click like 5 tiles away from the position I indicated.
SPS is less accurate than reflection afaik, SPS walking isn't tile-based whereas reflection walking is.

Athylus

2014-07-07 17:40:19

From: KeepBotting
SPS is less accurate than reflection afaik, SPS walking isn't tile-based whereas reflection walking is.

Right, better use reflection then.

Btw, I'm trying to find a door now but the colors are all the same and the mouse goes around from table to ladder to window until it finds the door. I can't single out the colors with color aid. I've followed a tutorial on TPA but it still does it, what do I do now? The mouse moves around a lot and it's so botlike. :\

Yago

2014-07-07 22:20:02

From: Athylus
Btw, I'm trying to find a door now but the colors are all the same and the mouse goes around from table to ladder to window until it finds the door. I can't single out the colors with color aid. I've followed a tutorial on TPA but it still does it, what do I do now? The mouse moves around a lot and it's so botlike. :\


Post a little picture of the area.

Athylus

2014-07-08 10:31:55

From: Yago
Post a little picture of the area.


Here it is. I feel like writing a decent bot in simba is so hard, I've tried some injection bot before and it was pretty much flawless but got me banned quickly.

[ATTACH=CONFIG]23520[/ATTACH]

Okay so I managed to 'isolate' the door.
procedure MarkTPointArray();
var
TPointsDoor: TPointArray;
ATPA: T2DPointArray;

OGCTS: Integer;
OGHueMod, OGSatMod: Extended;

begin
OGCTS := GetColorToleranceSpeed();
GetColorSpeed2Modifiers(OGHueMod, OGSatMod);

SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.88);

if FindColorsTolerance(TPointsDoor, 4552070, MSX1, MSY1, MSX2, MSY2, 6) then
begin
SMART_DrawDots(TPointsDoor);
ATPA := TPAtoATPAEx(TPointsDoor, 25, 25);
SortATPASize(ATPA, true);
FilterTPAsBetween(ATPA, 1, 150);
SMART_DebugATPA(False, ATPA);
end;

SetColorToleranceSpeed(OGCTS);
SetColorSpeed2Modifiers(OGHueMod, OGSatMod);
end;
However I will still have to check for uptext and this means moving the mouse to the door every time, so now my question is does this matter a lot (ban wise)? Can I do it in a different way so that I wont have to check for uptext every single time?

Also it still finds the table sometimes. And I have to set my compass to east standard every single time, high ban rate for that right?

I don't know how to move my mouse to the box I've created either :\ MMouse(ATPA[r].x, ATPA[r].y, 2, 2); doesn't work.

EDIT: I figured one thing out. If I can find the one box that smart draws on my screen then the door is open, and if it doesn't it's closed. Is it possible to implement this? That way I won't have to check for uptext even if it's open.