Troll
2011-07-21 06:31:06
Ok so it summer and im trying to write my first script again, and i think ill finish it this time as i have a lot of time but i have an error and need help :(
I get
Thanks for any help and your time :D Your all great here
I get
New window: 19071850
[Hint] (106:10): Variable 'Result' never used at line 105
[Hint] C:\Simba\Includes\SRL/SRL/core/SRLlog.scar(17:3): Variable 'THEFILE' never used at line 16
Compiled succesfully in 998 ms.
SRL Compiled in 31 msec
Error: Out of Global Vars range at line 72
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]
and the script is
program new;
{$i SRL/SRL.scar}
Type
MonsterInfo = Record // so that i can add more later
MonName : String;
SecoundName : String; // so if a monster in the same room has same colour
MonColour : Integer;
MonSat : Extended;
MonHue : Extended;
MonToll : Integer;
End;
Function SetMonster(TheName:String; Which:Integer):MonsterInfo;
Begin
Case TheName Of
'zombie':Begin
Case Which Of
1:
With Result Do
Begin
MonName := 'Zombie';
SecoundName := 'Gaint rat';
MonColour := 3757940;
MonSat := 0.46;
MonHue := 0.07;
MonToll := 13;
End;
2:
With Result Do
Begin
MonName := 'Zombie';
SecoundName := 'GaintRat';
MonColour := 5198163;
MonSat := 0.02;
MonHue := 0.50;
MonToll := 17;
End;
3:
With Result Do
MonName := 'False';
End;
End;
End;
End;
Function FindMonster(TheName:String):Boolean;
Var
x,y,a,i:Integer;
TheTPA:TPointArray;
ATPA: TPointArrayArray;
Click:TPoint;
Begin
If Not LoggedIn Then Exit;
{
Name1 := SetMonster(TheName).MonName;
Name2 := SetMonster(TheName).SecoundName;
}
SetColorToleranceSpeed(2);
a := 1;
Repeat
SetColorspeed2Modifiers(SetMonster(TheName,a).MonHue,SetMonster(TheName,a).MonSat); //as the colour can change
If FindColorsSpiralTolerance(x,y,TheTPA,SetMonster(TheName,a).MonColour,MSX1,MSY1,MSX2,MSY2,SetMonster(TheName,a).MonToll) Then
If Length(TheTPA)>1 Then
Begin
ATPA := TPAtoATPAEx(TheTPA,3,3);
For I:= 0 to High(ATPA) Do
Begin
Click :=MiddleTPA(ATPA[I]);
MMouse(Click.x,click.y,RandomRange(-3,3),RandomRange(-3,3));
If (IsUpText(SetMonster(TheName,a).MonName) or IsUpText(SetMonster(TheName,a).SecoundName)) Then
Begin
GetMousePos(x,y);
If Random(20) = 5 Then
Begin
Mouse(x,y,0,0,False);
If ChooseOption('Attack') Then
Begin
Result := True;
writeln('Found and click monster');
Exit;
End Else Begin
Mouse(x,y,0,0,True);
writeln('Found and clicked monster');
Result := True;
Exit;
End;
End;
End;
End;
End;
Inc(A);
Until(False);
End;
Function Fighting:Boolean;
Begin
{
Check for HP bar
Check XP
}
End;
begin
SetupSRL;
ActivateClient;
FindMonster('zombie');
end.
Thanks for any help and your time :D Your all great here