SRL Archive - OSR Help

Help please? :)


Sandhu255

2012-12-11 04:15:34

Does anyone know if simba can read the text in the runescape chat window?

I was thinking of making a script that responds to the text or an anti-ban or something :P

Im not familiar with simba but I was thinking something like ; (correct me if im wrong)

If textsays (" Hi "); then
Typesend ("Hello! :)");

Please help? :D

slackeru

2012-12-11 04:20:26

From: Sandhu255
Does anyone know if simba can read the text in the runescape chat window?

I was thinking of making a script that responds to the text or an anti-ban or something :P

Im not familiar with simba but I was thinking something like ; (correct me if im wrong)

If textsays (" Hi "); then
Typesend ("Hello! :)");

Please help? :D


Yes, just read some tutorials on the forums. But you're on the right track. Things like that have been around for a while :smarty:

Sandhu255

2012-12-11 04:23:06

From: bi a op
Yes, just read some tutorials on the forums. But you're on the right track. Things like that have been around for a while :smarty:


Okay! :)

I'm not really sure where the tutorials are, would you mind sending a link my way? :)

xtrapsp

2012-12-11 04:23:06

So basically you want to check the chatbox for the word " Hi " then if it does type bck "Hello!"

Ok firstly

If you actionbar is up you now have to press enter, So you could make a little function to detect that and if it is true then press enter first.

secondly,

Checkout Chat.simba

I believe your looking to use this:


(*
InChat
~~~~~~

.. code-block:: pascal

function InChat(Text: String): Boolean;

Grabs Last Chat Line and performs checks on occurence of text


.. note::

by WT-Fakawi

Example:

.. code-block:: pascal


*)
function InChat(Text: string): Boolean;
var
s: string;
begin
if (not (GetLastChatText(s))) then
LastChatter(s);

Result := (Pos(LowerCase(Text), Lowercase(s)) > 0);
end;

Justin

2012-12-11 04:27:02


if InChat('Hi') then
TypeSend('Hello');

Will start you out :)

xtrapsp

2012-12-11 04:29:25

From: [J]ustin

if InChat('Hi') then
TypeSend('Hello');

Will start you out :)


Don't give him the answer! Let him figure it out

Sandhu255

2012-12-11 04:31:06

From: xtrapsp
So basically you want to check the chatbox for the word " Hi " then if it does type bck "Hello!"

Ok firstly

If you actionbar is up you now have to press enter, So you could make a little function to detect that and if it is true then press enter first.

secondly,

Checkout Chat.simba

I believe your looking to use this:


(*
InChat
~~~~~~

.. code-block:: pascal

function InChat(Text: String): Boolean;

Grabs Last Chat Line and performs checks on occurence of text


.. note::

by WT-Fakawi

Example:

.. code-block:: pascal


*)
function InChat(Text: string): Boolean;
var
s: string;
begin
if (not (GetLastChatText(s))) then
LastChatter(s);

Result := (Pos(LowerCase(Text), Lowercase(s)) > 0);
end;

Sorry im kinda new, what does that do? And how can I use it?

is it like if s = "hi" then typesend "hello" or something?
im confused :/

Mr[S]

2012-12-11 04:32:41

Action bar has made it much harder for a new comer :(

Sandhu255

2012-12-11 04:32:54

From: [J]ustin

if InChat('Hi') then
TypeSend('Hello');

Will start you out :)


Thanks!

uhhh wait I got some kind of error :(

program Chatresponder;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

procedure respond;
Begin;
if InChat('Hi') then
TypeSend('Hello');
end;

Begin;
respond;
ClearDebug;
SetupSRL;
end.


My script ^


error:
[Error] C:\Users\Admin\RS.simba(7:11): Duplicate identifier 'RESPOND' at line 6
Compiling failed.

xtrapsp

2012-12-11 04:36:12

From: Sandhu255
Sorry im kinda new, what does that do? And how can I use it?

is it like if s = "hi" then typesend "hello" or something?
im confused :/


Basically whenever you use smaller code like

TypeSend('');

it actually has a LOT of code elsewhere in simba

(*
InChat
~~~~~~

.. code-block:: pascal

function InChat(Text: String): Boolean;

Grabs Last Chat Line and performs checks on occurence of text


.. note::

by WT-Fakawi

Example:

.. code-block:: pascal


*)
function InChat(Text: string): Boolean;
var
s: string;
begin
if (not (GetLastChatText(s))) then
LastChatter(s);

Result := (Pos(LowerCase(Text), Lowercase(s)) > 0);
end;

So all that code is the
InChat('');
code snippet

Sandhu255

2012-12-11 04:38:49

Thanks guys! got me going =)

program Chatresponder;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

procedure TextResponse;
begin;
if InChat('Hi') then
TypeSend('Hello');
end;


Begin;
ClearDebug;
SetupSRL;
Repeat TextResponse Until(false)
End.

:D

xtrapsp

2012-12-11 04:46:20

From: Sandhu255
Thanks guys! got me going =)

program Chatresponder;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

procedure TextResponse;
begin;
if InChat('Hi') then
TypeSend('Hello');
end;


Begin;
ClearDebug;
SetupSRL;
Repeat TextResponse Until(false)
End.

:D


No problem :)

Sandhu255

2012-12-11 04:48:15

From: xtrapsp
No problem :)


Unfortunetly this script does not respond to text… :(
program Chatresponder;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

procedure TextResponse;
begin;
if InChat('Hi') then
TypeSend('Hello');
end;


Begin;
ClearDebug;
SetupSRL;
Repeat TextResponse Until(false)
End.

xtrapsp

2012-12-11 05:13:01

From: Sandhu255
Unfortunetly this script does not respond to text… :(
program Chatresponder;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

procedure TextResponse;
begin;
if InChat('Hi') then
TypeSend('Hello');
end;


Begin;
ClearDebug;
SetupSRL;
Repeat TextResponse Until(false)
End.


have you got chat text set to black? :)