MatthewDai98
2015-06-06 18:32:53
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?
2015-06-06 18:32:53
2015-06-06 20:06:40
2015-06-06 20:47:11
2015-06-07 10:58:49
2015-06-07 14:42:13
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; 2015-06-07 17:00:12
From: ineedbot
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)
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.commandString := after('!cmd', getPeopleTexts[0]);