lardmaster
09-15-2006, 09:40 PM
this is pre-pre-pre-beta-beta, but when i reference to srl's text include, i get a fatal error! "[Runtime Error] : Exception: Access violation at address 0065478C in module 'scar.exe'. Read of address 00000000 in line 197 in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Text.scar" it seems pretty serious. ive attached my script so have a look at it and see if i'm referencing isuptextmuli wrongly or whatever. right now, its just supposed to right click on all the specified ores in your inventory. (input 'copper' in the debug window when prompted). put the picture in your scar folder.
{.include SRL\SRL\misc\arrayloader.scar}
{.include SRL\srl.scar}
type
intarray = ARRAY[0..1] of array[0..1] of integer;
var
xc,yc,copper, i :integer;
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
procedure loadbitmaps(itemname:string);
begin
itemname := 'C:\Program Files\SCAR 2.03\' + itemname + '.bmp';
copper := loadbitmap(itemname);
end;
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
function finditem(item:string; coordinates : intarray) : boolean;
begin
loadbitmaps(item);
Result := findbitmaptolerancein(copper,xc,yc,coordinates[0][0],coordinates[0][1],coordinates[1][0],coordinates[1][1],20);
end;
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
function coordsofslot(num : integer) : intarray;
var
x1,y1,x2,y2,x,y, j :integer;
begin
j := 1;
while(j<9)do
begin
if(num<(j*4)+1) and (((j-1)*4) <num) then
begin
x := (num - (4*(j-1)));
break;
end
y := j;
j := j + 1;
end
x1 := 526+(41*x);
y1 := 210+(36*y);
x2 := x1+41;
y2 := y1+35;
result[0][0] := x1;
result[0][1] := y1;
result[1][0] := x2;
result[1][1] := y2;
end;
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
var
coords: intarray;
todrop: array[1..28] of boolean;
item : string;
begin
item := readln('what item to drop?')
while(i<=28)
do
begin
coords := (coordsofslot(i));
todrop[i] := finditem(item, coords);
writeln(inttostr(i));
writeln(booltostr(todrop[i]));
i := i + 1
end
i := 1;
while(i <= 28)do
begin
if(todrop[i] = true)then
begin
coords := coordsofslot(i);
writeln('next is');
writeln(inttostr(coords[0][0]));
writeln(',');
writeln(inttostr(coords[0][1]));
movemousesmooth(random(coords[1][0]-coords[0][0])+ coords[0][0], random(coords[1][1]-coords[0][1])+ coords[0][1]);
wait(random(1000)+500);
while(isuptextmulti('use', 'use'+ item, item) = false)do
begin
movemousesmooth(random(coords[1][0]-coords[0][0])+ coords[0][0], random(coords[1][1]-coords[0][1])+ coords[0][1]);
wait(random(1000) + 500);
end
getmousepos(xc, yc);
clickmouse(yc,yc, false);
end
i := i + 1;
end
end.
plz help!, SRL IS MALFUNCTIONING!
{.include SRL\SRL\misc\arrayloader.scar}
{.include SRL\srl.scar}
type
intarray = ARRAY[0..1] of array[0..1] of integer;
var
xc,yc,copper, i :integer;
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
procedure loadbitmaps(itemname:string);
begin
itemname := 'C:\Program Files\SCAR 2.03\' + itemname + '.bmp';
copper := loadbitmap(itemname);
end;
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
function finditem(item:string; coordinates : intarray) : boolean;
begin
loadbitmaps(item);
Result := findbitmaptolerancein(copper,xc,yc,coordinates[0][0],coordinates[0][1],coordinates[1][0],coordinates[1][1],20);
end;
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
function coordsofslot(num : integer) : intarray;
var
x1,y1,x2,y2,x,y, j :integer;
begin
j := 1;
while(j<9)do
begin
if(num<(j*4)+1) and (((j-1)*4) <num) then
begin
x := (num - (4*(j-1)));
break;
end
y := j;
j := j + 1;
end
x1 := 526+(41*x);
y1 := 210+(36*y);
x2 := x1+41;
y2 := y1+35;
result[0][0] := x1;
result[0][1] := y1;
result[1][0] := x2;
result[1][1] := y2;
end;
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
{-------------------------------------------------------------------------}
var
coords: intarray;
todrop: array[1..28] of boolean;
item : string;
begin
item := readln('what item to drop?')
while(i<=28)
do
begin
coords := (coordsofslot(i));
todrop[i] := finditem(item, coords);
writeln(inttostr(i));
writeln(booltostr(todrop[i]));
i := i + 1
end
i := 1;
while(i <= 28)do
begin
if(todrop[i] = true)then
begin
coords := coordsofslot(i);
writeln('next is');
writeln(inttostr(coords[0][0]));
writeln(',');
writeln(inttostr(coords[0][1]));
movemousesmooth(random(coords[1][0]-coords[0][0])+ coords[0][0], random(coords[1][1]-coords[0][1])+ coords[0][1]);
wait(random(1000)+500);
while(isuptextmulti('use', 'use'+ item, item) = false)do
begin
movemousesmooth(random(coords[1][0]-coords[0][0])+ coords[0][0], random(coords[1][1]-coords[0][1])+ coords[0][1]);
wait(random(1000) + 500);
end
getmousepos(xc, yc);
clickmouse(yc,yc, false);
end
i := i + 1;
end
end.
plz help!, SRL IS MALFUNCTIONING!