SRL Archive - RuneScape Private-Server Scripts

Text.


The Legendary

2015-05-12 23:23:50

So I'm attempting to make auto replies to noobs or autoer reporter that ask questions while in game.
For example. You're botting smithing and here comes a player. He says "what's your smithing lvl". And the bot should look for lvl then typesend back "70". but script can't seen to get the text in the chatbox right -.-

For Instance
in game chatbox line 8 is "lol nope"
writeln(getchatboxtext(8,clblue)); 
Script would return 4U4 l$op instead of lol nope like in game.

I want it to be like this so it get the correct text from the game and reply.
if GetChatBoxText(8,clblue) = ('lvl')then reply70;      



Do I need to load a specific text file or what to make simba read right?
How is what the in game text look like.

=RSPS botter=

rj

2015-05-13 11:34:46

Try this:

function getchat(const line:integer):string;
var
texttpas, textatpa:t2dpointarray;
texttpa:tpointarray;
textcolors:tintegerarray;
i:integer;
begin
textcolors := [128, 16711680, 0, 255, 16711935, 16776960, 16777215, 8388736];
setLength(texttpas, length(textcolors));
for i := 0 to high(textcolors) do
findColors(texttpas[i], textcolors[i], 7, 402 + (line * 14), 495, 413 + (line * 14));
texttpa := mergeAtpa(texttpas);
textatpa := splittpaex(texttpa, 1, 10);
SortATPAFromFirstPointX(textatpa, Point(0, 0));
result := getTextATPA(textatpa, 3, 'smallchars07');
end;

The Legendary

2015-05-13 18:44:21

From: rj
Try this:

function getchat(const line:integer):string;
var
texttpas, textatpa:t2dpointarray;
texttpa:tpointarray;
textcolors:tintegerarray;
i:integer;
begin
textcolors := [128, 16711680, 0, 255, 16711935, 16776960, 16777215, 8388736];
setLength(texttpas, length(textcolors));
for i := 0 to high(textcolors) do
findColors(texttpas[i], textcolors[i], 7, 402 + (line * 14), 495, 413 + (line * 14));
texttpa := mergeAtpa(texttpas);
textatpa := splittpaex(texttpa, 1, 10);
SortATPAFromFirstPointX(textatpa, Point(0, 0));
result := getTextATPA(textatpa, 3, 'smallchars07');
end;


I don't know how to read this -.- you mind give me some description of it?
like what do i need to put anything in textcolor etc?

-I got an out of bounds error when putting this in the loop:
writeln(getchat(8));

rj

2015-05-13 19:11:38

From: The Legendary
I don't know how to read this -.- you mind give me some description of it?
like what do i need to put anything in textcolor etc?

-I got an out of bounds error when putting this in the loop:
writeln(getchat(8));


Wat server is this for

findColors(texttpas, textcolors, 7, 402 + (line * 14), 495, 413 + (line * 14));

401 is the top x were the chatbox starts, 495 is the top y

The Legendary

2015-05-13 21:56:16

From: rj
Wat server is this for

findColors(texttpas, textcolors, 7, 402 + (line * 14), 495, 413 + (line * 14));

401 is the top x were the chatbox starts, 495 is the top y

I can't seen to make it work on it, even after changing those i still got an out of bound error
This is for emps world can be found at https://emps-world.net/index.php

rj

2015-05-13 22:07:32

From: The Legendary
I can't seen to make it work on it, even after changing those i still got an out of bound error
This is for emps world can be found at https://emps-world.net/index.php


Are you running classic or opengl?

The Legendary

2015-05-13 22:26:28

From: rj
Are you running classic or opengl?


Classic, because simba is blind with opengl mode.
make sure to re-size the client to the smallest size allowed

The Legendary

2015-05-19 03:03:03

@rj Can you help me with this?
As you can see the first chatline is always correct but not the rest.

program pm;
{$I SRL/SRL.simba}
function kgetchat(const line:integer):string;
var
texttpas, textatpa:t2dpointarray;
texttpa:tpointarray;
textcolors:tintegerarray;
i:integer;
begin
textcolors := [128, 16711680, 0, 255, 16711935, 16776960, 16777215, 8388736];
setLength(texttpas, length(textcolors));
for i := 0 to high(textcolors) do
findColors(texttpas[i], textcolors[i], 7, 12 + (line * 14), 495, 399 + (line * 14));
texttpa := mergeAtpa(texttpas);
textatpa := splittpaex(texttpa, 1, 10);
SortATPAFromFirstPointX(textatpa, Point(0, 0));
result := getTextATPA(textatpa, 3, 'smallchars07');
end;
Begin
ClearDebug;
SetupSRL;
ActivateClient;
Wait(1000);
writeln(kgetchat(1));
writeln(kgetchat(2));
writeln(kgetchat(3));
writeln(kgetchat(4));
writeln(kgetchat(5));
writeln(kgetchat(6));
writeln(kgetchat(7));
writeln(kgetchat(8));
end.

Debug:

SRL Compiled in 16 msec
Madara: Buying b gloves
MadaTa[BuyV$VoVest
VdV:V$VV9aI 1m
VdV:V$V#9aI 1m
VV:VV9eaaId1msfast boots' lava cape cash
VVVV9aeaId1smfast boots' lava cape cash
V:VV! 9aeaId1smfast boots' lava cape cash
V:VV9eaetIa 1dsmfast boots' lava cape cash
Successfully executed.

EDIT: I still need help with this and I check this topic multiple times a day ;[