i finally got some time to script but i cant get this to work...
its for my fisher and its meant to find and click on the shopkeeper's head...
however the mouse never moves and the script stops without any reason
SCAR Code:
program New;
{.include srl/srl.scar}
{.include srl/srl/skill/Fishing.scar}
var
Shopkeeper,x1,y1: integer;
procedure Declareplayers;
Begin
HowManyPlayers :=2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active:=False;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
Procedure DeclareBitMaps;
begin
Shopkeeper:= BitmapFromString(8, 8, 'z78DA9D8F411203210804BF04C32078' +
'8C26FEFF49615753B5E770E8F2D03803CD44DF4C23A4252728723' +
'1C5173E9B9C1680DCF33437830E644C1F98D1BDE3F5F45DECA5E3' +
'F8CB15ADF522B6B999D960EBFC8FEA934C4AA508F963B8B7F26F0' +
'A48396313537DA76CD6AED5D6E0AAAC3B374723F5F881543D29C3' +
'A2FC7ACA95D280F27AF57C73D9E95F7739E6DE7AD2830AD94C6BC' +
'3BBFC355F40924ED3');
end;
procedure test1;
begin
FindBitMap(Shopkeeper, x1, y1)
begin
MMouse(x1,y1,2,2)
wait(1000+(200))
if(IsUpText('hop'))then
begin
Mouse(x1,y1,2,2,false)
wait(500 + random(300))
ChooseOption(x,y,'Trade')
Wait(1000+random(200))
end;
end;
end;
begin
SetupSRL;
SetupSRLFishing;
DeclarePlayers;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
Activateclient;
If(Not(Loggedin)) then
LoginPlayer;
DeclareBitMaps;
test1;
end.
Everytime i run it, it stops...
what is the problem?
or do i have to Functions in order for this to work?
If you guys come up with a better procedure or function please share it!