View Full Version : SRL Error
looneytoon
01-12-2007, 06:03 PM
Here is the script im tryin to run.
{.Include SRL/SRL.Scar}
var
gx, gy:integer;
procedure ExamineGP;
begin
Mouse(gx, gy, 0, 0, False);
wait(10 + Random(10));
ClickOption('mine coins', 1);
FTWait(12); //To wait for possible lag.
end;
Procedure LocateGP;
begin
If(Findcolor(gx, gy, 2149883, 555, 208, 743, 463))Then
ExamineGP;
end;
begin
repeat
LocateGP;
ExamineGP;
SetupSRL;
until (false);
end.
and i get this error
Line 174: [Hint] (181:43): Variable 'NEWLINE' never used in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Globals.scar
[Runtime Error] : Exception: Access violation at address 0064FEA2 in module 'scar.exe'. Read of address 00000000 in line 353 in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Text.scar
Anyone have an idea why im gettin this error?
Edit: bw the above script is not my own, just wanted to say that before someone said something
Pentti
01-12-2007, 06:09 PM
How about putting SetUpSRL at the beginning in your script? :D And you don't need to repeat it...
the nerd
01-12-2007, 06:12 PM
U need to run setupSRL before everything else and out side the loop
looneytoon
01-12-2007, 06:22 PM
ok its not just with this script. Im trying to run other scripts and they arent working, i didnt use setup srl before! well im gonna try anyway... nope didnt work
{.Include SRL/SRL.Scar}
var
gx, gy:integer;
Procedure SetSRL;
begin
setupsrl;
end;
procedure ExamineGP;
begin
Mouse(gx, gy, 0, 0, False);
wait(10 + Random(10));
ClickOption('mine coins', 1);
FTWait(12); //To wait for possible lag.
end;
Procedure LocateGP;
begin
If(Findcolor(gx, gy, 2149883, 555, 208, 743, 463))Then
ExamineGP;
end;
begin
repeat
LocateGP;
ExamineGP;
SetupSRL;
until (false);
end.
:'( Scar must hate me!
Edit: took it out fo repeat, still didnt work
Pentti
01-12-2007, 07:50 PM
Look....
{.Include SRL/SRL.Scar}
var
gx, gy:integer;
Procedure SetSRL;
begin
setupsrl;
end;
procedure ExamineGP;
begin
Mouse(gx, gy, 0, 0, False);
wait(10 + Random(10));
ClickOption('mine coins', 1);
FTWait(12); //To wait for possible lag.
end;
Procedure LocateGP;
begin
If(Findcolor(gx, gy, 2149883, 555, 208, 743, 463))Then
ExamineGP;
end;
begin
SetUpSRL; //-See this
repeat
LocateGP;
ExamineGP;
until (false);
end.
looneytoon
01-12-2007, 08:38 PM
thanks so much! it worked! Scar doesnt hate me after all. Ok now my problem is its not right clicked the money, oh well. Thanks so much for your help, im looking at your tutorial island video right now. When I become SRL member i'll definetely use it.
Boreas
01-12-2007, 08:43 PM
function ClickOption(s: String; i: Integer): Boolean;
By: RSN
Description: Clicks Option in Specified Area (1 for Main Screen, 2 Inventory,
3 for Chat Window), returns True if text was found
from you findcolor params, it looks like you want inv
looneytoon
01-12-2007, 08:57 PM
OMG! Thanks so much I was just about to post about this. Thanks so so much
looneytoon
01-12-2007, 09:07 PM
ok i changed the 1 to a 2, and it just right clicks but it wont click examine coins
{.Include SRL/SRL.Scar}
var
gx, gy:integer;
Procedure SetSRL;
begin
setupsrl;
end;
procedure ExamineGP;
begin
Mouse(gx, gy, 0, 0, False);
wait(10 + Random(10));
ClickOption('examine', 2);
FTWait(12); //To wait for possible lag.
end;
Procedure LocateGP;
begin
If(Findcolor(gx, gy, 1815773, 555, 208, 743, 463))Then
ExamineGP;
end;
begin
SetUpSRL;
repeat
LocateGP;
ExamineGP;
until (false);
end.
Boreas
01-12-2007, 09:11 PM
try 'xam' because the e is captial
looneytoon
01-12-2007, 09:24 PM
It works, thanks so much. One problem, once i close my runescape client, and open it again, then try to run the script again, for some reason it doesnt go to the money. I have to pick a new color and put it in, does the money change color or something?
Boreas
01-12-2007, 09:26 PM
Yes, a lot of things change color. Either use findcolortolerance, or make a dtm of the black (65536 never changes) of the coins.
looneytoon
01-12-2007, 10:00 PM
ok... i didnt want to make a new topic so...
Alot of functions i want to use have 'strings' in them. what are strings and how would i use this function?
function CoinAmount(area: string): Integer;
var
coinbmp: Integer;
begin
coinbmp := loadcoinbmp;
Result := AmountBmp(area, coinbmp, 40);
FreeBitmap(coinbmp);
end;
xxlegitxx
01-12-2007, 11:22 PM
A string is anything between single quotes. You usually use strings in conjunction with WriteLn, for example. No clue how to use that function though...
Boreas
01-13-2007, 12:30 AM
ok... i didnt want to make a new topic so...
Alot of functions i want to use have 'strings' in them. what are strings and how would i use this function?
function CoinAmount(area: string): Integer;
var
coinbmp: Integer;
begin
coinbmp := loadcoinbmp;
Result := AmountBmp(area, coinbmp, 40);
FreeBitmap(coinbmp);
end;
The parameter needs a string called area. If you look in the function use see that it's the first parameter of AmountBmp, which in turn is in ItemsCoordsBmp, which in turn is in CheckArea and Areainfo, which use case statements for area with the choices:
'inv' or 'inventory'
'shop'
'bank'
'trade'
'your trade'
looneytoon
01-13-2007, 12:48 AM
Thanks Boreas. (I added to your rep btw) But how would I put this into my script?
Boreas
01-13-2007, 12:55 AM
program new;
{.include srl/srl.scar}
{.include srl/srl/misc/amount.scar}
var ShowMeDaMoney:integer;
begin
setupsrl;
ShowMeDaMoney:=CoinAmount('inv');
writeln('I have '+inttostr(ShowMeDaMoney)+'gp');
end.
looneytoon
01-13-2007, 01:05 AM
you dont know how happy your making me. your getting major credits whenever this is released, i owe you big time. ill prolly have more questions later. If you ever need anything just tell me
edit: it worked omg! your helping me so much! i can finally move on to my next procedure
Boreas
01-13-2007, 01:16 AM
Don't worry about it, it's what I do lol.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.