SRL Archive - OSR Help

Need assistance with DTMs


Roflme

2012-06-19 16:55:42

So I'm working on a fletching script at the moment. This is what I have so far:
program RoflmeFletcher;

{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i SRL\SRL\Misc\Debug.simba}
var

Bow, Knife, LogsCut: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Active := true;
end;
end;

Procedure AntiBan;
begin
Case Random(500) of
0..2: HoverSkill('Fletching', false);
3: GameTab(23);
4..10: RandomMovement;
11..20: BoredHuman;
21..400: Wait(100+Random(75));
end;
SetAngle(SRL_ANGLE_HIGH);
Wait(200+Random(200));
end;

Procedure Bank;
begin
Writeln('Done fletching, finding bank...');
begin
repeat
SetAngle(SRL_ANGLE_HIGH);
OpenBankChest(SRL_BANK_SW);
until BankSCreen or PinScreen;
end;

if PinScreen then
begin
repeat
InPin(Players[0].Pin);
until BankScreen
end;

if BankScreen then
begin
Writeln('Successfully found bank');
Wait(520+random(209));
DepositAll;
Wait(305+random(107));
Withdraw(0, 0, 28);
Wait(503+random(212));
Closebank;
end;
end;

procedure Cut;
var
x, y: Integer;
begin
MouseItem(RandomRange(1,28),mouse_Left);
Wait(2000+random(200));

Knife := DTMFromString('mQwAAAHicY2ZgYGAHYkEGCBCC0vJA7KLDyVBfVcUQ5O/PgAwYkTAQAABvOwMs');
Bow := DTMFromString('mQwAAAHicY2ZgYBBggAAZIOaCsqWBeMX0iQyNJQUMNfnZDMiAEQkDAQCuPwTj')

if FindDTM(Knife, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
Writeln('Found Knife');
MoveMouse(x, y);
ClickMouse2(true);
end;

if FindDTM(Bow, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('Found longbow image');
MoveMouse(x, y);
ClickMouse2(true);
Writeln('Fletching bows now');
end;

FreeDTM(Knife);
FreeDTM(Bow);


Antiban;
Writeln('Waiting for inventory to be finished...');
Wait(54321+random(2222));
LogsCut := LogsCut + 28;
FindNormalRandoms;
end;

procedure Report;
begin
ClearDebug;
Writeln('Roflme''s Fletcher');
Writeln('Logs Cut:' + IntToStr(LogsCut));
Writeln('Script has run for ' + TimeRunning);
end;



begin
Cleardebug;
Smart_Server := 9;
Smart_Members := false;
Smart_Signed := false;
Smart_SuperDetail := false;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
repeat
Bank;
Cut;
Report;
until(false);
end.

Every time I run the script, it can bank and withdraw the logs just fine. I'm having problems with the Cut procedure:

procedure Cut;
var
x, y: Integer;
begin
MouseItem(RandomRange(1,28),mouse_Left);
Wait(2000+random(200));

Knife := DTMFromString('mQwAAAHicY2ZgYGAHYkEGCBCC0vJA7KLDyVBfVcUQ5O/PgAwYkTAQAABvOwMs');
Bow := DTMFromString('mQwAAAHicY2ZgYBBggAAZIOaCsqWBeMX0iQyNJQUMNfnZDMiAEQkDAQCuPwTj')

if FindDTM(Knife, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
Writeln('Found Knife');
MoveMouse(x, y);
ClickMouse2(true);
end;

if FindDTM(Bow, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('Found longbow image');
MoveMouse(x, y);
ClickMouse2(true);
Writeln('Fletching bows now');
end;

FreeDTM(Knife);
FreeDTM(Bow);


Antiban;
Writeln('Waiting for inventory to be finished...');
Wait(54321+random(2222));
LogsCut := LogsCut + 28;
FindNormalRandoms;
end;

My problem is, every time I load up the DTMs into the DTM Editor, they'll never match. When I open simba, and first create the DTM, I will then load the desktop image from multiple locations and camera views just to make sure the DTM matches. Then when I try to run the script, the script gets stuck at that same part: trying to click on the knife/bow.

But the part that frustrates me is when I then go back into the DTM editor and make sure the DTM is still working, it doesn't anymore! The same DTM that I had just used 5 minutes ago, that was finding matches, now doesn't get a match. I kept making new ones but have stopped because the script just continues to not click on the knife/bow and the DTM continues to not find a match in the editor.

Any help is appreciated. (And if you do help could you explain to me what exactly you did :) trying to learn and stop being a leech around these forums)

Thank you!




EDIT: I put the MCX, MCY and MIX, MIY coordinates because I've seen others use them in different scripts. Can anyone tell me what they actually are/do/mean? Does it just fill the coordinates as a variable?

putonajonny

2012-06-19 17:06:41

Unless this is for a RSPS then don't use MoveMouse, you will be banned, use MMouse instead…

An easy way to do this is to use a colour count to find the knife, this works by checking counting the number of pixels that match a certain colour in each inventory slot, a value is known for the knife, when a value is found which is near the known value it know it is in that slot. This way it won't matter that the shape of the knife is changing…

First of all you need to determine a known value:

Procedure CountColours;
Var
B : TBox;
begin

B := InvBox(1);//Change 1 to whatever slot the knife it currently in
WriteLn(CountColorTolerance(KnifeColour, B.x1, B.y1, B.x2, B.y2, 10));//Change KnifeColour to a colour there is lots of on the knife

end;
Run that once, you have your count :)

Now the bit we use to click the knife:
Function ClickKnife : Boolean;
Var
i, Count : integer;
B : TBox;
begin

for i := 1 to 28 do
begin
B := InvBox(i);
Count := CountColorTolerance(KnifeColour, B.x1, B.y1, B.x2, B.y2, 10);
if(InRange(Count, SmallNumber, LargeNumber))then //Small number is the minimum the count must be, large is the max, so say before we got 200 as our count, you might say the number has to be between 150 and 250, 150 would be your small and 250 your large...
begin
InvMouse(i, mouse_move);
if(WaitUpText('ife', 200+Random(200)))then
begin
Result := True;
ClickMouse2(mouse_Left);
exit;
end;
end;
end;

end;

If you don't understand anything let me know :)

Your function would then look like this:
procedure Cut;
var
x, y, Bow : Integer;
begin
MouseItem(RandomRange(1,28),mouse_Left);
Wait(2000+random(200));

Bow := DTMFromString('mQwAAAHicY2ZgYBBggAAZIOaCsqWBeMX0iQyNJQUMNfnZDMiAEQkDAQCuPwTj')

if(not ClickKnife)then
exit;

if FindDTM(Bow, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('Found longbow image');
MoveMouse(x, y);
ClickMouse2(true);
Writeln('Fletching bows now');
end;

FreeDTM(Bow);

Antiban;
Writeln('Waiting for inventory to be finished...');
Wait(54321+random(2222));
LogsCut := LogsCut + 28;
FindNormalRandoms;
end;

Looking through your script this would be a good part to try to improve…
  Writeln('Waiting for inventory to be finished...');
Wait(54321+random(2222));
think about a way of detecting when you have finished the invent… hint:
{
function GetXPBarTotal: LongInt;

Returns the number from your XP Bar.
}

litoris

2012-06-19 17:08:20

MC= Main Chat, these are the coordinates for the chat window. Don't use them.
MSCX, MSCY : These are the X and y coordinates of the center of the main screen MICX and MIXY would be those for the inventory. MCX/Y are nonexistent.
MIX1, MIY1, MIX2, MIY2 : Top left and bottom right coordinates for the inventory screen.

If your DTM isn't working, you should add some tolerance to its main point. If it's still not working, then you are searching in the wrong box.
You should use this to find the x and y coordinates of a DTM in the inventory:
FindDTM(YourDTM, x, y, MIX1, MIY1, MIX2, MIY2)
YourDTM, x and y should be declared as integers. Then you could just use
Mouse(x, y, (randomness), (randomness), mouse_left);
Don't use MoveMouse.

Le Jingle

2012-06-19 17:09:41

Make sure you are creating decent DTM's, perhaps in your case, adding more points will help in successfully finding a DTM of your knife/log. Also using a decent tolerance here might help, I'd suggest 15. You should also look at the DTM guides out there for assistance such as:

Demise's DTMs
YoHoJo's DTMs
Naum's DTMs (also includes Bitmaps and Color)

Also, MCX1 is a constant for the x start for the chat box in rs. The MIX1 is the constant for the x start for the inventory section in rs, etc. (iirc)

Ninja'd lol :P

Roflme

2012-06-19 17:15:58

From: litoris
MC= Main Chat, these are the coordinates for the chat window. Don't use them.
MSCX, MSCY : These are the X and y coordinates of the center of the main screen MICX and MIXY would be those for the inventory. MCX/Y are nonexistent.
MIX1, MIY1, MIX2, MIY2 : Top left and bottom right coordinates for the inventory screen.

If your DTM isn't working, you should add some tolerance to its main point. If it's still not working, then you are searching in the wrong box.
You should use this to find the x and y coordinates of a DTM in the inventory:
FindDTM(YourDTM, x, y, MIX1, MIY1, MIX2, MIY2)
YourDTM, x and y should be declared as integers. Then you could just use
Mouse(x, y, (randomness), (randomness), mouse_left);
Don't use MoveMouse.

Wouldn't I want to use MC coordinates since I'm trying to find the image of the knife and bow for fletching, and they both appear in the area of the chat box?

EDIT: If they're nonexistent then what can I use to search around the chat box area?

Thank you for clearing up difference between MSC/MC/MIC.

Is there a difference between MIX/MIY and MICX/MICY? (Both pairs were in your post)

And thanks for the suggestions guys, I'll get rid of MoveMouse immediately :p


EDIT:

From: putonajonny
Unless this is for a RSPS then don't use MoveMouse, you will be banned, use MMouse instead…

An easy way to do this is to use a colour count to find the knife, this works by checking counting the number of pixels that match a certain colour in each inventory slot, a value is known for the knife, when a value is found which is near the known value it know it is in that slot. This way it won't matter that the shape of the knife is changing…

First of all you need to determine a known value:

Procedure CountColours;
Var
B : TBox;
begin

B := InvBox(1);//Change 1 to whatever slot the knife it currently in
WriteLn(CountColorTolerance(KnifeColour, B.x1, B.y1, B.x2, B.y2, 10));//Change KnifeColour to a colour there is lots of on the knife

end;
Run that once, you have your count :)

Now the bit we use to click the knife:
Function ClickKnife : Boolean;
Var
i, Count : integer;
B : TBox;
begin

for i := 1 to 28 do
begin
B := InvBox(i);
Count := CountColorTolerance(KnifeColour, B.x1, B.y1, B.x2, B.y2, 10);
if(InRange(Count, SmallNumber, LargeNumber))then //Small number is the minimum the count must be, large is the max, so say before we got 200 as our count, you might say the number has to be between 150 and 250, 150 would be your small and 250 your large...
begin
InvMouse(i, mouse_move);
if(WaitUpText('ife', 200+Random(200)))then
begin
Result := True;
ClickMouse2(mouse_Left);
exit;
end;
end;
end;

end;

If you don't understand anything let me know :)

Is that for finding the knife in an inventory? I'm using the knife on the toolkit. I just have to click the image of the knife when you first want to fletch your logs.

If that's not the case, I'll look into trying this out.

CephaXz

2012-06-19 17:18:20

You need to use some tolerance for the colored points, if not when RS refreshes, color changes, and you couldn't find the DTM anymore. Use MMouse instead of MoveMouse, MoveMouse is too fast and can get you banned anytime.

Instead of using DTM, I would suggest using text to find what you want to click, more accurate and easier.

putonajonny

2012-06-19 17:23:30

From: Roflme
Is that for finding the knife in an inventory? I'm using the knife on the toolkit. I just have to click the image of the knife when you first want to fletch your logs.

If that's not the case, I'll look into trying this out.


Sorry, I didn't realise… in that case search for the text colour that says knife, I think that is constant…

Roflme

2012-06-19 17:26:57

From: putonajonny
Sorry, I didn't realise… in that case search for the text colour that says knife, I think that is constant…


Alright, I'll give that a go now :)

litoris

2012-06-19 17:27:29

Now thinking MC might be the center of the whole screen. Chat area is the area above where you type. You are loking for the DTm in your inventory, so ou should use coordiantes that start with MI(Main Inventory). MICX/Y is the coordinate for the center of the inventory, where as MIX1 and such are for the corners of it, which are used to determine the box to search to DTM in. I suggest you read some tutorials because it is very important that you understand what the coordinates are and how they are used.

Edit: If you are doing this to add the knife to the toolkit, I'd say don't bother and just tell people to have it there before running.

Roflme

2012-06-19 17:29:50

EDIT: Was planning on them already having a knife in their toolkit :) makes things so much easier.

From: litoris
Now thinking MC might be the center of the whole screen. Chat area is the area above where you type. You are loking for the DTm in your inventory, so ou should use coordiantes that start with MI(Main Inventory). MICX/Y is the coordinate for the center of the inventory, where as MIX1 and such are for the corners of it, which are used to determine the box to search to DTM in. I suggest you read some tutorials because it is very important that you understand what the coordinates are and how they are used.


I wasn't using any DTMs in my inventory. That's why I was working with fletching. With the new updates for toolkit and simply clicking on the log to "craft" it, I just used MouseItem(RandomRange(1,28),mouse_Left); and then would be done with any part of the script needing to use my inventory.

Roflme

2012-06-19 17:45:58

From: putonajonny

Looking through your script this would be a good part to try to improve…
  Writeln('Waiting for inventory to be finished...');
Wait(54321+random(2222));
think about a way of detecting when you have finished the invent… hint:
{
function GetXPBarTotal: LongInt;

Returns the number from your XP Bar.
}

Haha yes :( I'm just using that wait there for the time being. Once I can successfully fletch a few inventories I'm going to work on better detecting the progress in my inventory :)

CephaXz

2012-06-19 17:59:02

Use DTM of the log, one DTM can represent all types of logs. So while the log is still found in your inventory, wait and do some antibans.

Roflme

2012-06-19 18:03:33

Thanks for everyone's help! I just up'd the tolerance on the DTMs and its working right now. Going to try a few more tests (letting the script log in itself, HOPE it works for all logs) and then continue on it from there. I hope to make an AIO fletcher (Yes I know there's already one, and I know there's already a ton of fletching scripts, but it's just for practice).

I guess I need to read up tutorials, since I have no idea how to utilize the text like "Maple longbow", etc. :(


From: CephaXz
Use DTM of the log, one DTM can represent all types of logs. So while the log is still found in your inventory, wait and do some antibans.


That was what I was going to work on next, was probably going to use log DTM to detect how much longer I'd be fletching for :D

putonajonny

2012-06-19 18:21:46

From: Roflme
I guess I need to read up tutorials, since I have no idea how to utilize the text like "Maple longbow", etc. :(

Simba has great text recognition, so if you tell us where the text is we can tell you the easiest way to read it…

Roflme

2012-06-20 13:47:52

From: putonajonny
Simba has great text recognition, so if you tell us where the text is we can tell you the easiest way to read it…



Excuse my paint skills.

The red box is where the longbow text is. The text remains there for every log except a regular log, where the text is shifted towards the right, since there's a fourth option for arrow shafts. But the longbow text always remains in the black circle (the chat window).

putonajonny

2012-06-20 13:54:25

From: Roflme
The red box is where the longbow text is. The text remains there for every log except a regular log, where the text is shifted towards the right, since there's a fourth option for arrow shafts. But the longbow text always remains in the black circle (the chat window).


That text is called StatChars, you could do something like:
B := IntToBox(//Text Bounds Go Here..
if(Pos('ongb', GetTextAtExWrap(B.x1, B.y1, B.x2, B.y2, 0, 5, 0, TextColour, 0, StatChars)) > 0)then
begin
//Do your stuff...
end;
You can do this multiple times for multiple boxes until you find the text…

Roflme

2012-06-20 14:35:01

From: putonajonny
That text is called StatChars, you could do something like:
B := IntToBox(//Text Bounds Go Here..
if(Pos('ongb', GetTextAtExWrap(B.x1, B.y1, B.x2, B.y2, 0, 5, 0, TextColour, 0, StatChars)) > 0)then
begin
//Do your stuff...
end;
You can do this multiple times for multiple boxes until you find the text…


Meh, keep getting errors. I guess I'm not placing everything in the write location. I'll go find some tutorials on this. Thank you for your help

putonajonny

2012-06-20 15:38:04

From: Roflme
Meh, keep getting errors. I guess I'm not placing everything in the write location. I'll go find some tutorials on this. Thank you for your help


Feel free to post the errors :)

Roflme

2012-06-20 16:55:46

From: putonajonny
Feel free to post the errors :)


Alright, before I do, question:

Where exactly am I putting that 'B'?

Do I make it a constant, a variable, or what? I'm lost with that :( Don't know where to put B := IntToBox

I'm using MouseBox at the moment, but as soon as I find out how to use the text I want to switch to that :p

CephaXz

2012-06-20 16:59:20

Hmm… I used this in my tanner and fletching script, not sure if it will work for you. Try this.


if FindText(x, y, 'lon', StatChars, MCX1, MCY1, MCX2, MCY2) then
mouse(x, y, 5, 5, mouse_Left)
else
writeln('cant find text');

EDIT: You can actually use a constant to replace the 'lon' and use a case statement for every type of items you want to fletch.

putonajonny

2012-06-20 16:59:35

From: Roflme
Alright, before I do, question:

Where exactly am I putting that 'B'?

Do I make it a constant, a variable, or what? I'm lost with that :( Don't know where to put B := IntToBox

I'm using MouseBox at the moment, but as soon as I find out how to use the text I want to switch to that :p


B is a vairable (a TBox) but I only put it there so you could run the same code and vary the boxes that it searches in, you could even have an array of boxes and search through each on using a for to do function

Roflme

2012-06-20 17:21:12

From: CephaXz
Hmm… I used this in my tanner and fletching script, not sure if it will work for you. Try this.


if FindText(x, y, 'lon', StatChars, MCX1, MCY1, MCX2, MCY2) then
mouse(x, y, 5, 5, mouse_Left)
else
writeln('cant find text');

EDIT: You can actually use a constant to replace the 'lon' and use a case statement for every type of items you want to fletch.


I'm going to try this, would make everything so much easier.

From: putonajonny
B is a vairable (a TBox) but I only put it there so you could run the same code and vary the boxes that it searches in, you could even have an array of boxes and search through each on using a for to do function


So like up where all the variables are it'd just be
*insert integers here*: Integer;
B: TBox;?


Last question, you guys said the longbow text is a StatChar. Is there anywhere I can find a list of all the StatChars supported/other text that fits in other categories besides StatChars? Is it in http://docs.villavu.com/simba/ somewhere or is there another place to find all of these at that I'm not aware of yet?

CephaXz

2012-06-20 17:23:58

I test out all of the fonts on the text I wanna use on, until it finds the text. I opened up Simba folder > Fonts, to get all the fonts I need to test lol.

putonajonny

2012-06-20 17:26:01

From: Roflme
Last question, you guys said the longbow text is a StatChar. Is there anywhere I can find a list of all the StatChars supported/other text that fits in other categories besides StatChars? Is it in http://docs.villavu.com/simba/ somewhere or is there another place to find all of these at that I'm not aware of yet?


If you go to your simba folder then go to fonts you will see a list of folders with fonts in them, you just have to compare the fonts to the text you are trying to recognise to see which one it is…

Roflme

2012-06-20 17:32:24

From: CephaXz
I test out all of the fonts on the text I wanna use on, until it finds the text. I opened up Simba folder > Fonts, to get all the fonts I need to test lol.


From: putonajonny
If you go to your simba folder then go to fonts you will see a list of folders with fonts in them, you just have to compare the fonts to the text you are trying to recognise to see which one it is…


BAHAHAHA I'm dumb; I completely forgot about this!

So you'd try like SmallChars etc. and then on StatChar it worked? I'm going to make use of text now :p

Thank you both so much :D

CephaXz

2012-06-20 17:34:10

I had a function like this in every of my script :p

So I test every one of the font until it is found.


Procedure testing;
var
x, y: Integer;
begin
if FindText(x, y, 'Red', StatChars, MCX1, MCY1, MCX2, MCY2) then
writeln('Found')
else
writeln('not found');
end;

Roflme

2012-06-20 17:52:05

From: CephaXz
I had a function like this in every of my script :p

So I test every one of the font until it is found.


Procedure testing;
var
x, y: Integer;
begin
if FindText(x, y, 'Red', StatChars, MCX1, MCY1, MCX2, MCY2) then
writeln('Found')
else
writeln('not found');
end;


Alright I'm going to start using fonts and try them for different scripts.

So hopefully my last question (but it probably won't be, lol :p)

procedure Fletchbow;
begin
MarkTime(Fletching);
case 2 of
0: if (BowType='longbow') then
begin
FindText(x, y, 'ongbo', StatChars, MCX1, MCY1, MCX2, MCY2)
Mouse(x, y, 5, 5, mouse_left);
Wait(500);
end else
Cut;
1: if (BowType='shortbow') then
begin
FindText(x, y, 'ortbo', StatChars, MCX1, MCY1, MCX2, MCY2)
Mouse(x, y, 5, 5, mouse_left);
Wait(500);
end else
Cut;
end;
repeat
Antiban;
Wait(500);
until TimeFromMark(Fletching) > 55000
end;

Does that look right?

So it will check what the const setting is for BowType at the top (which I will change to the Integer for players very soon, I really want to learn how to do multiple players :p). And then it will find the text and click on it, or else it will start Cut again (which I changed so the Cut procedure solely clicks on the logs).

Is that what this Procedure does? Or am I missing something/making it do something unintended?

CephaXz

2012-06-20 17:57:07

Don't think it work that way. You're making it to find the text, and if it fail, it will click on the log again. So if it only clicks on the log, it wouldn't be fletching anything. And the case statement looks kinda wrong for me :p



Function OptionListAppears: Boolean;
begin
Result := something that finds option list in main chat, you could use countcolor maybe
end;

Function CutLog: Boolean;
var
t: Integer;
begin
marktime(t);
repeat
if find log then
begin
Click the log;
waitfunc(@optionlistappears, 10, 2000); //wait for the function to become true in 2 seconds, repeat clicking log if not found
end;
until (optionlistappears) or (timefrommark(t) > 30000);
end;

procedure Fletchbow;
begin
case BowType of
'longbow':
begin
if FindText(x, y, 'ongbo', StatChars, MCX1, MCY1, MCX2, MCY2) then
Mouse(x, y, 5, 5, mouse_left)
else
begin
writeln('Cant find text');
terminatescript;
end;
end;

'shortbow':
begin
if FindText(x, y, 'ongbo', StatChars, MCX1, MCY1, MCX2, MCY2) then
Mouse(x, y, 5, 5, mouse_left)
else
begin
writeln('Cant find text');
terminatescript;
end;
end;
end;
while find logs in inventory do
begin
antiban;
waitfunc(@notfindthelogs, 10, 5000);
end;
end;

Maybe something like that. It's my style of scripting, not sure if its good enough though. Typed it out here, so there might have some mistakes :p

Roflme

2012-06-20 18:07:10

I wanted to make it so if it misclicks the log, or does something where it can't see the short/longbow text, it will reclick the log and then search for the text again.

Yeah, just ran it. It just clicks on the log and waits there. I need to work out these cases. Would making them separate procedures, then doing something like
procedure MainLoop;
begin
Bank;
Cut;
If BowType = 'longbow' then
FletchLong;
If BowType = 'shortbow' then
FletchShort;
end;

Would that work?

CephaXz

2012-06-20 18:12:25

Check the post I edited.

Roflme

2012-06-20 18:22:41

Functions will be the death of me.

Function Options: Boolean;
begin
Result := CountColor(2070783, MCX1, MCY1, MCX2, MCY2)
end;
I know it's wrong…somehow… But I don't exactly know how… heh heh heh :(
[Error] (97:1): Type mismatch at line 96
Compiling failed.

CephaXz

2012-06-20 18:24:48

I think you missed out ; ?
You could use CountColorTolerance, I think its better :p

Roflme

2012-06-20 18:27:02

Function Options: Boolean;
begin
Result := CountColor(2070783, MCX1, MCY1, MCX2, MCY2);
end;

[Error] (96:56): Type mismatch at line 95
Compiling failed.

Now the error is one line up. GAH!

Alright I'll try Tolerance

CephaXz

2012-06-20 18:32:09

I know what's happening. You need to have a number of color count.

Result := CountColor(2070783, MCX1, MCY1, MCX2, MCY2) > 500;

That means the colorcount is bigger than 500. That is where the testing procedure comes in handy, you can test how much you wanna put behind that.

Roflme

2012-06-20 18:35:16

Procedure testing;
var
x, y: Integer;
begin
if FindText(x, y, 'Red', StatChars, MCX1, MCY1, MCX2, MCY2) then
writeln('Found')
else
writeln('not found');
end

This testing procedure?

Bah, trying not to get lost.

So then, what value would be best to put after the CountColor? What value am I even aiming for? Wouldn't I want it just to be > 0 because that means that it's found A color that matches?

CephaXz

2012-06-20 18:52:04

If the color is not usually found in the chat box, then you can. But using higher number ensures it to be more accurate.


Procedure testing;
var
x, y: Integer;
begin
if Options then
writeln('Found')
else
writeln('not found');
end;

comment out everything except startups like SetupSRL, and do only testing. You can go higher values until it says not found, and predict which value is better. Close out the option list in chat box, and do testing and see if its found and all those. So it basically make sure the option list appears before you get out of the function/procedure.

Roflme

2012-06-20 18:54:11

Alright, and CountColor is counting how many pixels contain the color correct?

CephaXz

2012-06-20 18:55:35

I believe yes. Things always works better with tolerance IMO :p

Roflme

2012-06-20 20:07:00

For your functions above, you think DTMs are probably the best way to detect if I have logs or not in my inventory?

CephaXz

2012-06-20 20:14:31

Yes. I don't think there's other effective way doing this. You can set the main point of the DTM with 255 tolerance so it detect all logs.

Roflme

2012-06-20 20:24:51

Alright, uhherrm

waitfunc(@notfindthelogs, 10, 5000);

what would take the place of notfindthelogs?

a function that would come up false when no logs are found?

sooo uhhhh


function NotFindLogs: Boolean;
begin
if not FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2) then
Result := false
end;

is that a valid function? I know what I need to make it do I just can't seem to find how to write it :(

CephaXz

2012-06-20 20:27:20

Maybe you can just do.


function NotFindLogs: Boolean;
begin
Result := not FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2);
end;

Roflme

2012-06-20 21:34:06

I'll try both. Yours makes sense though :p



waitfunc(@notfindthelogs, 10, 5000);



while find logs in inventory do
begin
antiban;
waitfunc(@notfindthelogs, 10, 5000);
end;
end;


So does this mean, while it's finding logs in the inventory, it's constantly repeating antiban and waitfunc?

Is the waitfunc (even the notfindlogs function) needed? Couldn't I just have it so while logs are detected in the inventory it just repeats the antiban?

I have so much to test when I get home, using my cousins shit laptop at the moment -_-

Roflme

2012-06-20 22:01:23

program RoflmeFletcher;


{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i SRL\SRL\Misc\Debug.simba}


// Thank you for using my script.
// Read thread for instructions and details.
// Also post any issues on the thread.


// THIS SCRIPT IS STILL BEING TESTED
// NOT ALL LOGS WORK
// ALL LOGS WILL WORK SHORTLY

const

BowType = 'Longbow'; // 'Longbow' or 'Shortbow' for now, will
// be adding others shortly

var

x, y, Knife, Logs, LogsCut: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] do
begin
Name := '';
Pass := '';
Pin := '';

Active := true;
end;
end;


Procedure AntiBan;
begin
Case Random(800) of
1: RandomRClick;
2: RandomMovement;
3..10: BoredHuman;
11..20: PickUpMouse;
21..800: Wait(500);
end;
SetAngle(SRL_ANGLE_HIGH);
Wait(350+Random(200));
end;

Procedure setDTMs;
begin
Logs := DTMFromString('mlwAAAHicY2dgYOAHYjEgFgdiaSDmZIAAJiDmhbK5gFgYiCWhalmB2NeIG6oKE/8HkrgwIx4MBQD5PQhe');
Knife := DTMFromString('mWAAAAHicY2GAAGYg5gRiISCWB2JpIBaGyvl4eDC463GBcWt9PQM/UAwZM6JhEAAAuQcEDQ==');
end;


procedure FreeDTMZ;
begin
FreeDTM(Knife);
FreeDTM(Logs);
end;

Procedure Bank;
begin
begin
repeat
SetAngle(SRL_ANGLE_HIGH);
OpenBankChest(SRL_BANK_SW);
until BankSCreen or PinScreen;
end;

if PinScreen then
begin
repeat
InPin(Players[0].Pin);
until BankScreen
end;

if BankScreen then
begin
Wait(520+random(209));
DepositAll;
Wait(305+random(107));
Withdraw(0, 0, 28);
Wait(503+random(212));
Closebank;
end;
end;

Function Options: Boolean;
begin
Result := CountColorTolerance(2070783, MCX1, MCY1, MCX2, MCY2, 10) > 200;
end;


Function NoLogs: Boolean;
begin
Result := not FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2);
end;

Procedure CutLog;
var
t: Integer;
begin
MarkTime(t)
repeat
if FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MouseItem(RandomRange(1,28), mouse_left);
WaitFunc(@Options, 10, 2000);
end;
until (Options) or (TimeFromMark(t) > 30000);
end;

Procedure FletchBow;
begin
case BowType of
'longbow':
begin
if FindText(x, y, 'ongbo', StatChars, MCX1, MCY1, MCX2, MCY2) then
Mouse(x, y, 5, 5, mouse_left)
else
begin
writeln('Can''t find option, terminating');
terminatescript;
end;
end;

'shortbow':
begin
if FindText(x, y, 'ortbo', StatChars, MCX1, MCY1, MCX2, MCY2) then
Mouse(x, y, 5, 5, mouse_left)
else
begin
writeln('Can''t find option, terminating');
terminatescript;
end;
end;
end;
while FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2) do
begin
AntiBan;
waitfunc(@NoLogs, 10, 2000);
end;
end;

procedure Report;
begin
ClearDebug;
Writeln('Roflme''s Fletcher');
Writeln('Logs Cut:' + IntToStr(LogsCut));
Writeln('Script has run for ' + TimeRunning);
end;


procedure MainLoop;
begin
Bank;
CutLog;
FletchBow;
end;


begin
Cleardebug;
DeclarePlayers;
Smart_Server := 1;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
SmartSetRefresh(70);
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
SetDTMs;
repeat
MainLoop;
until(false);
FreeDTMZ;
end.

Well the script sure got larger. I'll work in where to put the piece that clicks on the knife DTM later.

It will click on the log, and then sit there. :( So close

CephaXz

2012-06-21 01:21:23

You didn't have a procedure that finds the knife text after option is found. Or maybe option function not working properly :p

Roflme

2012-06-21 19:27:26

Procedure testing;
var
x, y: Integer;
begin
if FindText(x, y, 'ongbo', StatChars, MCX1, MCY1, MCX2, MCY2) then
writeln('Found')
else
writeln('not found');
end;

Tested that for each Font, none of them came back as 'Found'.

/Rage

putonajonny

2012-06-21 19:32:29

From: Roflme
Procedure testing;
var
x, y: Integer;
begin
if FindText(x, y, 'ongbo', StatChars, MCX1, MCY1, MCX2, MCY2) then
writeln('Found')
else
writeln('not found');
end;

Tested that for each Font, none of them came back as 'Found'.

/Rage


You could make a DTM of the text… just make a DTM of loads of points on the text (like actually loads of them) should work well

Roflme

2012-06-21 20:04:30

From: putonajonny
You could make a DTM of the text… just make a DTM of loads of points on the text (like actually loads of them) should work well


Just made a ton of points, can get a matching DTM. Will test if I can get it to work :p


I am interested in trying to get the script to find the text as well. :( just for any future scripts I might create :(

Roflme

2012-06-21 20:16:26

program RoflmeFletcher;


{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i SRL\SRL\Misc\Debug.simba}


// Thank you for using my script.
// Read thread for instructions and details.
// Also post any issues on the thread.


// THIS SCRIPT IS STILL BEING TESTED
// NOT ALL LOGS WORK
// ALL LOGS WILL WORK SHORTLY

const

BowType = 'Longbow'; // 'Longbow' or 'Shortbow' for now, will
// be adding others shortly

var

x, y, Knife, Log, Longbow, LogsCut: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] do
begin
Name := '';
Pass := '';
Pin := '';

Active := true;
end;
end;


Procedure AntiBan;
begin
Case Random(800) of
1: RandomRClick;
2: RandomMovement;
3..10: BoredHuman;
11..20: PickUpMouse;
21..800: Wait(500);
end;
SetAngle(SRL_ANGLE_HIGH);
Wait(350+Random(200));
end;

Procedure setDTMs;
begin
Longbow := DTMFromString('m/AEAAHictc5xB4AwEAXwm3VLREQasUR9575tvfHiiv6842f2tjfLIjLAATtsVGCBGTJMNFLt9NRRggaivEeZt7wTuVdmtpPMe8/Zt1vXYPLrXF0p/+olOPubG76KK8g=');
Knife := DTMFromString('mWAAAAHicY2GAAGYg5gRiISCWB2JpIBaGyvl4eDC463GBcWt9PQM/UAwZM6JhEAAAuQcEDQ==');
Log := DTMFromString('mlwAAAHicY2dgYOAHYjEgFgdiaSDmZIAAJiDmhbK5gFgYiCWhalmB2NeIG6oKE/8HkrgwIx4MBQD5PQhe');
end;


procedure FreeDTMZ;
begin
FreeDTM(Knife);
FreeDTM(Longbow);
FreeDTM(Log);
end;

Procedure Bank;
begin
begin
repeat
SetAngle(SRL_ANGLE_HIGH);
OpenBankChest(SRL_BANK_SW);
until BankSCreen or PinScreen;
end;

if PinScreen then
begin
repeat
InPin(Players[0].Pin);
until BankScreen
end;

if BankScreen then
begin
Wait(520+random(209));
DepositAll;
Wait(305+random(107));
Withdraw(0, 0, 28);
Wait(503+random(212));
Closebank;
end;
end;

Function NoLogs: Boolean;
begin
Result := not FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2);
end;


Procedure Cut;
var
t: Integer;
begin
MarkTime(t);
repeat
if FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MouseItem(RandomRange(1,28), mouse_left);
Wait(5000);
end;
until (FindDTM(knife, x, y, MCX1, MCY1, MCX2, MCY2)) or FindDTM(Longbow, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(t) > 30000)
FindDTM(knife, x, y, MCX1, MCY1, MCX2, MCY2);
Mouse(x, y, 5, 5, mouse_left);

Case BowType of
'longbow':
if FindDTM(Longbow, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
Mouse(x, y, 5, 5, mouse_left);
repeat
Antiban;
Wait(500+random(300));
until waitfunc(@NoLogs, 10, 2000)
end;
end;
end;



procedure Report;
begin
ClearDebug;
Writeln('Roflme''s Fletcher');
Writeln('Logs Cut:' + IntToStr(LogsCut));
Writeln('Script has run for ' + TimeRunning);
end;


procedure MainLoop;
begin
Bank;
Cut;
Report;
end;


begin
Cleardebug;
DeclarePlayers;
Smart_Server := 1;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
SmartSetRefresh(70);
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
SetDTMs;
repeat
MainLoop;
until(false);
FreeDTMZ;
end.

I don't know why I'm having so much trouble with this :\…

So the script will click the log, find the knife DTM, wait the 5 seconds in
repeat
if FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MouseItem(RandomRange(1,28), mouse_left);
Wait(5000);
end;
until (FindDTM(knife, x, y, MCX1, MCY1, MCX2, MCY2)) or FindDTM(Longbow, x, y, MCX1, MCY1, MCX2, MCY2) or (TimeFromMark(t) > 30000)

And then successfully click on longbow DTM text…

But as soon as it clicks to fletch longbows, it will begin to bank. I'm guessing the problem is with my Log DTM or NoLog function. I can't check if the DTM will detect what items are logs and which aren't due to the fact that whenever I click to show DTMs, simba crashes :\

CephaXz

2012-06-22 03:03:54

From: Roflme
Procedure testing;
var
x, y: Integer;
begin
if FindText(x, y, 'ongbo', StatChars, MCX1, MCY1, MCX2, MCY2) then
writeln('Found')
else
writeln('not found');
end;

Tested that for each Font, none of them came back as 'Found'.

/Rage


I just tested, it returns Found for me.

EDIT: Your log DTM is wrong. ALL your points had 255 tolerance.

EDIT: Fixed, and works for me. I tested 300+ logs, thats all I have in bank lol.

program RoflmeFletcher;


{$i srl/srl/misc/smart.simba}
{$i SRL\SRL.simba}
{$i SRL\SRL\Misc\Debug.simba}


// Thank you for using my script.
// Read thread for instructions and details.
// Also post any issues on the thread.


// THIS SCRIPT IS STILL BEING TESTED
// NOT ALL LOGS WORK
// ALL LOGS WILL WORK SHORTLY

const

BowType = 'longbow'; // 'Longbow' or 'Shortbow' for now, will
// be adding others shortly

var

x, y, Log, LogsCut: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] do
begin
Name := '';
Pass := '';
Pin := '';

Active := true;
end;
end;


Procedure AntiBan;
begin
Case Random(800) of
1: RandomRClick;
2: RandomMovement;
3..10: BoredHuman;
11..20: PickUpMouse;
21..800: Wait(500);
end;
SetAngle(SRL_ANGLE_HIGH);
Wait(350+Random(200));
end;

Procedure setDTMs;
begin
//Longbow := DTMFromString('m/AEAAHictc5xB4AwEAXwm3VLREQasUR9575tvfHiiv6842f2tjfLIjLAATtsVGCBGTJMNFLt9NRRggaivEeZt7wTuVdmtpPMe8/Zt1vXYPLrXF0p/+olOPubG76KK8g=');
//Knife := DTMFromString('mWAAAAHicY2GAAGYg5gRiISCWB2JpIBaGyvl4eDC463GBcWt9PQM/UAwZM6JhEAAAuQcEDQ==');
Log := DTMFromString('mlwAAAHicY2dgYJjBxMAwAYinA/FCIF4KxLOAeDIQPwXK3wHi21D6BRC/A+IPQGykww8kmbDi/wy4ASMeDAUARmYMBQ==');
//New log DTM
end;


procedure FreeDTMZ;
begin
//FreeDTM(Knife);
//FreeDTM(Longbow);
FreeDTM(Log);
end;

Procedure Bank;
begin
begin
repeat
//SetAngle(SRL_ANGLE_HIGH);
OpenBankChest(SRL_BANK_SW);
until BankSCreen or PinScreen;
end;

if PinScreen then
begin
repeat
InPin(Players[0].Pin);
until BankScreen
end;

if BankScreen then
begin
DepositAll;
Withdraw(0, 0, 28);
Closebank;
repeat
wait(10);
until InvCount > 0; //prevent error from lag
end;
end;

//Taken out from one of my script, shorten function :p
Function GetDaText(var cx, cy: Integer; TextHere: String): Boolean;
begin
Result := FindText(cx, cy, TextHere, StatChars, MCX1, MCY1, MCX2, MCY2);
end;


Function NoLogs: Boolean;
begin
Result := not FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2);
end;


Function OptionsAppeared: Boolean;
begin
Result := CountColorTolerance(2038544, MCX1, MCY1, MCX2, MCY2, 10) > 2000;
end;


Function Cut: Boolean;
var
t: Integer;
begin
MarkTime(t);
if FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
LogsCut := LogsCut + InvCount; //Should be like that? for report
MouseItem(RandomRange(1,28), mouse_left);
//Wait(5000); //This waits total 5 seconds, which will makes script slow
repeat
wait(100);
if TimeFromMark(t) > 10000 then //if wait more than 10 secs
begin
writeln('Wait too long');
TerminateScript; //Or maybe you want to reclick logs
end;
until (OptionsAppeared);
writeln('Option list found');
Result := True;
end else //what if log not found?
begin
writeln('Cant find logs');
TerminateScript;
end;
end;


Procedure FletchBow;
begin
if GetDaText(x, y, 'nife') then
begin
writeln('Clicking knife');
Mouse(x, y, 5, 5, mouse_Left);
repeat
wait(100);
until GetDaText(x, y, 'bow');
end;

//case types not in capital, constant should not be capital too
//changed constant above to lower capital
Case BowType of
'longbow':
begin
if GetDaText(x, y, 'ongb') then
begin
Mouse(x, y, 5, 5, mouse_left);
writeln('Making longbow');
end;
end;

'shortbow':
begin
if GetDaText(x, y, 'ortb') then
begin
Mouse(x, y, 5, 5, mouse_Left);
writeln('Making shortbow');
end;
end;
end;

repeat
AntiBan;
WaitFunc(@NoLogs, 10, 5000);
until NoLogs;
writeln('Finished fletching '+BowType);
end;



procedure Report;
begin
ClearDebug;
Writeln('Roflme''s Fletcher');
Writeln('Logs Cut:' + IntToStr(LogsCut));
Writeln('Script has run for ' + TimeRunning);
end;


procedure MainLoop;
begin
Bank;
if Cut then
FletchBow;
Report;
end;


procedure testing;
begin
if OptionsAppeared then
writeln('Found')
else
writeln('Not found');
end;


begin
Cleardebug;
DeclarePlayers;
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
SmartSetRefresh(70);
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
SetDTMs;
AddOnTerminate('FreeDTMZ'); //Free DTM on termination
repeat
MainLoop;
until not LoggedIn; //Until not logged in
end.

P1ng

2012-06-22 05:32:38

If your simba crshes when trying to search for a DTM it means there are too many matches and it finds alot or everything on your screen, remake the DTM with tolerance only on the coloured points and keep the tolerance a bit lower and it shouldn't crash.

Roflme

2012-06-22 10:13:25

From: CephaXz
I just tested, it returns Found for me.

EDIT: Your log DTM is wrong. ALL your points had 255 tolerance.

EDIT: Fixed, and works for me. I tested 300+ logs, thats all I have in bank lol.

program RoflmeFletcher;


{$i srl/srl/misc/smart.simba}
{$i SRL\SRL.simba}
{$i SRL\SRL\Misc\Debug.simba}


// Thank you for using my script.
// Read thread for instructions and details.
// Also post any issues on the thread.


// THIS SCRIPT IS STILL BEING TESTED
// NOT ALL LOGS WORK
// ALL LOGS WILL WORK SHORTLY

const

BowType = 'longbow'; // 'Longbow' or 'Shortbow' for now, will
// be adding others shortly

var

x, y, Log, LogsCut: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] do
begin
Name := '';
Pass := '';
Pin := '';

Active := true;
end;
end;


Procedure AntiBan;
begin
Case Random(800) of
1: RandomRClick;
2: RandomMovement;
3..10: BoredHuman;
11..20: PickUpMouse;
21..800: Wait(500);
end;
SetAngle(SRL_ANGLE_HIGH);
Wait(350+Random(200));
end;

Procedure setDTMs;
begin
//Longbow := DTMFromString('m/AEAAHictc5xB4AwEAXwm3VLREQasUR9575tvfHiiv6842f2tjfLIjLAATtsVGCBGTJMNFLt9NRRggaivEeZt7wTuVdmtpPMe8/Zt1vXYPLrXF0p/+olOPubG76KK8g=');
//Knife := DTMFromString('mWAAAAHicY2GAAGYg5gRiISCWB2JpIBaGyvl4eDC463GBcWt9PQM/UAwZM6JhEAAAuQcEDQ==');
Log := DTMFromString('mlwAAAHicY2dgYJjBxMAwAYinA/FCIF4KxLOAeDIQPwXK3wHi21D6BRC/A+IPQGykww8kmbDi/wy4ASMeDAUARmYMBQ==');
//New log DTM
end;


procedure FreeDTMZ;
begin
//FreeDTM(Knife);
//FreeDTM(Longbow);
FreeDTM(Log);
end;

Procedure Bank;
begin
begin
repeat
//SetAngle(SRL_ANGLE_HIGH);
OpenBankChest(SRL_BANK_SW);
until BankSCreen or PinScreen;
end;

if PinScreen then
begin
repeat
InPin(Players[0].Pin);
until BankScreen
end;

if BankScreen then
begin
DepositAll;
Withdraw(0, 0, 28);
Closebank;
repeat
wait(10);
until InvCount > 0; //prevent error from lag
end;
end;

//Taken out from one of my script, shorten function :p
Function GetDaText(var cx, cy: Integer; TextHere: String): Boolean;
begin
Result := FindText(cx, cy, TextHere, StatChars, MCX1, MCY1, MCX2, MCY2);
end;


Function NoLogs: Boolean;
begin
Result := not FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2);
end;


Function OptionsAppeared: Boolean;
begin
Result := CountColorTolerance(2038544, MCX1, MCY1, MCX2, MCY2, 10) > 2000;
end;


Function Cut: Boolean;
var
t: Integer;
begin
MarkTime(t);
if FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
LogsCut := LogsCut + InvCount; //Should be like that? for report
MouseItem(RandomRange(1,28), mouse_left);
//Wait(5000); //This waits total 5 seconds, which will makes script slow
repeat
wait(100);
if TimeFromMark(t) > 10000 then //if wait more than 10 secs
begin
writeln('Wait too long');
TerminateScript; //Or maybe you want to reclick logs
end;
until (OptionsAppeared);
writeln('Option list found');
Result := True;
end else //what if log not found?
begin
writeln('Cant find logs');
TerminateScript;
end;
end;


Procedure FletchBow;
begin
if GetDaText(x, y, 'nife') then
begin
writeln('Clicking knife');
Mouse(x, y, 5, 5, mouse_Left);
repeat
wait(100);
until GetDaText(x, y, 'bow');
end;

//case types not in capital, constant should not be capital too
//changed constant above to lower capital
Case BowType of
'longbow':
begin
if GetDaText(x, y, 'ongb') then
begin
Mouse(x, y, 5, 5, mouse_left);
writeln('Making longbow');
end;
end;

'shortbow':
begin
if GetDaText(x, y, 'ortb') then
begin
Mouse(x, y, 5, 5, mouse_Left);
writeln('Making shortbow');
end;
end;
end;

repeat
AntiBan;
WaitFunc(@NoLogs, 10, 5000);
until NoLogs;
writeln('Finished fletching '+BowType);
end;



procedure Report;
begin
ClearDebug;
Writeln('Roflme''s Fletcher');
Writeln('Logs Cut:' + IntToStr(LogsCut));
Writeln('Script has run for ' + TimeRunning);
end;


procedure MainLoop;
begin
Bank;
if Cut then
FletchBow;
Report;
end;


procedure testing;
begin
if OptionsAppeared then
writeln('Found')
else
writeln('Not found');
end;


begin
Cleardebug;
DeclarePlayers;
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
SmartSetRefresh(70);
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
SetDTMs;
AddOnTerminate('FreeDTMZ'); //Free DTM on termination
repeat
MainLoop;
until not LoggedIn; //Until not logged in
end.

Should only some of my points have been 255 tolerance?

P1ng

2012-06-22 11:03:11

I would suggest none of your points be 255 tolerance, that means they can be absolutely any colour imaginable.

-Go to the GE, buy a log of each type.
-Make a DTM with one central point (on a colour) then all of your other points around the black outline.
-Increase the tolerance (slowly) until it matches all of the logs in your inventory but don't increase it so high that it recognises other items (or in your case the whole screen).
-Keep a 0 tolerance for all your points along the black outline of the object. These should all be the same colour and remain constant as they do not change no matter how many times the client is refreshed.

CephaXz

2012-06-22 11:35:20

From: Roflme
Should only some of my points have been 255 tolerance?


Only the main point has 255 tolerance for me. As it has color. Other points are all the black outline, which must be 0 tolerance. Do not take points on the left of the logs, there is a bug that will make items disappear a little on the left side.

Since my DTM is for a log. And colored point has 255 tolerance. That means it will work on any logs, because they have the same shape, and my DTM works regardless of the color of a log.

Roflme

2012-06-22 12:46:17

From: p1ng
I would suggest none of your points be 255 tolerance, that means they can be absolutely any colour imaginable.

-Go to the GE, buy a log of each type.
-Make a DTM with one central point (on a colour) then all of your other points around the black outline.
-Increase the tolerance (slowly) until it matches all of the logs in your inventory but don't increase it so high that it recognises other items (or in your case the whole screen).
-Keep a 0 tolerance for all your points along the black outline of the object. These should all be the same colour and remain constant as they do not change no matter how many times the client is refreshed.


Ahh the black outline, makes sense :) thank you!

Will have to try script out when I get home

Roflme

2012-06-22 20:58:25

Can't test until tomorrow :( :( :( :(

I guess my FindText should have had tolerance :p (seeing the changes you implemented)

Roflme

2012-06-23 23:19:17

I'm still so confused why it came back as 'not found'. STILL haven't been able to implement any changes, but I believe you've got it working. Thank you so much for your help CephaXz :D going to see how text works out for other fletching items.

CephaXz

2012-06-23 23:23:21

If the text is in the chatbox, it should return as found. Try playing around with the script I edited :p

Roflme

2012-06-24 00:10:44

I posted a copy of the script on my thread (shout out to you :p), going to test it myself when I'm done with my slayer task tomorrow (Black Demons -_-). I'll have to try the test procedure again and see if I can find success. I'll also test the script to see if it works for me :p since I always have bad luck with running things :(

Roflme

2012-06-25 11:40:53

EDIT: Read your note on the capital casetypes, trying again :duh:

EDIT2: MUCH BETTER! Lol, I didn't even know that the cases were case sensitive. Working now, :D