PDA

View Full Version : Reading text ingame



MatthewDai98
06-06-2015, 10:32 PM
Can a bot read text in runescape? For example, if I typed !follow 'battleyou' in game is it possible to make it read the text and do what the command is programmed to do? If so, how can I do that?

srlMW
06-07-2015, 12:06 AM
I don't believe we have the ability to take advantage of such feature as our client simply reflects off the game... All it would see is yellow/blue but not be able to make out the message I believe. Though I might very well be wrong, hopefully you get a 100% answer soon as I am also interested!

KeepBotting
06-07-2015, 12:47 AM
Reflection could, in theory, read the text. I'm not sure if there are built-in methods for doing so, though.

Does Tesseract work for any of the OSRS libraries? If so, Tesseract can read text perfectly.

Your last option would be the old-school way: bitmap font set. Probably not the best way to do it :p

MatthewDai98
06-07-2015, 02:58 PM
I dont know how to do any of that, hah:P

ineedbot
06-07-2015, 06:42 PM
With reflection, just about anything is possible (except getting models and etc :( ) but, you can get nearby player's overhead text with reflection.

function getPeopleTexts:TStringArray;
var _players : TReflectPlayerArray;
i : integer;
begin
_players.GetAll;
for i:=0 to high(_players) do begin
setLength(result, length(result)+1);
result[high(result)] := _players[i].GetSpokenText;
end;
end;

That function will return all player's that are loaded their overhead text to a string array. You can use that to find if any of those strings in that array if they contain '!follow' or '!say', etc commands. You can then chop off the command part of the text ('!cmd ') and then find what the argument is. (i know theres a way to chop string's of their text, but im not quite exactly how to do so, you are going to have to ask someone or search it up)

KeepBotting
06-07-2015, 09:00 PM
With reflection, just about anything is possible (except getting models and etc :( ) but, you can get nearby player's overhead text with reflection.

function getPeopleTexts:TStringArray;
var _players : TReflectPlayerArray;
i : integer;
begin
_players.GetAll;
for i:=0 to high(_players) do begin
setLength(result, length(result)+1);
result[high(result)] := _players[i].GetSpokenText;
end;
end;

That function will return all player's that are loaded their overhead text to a string array. You can use that to find if any of those strings in that array if they contain '!follow' or '!say', etc commands. You can then chop off the command part of the text ('!cmd ') and then find what the argument is. (i know theres a way to chop string's of their text, but im not quite exactly how to do so, you are going to have to ask someone or search it up)

Janilabo's string handing commands (https://villavu.com/forum/showthread.php?t=82205), specifically: after()

function After(s, str: string): string;
var
p, strL, sL: Integer;
begin
sL := Length(s);
strL := Length(str);
if (sL < strL) then
begin
p := Pos(s, str);
if (p > 0) then
Result := Copy(str, (p + sL), ((1 + strL) - (p + sL)));
end else
Result := '';
end;

var
str: string;

begin
ClearDebug;
str := 'What comes after this? After() WORKS!';
WriteLn(After('this? ', str));
end.

So something to the effect of:

commandString := after('!cmd', getPeopleTexts[0]);