PDA

View Full Version : Can anyone tell me how I would solve this random (OSVELDAHAR)



shuyin82
10-31-2015, 08:10 AM
imgur. com/KJu3X4L There's a server i'm playing right now that I would like to bot on, it has random events like this that appear (randomly of course :P) there are quite a few variations of this but if someone could possibly tell me the script needed to pass this one, I could apply it to all possible variations.

Much thanks

I couldn't post full link because of post count, but if you could check it out by arranging it properly thanks again!

ALSO - If you could right a line somewhere in there that if this box appears it will solve it then restart script you would really be helping!

Joopi
10-31-2015, 01:01 PM
You'd have to use some ocr for reading off the text, then a color finding function to differ which scimitar is which.

This wont work, but it's a general example of how it would look somewhat, also there is no "script" predone for this. Noone has the time to make everything for every private server there is.

This is if we assume there is an overload function called findText, (which there probably isnt).
If FindText('Bronze Scimitar', SearchBox) Then
Begin
If FindColorTolerance(Settings for finding a bronze scimitar...) Then
Mouse(x, y, 5, 5, Mouse_left);
End;

Calluminati
10-31-2015, 11:43 PM
Some extra information about this would obviously make it easier to answer, for example does it always ask for a bronze scimitar and the scims are switched around each time or does it ask for a certain scimitar each time and the scims below are kept the same (if that makes sense) or is it a completely different random each time, honestly I think you should do what YouPee said however I doubt you'll be able to get the findText function so I'd just work it off bitmaps which work incredibly well.

Function BronzeScim: Boolean;
var
x,y: Integer;
begin
if (FindBitmap(ScimitarTextBronze, x, y)) then
result := true;
end;

procedure Scim1;
var
x,y: Integer;
begin
if (BronzeScim) then
begin
FindColorTolerance(Settings for finding a bronze scimitar...) Then
Mouse(x, y, 5, 5, Mouse_left);
End;

ty YouPee for code blah blah you get the idea

shuyin82
11-02-2015, 10:02 AM
Yeah, i'm currently collecting all of the 16 possible variations of this random event, I have 10 so far and think that bitmaps would provide a better outcome, i just need the final 6 to show so I can screenshot them :)

bg5
11-02-2015, 10:52 AM
I doubt you'll be able to get the findText function so I'd just work it off bitmaps which work incredibly well.

It's not a problem, really. Simba is now using Tesseract OCR.
program new;

{$s+}
type
TDebug = (DEBUG, HEADER, SUB, FOOTER, LOG, HINT, WARNING, ERROR, FATAL);
{$s-}
procedure print(txt: string; debugType: TDebug = TDebug.DEBUG);// we need this to compile tesseract.simba without including the whole SRL
begin
end;

{$i SRL-6\lib\core\tesseract.simba}
function GetText(box :TBox) : string;
var TesFilter: TTesseractFilter;
begin
TesFilter := TTesseractFilter([4, 4, [False, 20, TM_Mean]]);
Result := Tesseract_GetText(box.x1, box.y1 , box.x2, box.y2, TesFilter);
end;

begin
writeln(GetText(IntToBox(383,356,564,377 )) );
end.


Compiled successfully in 530 ms.
Click the ’Bronze Scimitar’
Successfully executed.