One question about this command, InChat.
Let's say I want it to check for the phrase "Wc level"-
If someone said "Wc level?" would it still count as "Wc level"?
If it does, I can save a lot of time.
Printable View
One question about this command, InChat.
Let's say I want it to check for the phrase "Wc level"-
If someone said "Wc level?" would it still count as "Wc level"?
If it does, I can save a lot of time.
ahh, I see. I thought you were writing this to be included in a script as antiban...
Well, in that case, you should just take the wait out from inside the if and move it to right before the if. You should probably change the wait time to 500 instead of 2000. That shouldn't lag too much, and will be responsive enough to provide a more convincing conversation.
EDIT:
Yes, from the description of what InChat does (I looked in the SRL Manual) It should check for one string throughout the whole chat window. So if you searched for 'ap', it would detect 'happy', 'apple' etc.
Kk.
Only problem I have right now is wondering what to make my WC level incase somebody asks =)
SCAR Code:if(InChat('wc level'))or(InChat('wc level?'))or(InChat('wc lvl'))or
InChat('wc lvl?'))or(InChat('wc levl'))or(InChat('wc levl?'))or
InChat('wc lvel'))or(InChat('wc lvel?'))or(InChat('wclevel'))or
InChat('wclevel?'))then
The whole chat window, or just the last line? If it's the whole chat window... I'll have to get a new command...
you could put in something like this:
if(InChat('wc'))or(InChat('woodcutting'))then
if(InChat('level'))or(InChat('lvl'))then
begin
wclvl:=GetSkillLevel('woodcutting');
case random(2) of
0:sendkeys(inttostr(wclvl));
1:sendkeys('Mines '+inttostr(wclvl));
end;
end;
GetSkillLevel? That's a command?
Neat =)
So I need to set wclvl as a var and then TypeSend + wclvl... That should be easy enough...
Lemme try it, thanks =)
I've gotten a runtime error again... What does this one mean?Quote:
[Runtime Error] : Exception: Access violation at address 006549BC in module 'scar.exe'. Read of address 00000000 in line 103 in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\GameTab.scar
also, you might want to put:
right after {.include SRL/SRL.scar}PHP Code:procedure SendText(text: string);
var i: Integer;
begin
for i := 1 to Length(Text) do
begin
SendKeys(Text[i]);
Wait(50+random(50));
end;
SendKeys(Chr(13));
end;
so your program would be:
then instead of using TypeSend, use SendText(...);PHP Code:program New;
{.include SRL/SRL.scar}
procedure SendText(text: string);
var i: Integer;
begin
for i := 1 to Length(Text) do
begin
SendKeys(Text[i]);
Wait(50+random(50));
end;
SendKeys(Chr(13));
end;
begin
//main program
end.
figure it out urself, not to be mean
Lol, except that some of the SRL errors can be pretty tricky to solve...I've spent hours on ones like this before
SCAR Code:program New;
{.include SRL/SRL.scar}
var
wclvl : integer;
begin
wclvl := GetSkillLevel('woodcutting');
writeln(IntToStr(wclvl) + '');
end.
tsk tsk
You forgot SetupSRL;
Heh, thanks =)
How important is SetupSRL;? What does it have? I thoughtcontains SetupSRL;SCAR Code:{.include SRL/SRL.scar}
And why is sendtext better than typesend?
because that sendtext will send the text humanly, unlike typesend (as far as i know) when just sends it all at once
Setupsrl; loads the fonts (amongst other things) which are needed for text finding, getting levels, etc. It's good practice to put it in evey RS script. See the end of my FAQ (link in sig) for a way to make it so that setupsrl is automatically in the script.
Thank's boreas ;)
Lol Smartz =P
Lol, I do have firefox with squigglys. First I made the typo 'evety', I saw the red line, deleted the 't', but didn't replace it with an 'r', having seen the red line the first time, my brain assumed I fixed it and moved on hehe.
Anyways... yea follow freddys tut, I haven't had that problem in a long time thanks to that trick.
Make sure you test the responder ingame before you use it in any scripts though. The first time I tried mine, It kept finding the same statement for a while so it responded a bunch of times to one thing. I fixed, but I think I made it more complicated than it has to be.
Ohh true...Maybe put in a variable, like when it responds to phrase #1, it sets the variable lastphrase to 1; while lastphrase is 1, the script won't respond to phrase #1, because it knows it allready has
I don't know how confusing that was, if you showed me a script, I could show you an example of what I mean