Log in

View Full Version : InChat - it wont find certain text



purple37
03-29-2007, 01:52 AM
I'm adding a new part to my rune buying script so if it reaches a certain price it will stop for a while then continue, but that doesnt matter

i have an if statement that says (after the rune is clicked for the value)
If(InChat(ElementalPrice))then;

ElelementalPrice is one of my constants:
ElementalPrice = 'costs 15'

so basically im trying to make it do something (i dont feel like explaining the something) using and if statement but it wont detect the words

it is also doing the same thing for me when i run out of money i have a similar if statement that tells it to end script but it wont

so basically doesn't find 'costs 15' (or whatever im looking for in the chatbox) because InChat wont find black letters

(lolz i just felt like making it different colors)

Starblaster100
03-29-2007, 03:59 PM
firstly make sure that you have SetuoSRL in your script.
Secondly, i believe InChat is case sensitive - check that.

if all else fails, make a simple script to test it out first and try and catch the error with the simple script before putting it into your main script. Thats what i always do ;)

JuKKa
03-29-2007, 06:21 PM
This is what i use...


program New;
{.Include SRL/SRL.Scar}

function IsText(TextB: String) : boolean;
var cx,cy : integer;
begin
if FindText(cx,cy,TextB,smallchars,19, 415, 230, 431)then
result:= True;
end;

begin
setupsrl;
if istext('costs 15')then
writeln('It Costs 15 gp!')
else
writeln('It Doesent Cost 15 gp!')
end.


credit me :)

purple37
03-30-2007, 01:05 AM
Ok it works but i was working on something else in my script now after the if... i cant put a wait
i get the 'identifier expected' error

why???

nielsie95
03-30-2007, 11:02 AM
if(..)then
begin
end else
Is this how you used the if?

bullzeye95
03-30-2007, 02:30 PM
Purple, make sure you don't put a semicolon on the line before the else (or whatever is before else)