Log in

View Full Version : error, Duplicate identifier



Littellj
03-07-2012, 03:50 AM
[Error] (87:3): Duplicate identifier 'DropPattern' at line 86
Compiling failed.

Need some knowledge. :p



program testbandit;
{$DEFINE SMART}
{$i srl/srl.simba}


Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
End;




procedure StatsGuise(wat:String);
begin
StatsGuise(wat);
Disguise(wat);
end;



procedure Antiban;
begin
case Random(90) of
20: HoverSkill('Thieving', False);
30: PickUpMouse;
40: RandomMovement;
50: BoredHuman;
59: ExamineInv;
end;
Writeln('Antiban in action!');
end;



function Bandit: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.42, 0.14);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 1714004, MSX1, MSY1, MSX2, MSY2, 7);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;

///////////////Taken from YoHoJo's powerminner////////////

Procedure DropJunk;
var
x, y, Needle, Antipoision, I: Integer;
SlotBox:TBox;
DropPattern:TIntegerArray; <----Error Line

begin
Lockpick:= DTMFromString('mrAAAAHic42BgYOhjZmCYD8QzgHgiELcDcQ sQtwJxDxBXMDIwFAJxHhAXAXE9ELcAcQcQ1wKxnbU10BQmPBg/YCSAYQAA5GsJNg==');
Antipoision:= DTMFromString('mAAEAAHiclc0xDkBQFETRebTWYGmCgiBYhp KSRiKhQmzRTX6j9G9ymmkmklSEToUaLXp0KJEiQYYch0kjJizY zG0nblzYsWLG8DS8BB7+F8M8fXsB8IkOcA==');
DropPattern:= [9,13,17,21,25,10,14,18,22,26,7,11,15,19,23,27,8,12 ,16,20,24,28];

for I:= 0 to 21 do
Begin
SlotBox:= InvBox(DropPattern[I]);
if FindDTM(Lockpick,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Or
FindDTm(Antipoision,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(DropPattern[I], False);
WaitOption('Dro', 500);
end;
end;

FreeDTM(Needle);
FreeDTM(Antipoision);

end;

Procedure Pickpocket;
var
x, y: integer;
begin
repeat
if(not(LoggedIn))then
Exit;

x:=MSCX;
y:=MSCY;

If FindObjTPA(x, y, Bandit, 5, 2, 5, 10, 20,['Atta'])then

begin
WriteLn('Found Bandit');

GetMousePos(x, y);
Mouse(x, y, 10, 10, False);
WaitOption('Pick', 500)
Wait(100)
if pos( 'stunned', GetblackChatMessage) <> 0 then
Case Random(2) of
1:Wait(4000);
2:Antiban;
end;
end;
until(InvFull);
begin
FindNormalRandoms;
WriteLn('Dropping');
DropJunk;
//Droping

end;


end;






begin
Smart_Server := 0;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
DeclarePlayers;
LoginPlayer;
repeat
FindNormalRandoms;
Pickpocket;
Until(false);

end.

Ashaman88
03-07-2012, 05:10 AM
Drop Pattern is part of the SRL includes, you don't need to declare it as a variable. If you're trying to drop in a certain pattern use DropArray.


(*
DropArray
~~~~~~~~~

.. code-block:: pascal

procedure DropArray(InvSlots: TIntegerArray);

Drops item positioned equivalent to numbers in "InvSlots" array.
Example: "DropArray([2, 4, 9, 12]);" would drop items in InvSlot 2, 4, 9 and 12.

.. note::

by Lorax/EvilChicken!, Tickyy for idea.

Example:

.. code-block:: pascal

DropArray([2, 3, 6]);

*)

YoHoJo
03-07-2012, 05:14 AM
Hmm, DropPattern may already be in SRL now hmm?

Just rename all DropPatterns in your script to something (anything) else.


I see you're using a lot of my code :D neat!

Littellj
03-07-2012, 05:30 AM
Hmm, DropPattern may already be in SRL now hmm?

Just rename all DropPatterns in your script to something (anything) else.


I see you're using a lot of my code :D neat!

Yeah i hope that's ok with you, i plan on going back through my script once i get it running all the way to customize it and learn some more :)

Sorry posted something then saw your post.

When i do that i get this error. could you explain what a type mismatch is?

[Error] (103:44): Type mismatch at line 102
Compiling failed.

program testbandit;
{$DEFINE SMART}
{$i srl/srl.simba}



Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
End;




procedure StatsGuise(wat:String);
begin
StatsGuise(wat);
Disguise(wat);
end;



procedure Antiban;
begin
case Random(90) of
20: HoverSkill('Thieving', False);
30: PickUpMouse;
40: RandomMovement;
50: BoredHuman;
59: ExamineInv;
end;
Writeln('Antiban in action!');
end;



function Bandit: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.42, 0.14);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 1714004, MSX1, MSY1, MSX2, MSY2, 7);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;



///////////////Taken from YoHoJo's powerminner////////////

Procedure DropJunk;
var
x, y, Lockpick, Antipoision, I: Integer;
SlotBox:TBox;
DropingPattern:TIntegerArray;

begin
Lockpick:= DTMFromString('mrAAAAHic42BgYOhjZmCYD8QzgHgiELcDcQ sQtwJxDxBXMDIwFAJxHhAXAXE9ELcAcQcQ1wKxnbU10BQmPBg/YCSAYQAA5GsJNg==');
Antipoision:= DTMFromString('mAAEAAHiclc0xDkBQFETRebTWYGmCgiBYhp KSRiKhQmzRTX6j9G9ymmkmklSEToUaLXp0KJEiQYYch0kjJizY zG0nblzYsWLG8DS8BB7+F8M8fXsB8IkOcA==');
DropingPattern:= [9,13,17,21,25,10,14,18,22,26,7,11,15,19,23,27,8,12 ,16,20,24,28];

for I:= 0 to 21 do
Begin
SlotBox:= InvBox(DropingPattern[I]);
if FindDTM(Lockpick,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Or
FindDTm(Antipoision,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(DropingPattern[I], False);
WaitOption('Dro', 500);
end;
end;

FreeDTM(Needle);
FreeDTM(Antipoision);

end;



Procedure Pickpocket;
var
x, y: integer;
begin
repeat
if(not(LoggedIn))then
Exit;

SetAngle(SRL_ANGLE_HIGH);
x:=MSCX;
y:=MSCY;

If FindObjTPA(x, y, Bandit, 5, 2, 5, 10, 20,['Atta'])then

begin
WriteLn('Found Bandit');

GetMousePos(x, y);
Mouse(x, y, 10, 10, False);
WaitOption('Pick', 500)
Wait(100)
If FindBlackChatMessage('fail') Then
Case Random(2) of
1:Wait(4000);
2:Antiban;
end;
end;
until(InvFull);
begin
FindNormalRandoms;
WriteLn('Dropping');
DropJunk;
//Droping

end;


end;






begin
Smart_Server := 0;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
DeclarePlayers;
LoginPlayer;
repeat
FindNormalRandoms;
Pickpocket;
Until(false);

end.

YoHoJo
03-07-2012, 05:35 AM
? what

Littellj
03-07-2012, 05:40 AM
edited my earlier post, you had posted and i didn't see it and it answered my question.

Ashaman88
03-07-2012, 05:43 AM
You need to use DropArray unless you want to do one of the three patterns for DropPattern

DropPattern only does these patterns

dp_UpToDown = 1;
dp_Snake = 2;
dp_Random = 3;

(*
DropPattern
~~~~~~~~~~~

.. code-block:: pascal

procedure DropPattern(Which: Integer);

Drops all items in inventory according to pattern which.

.. note::

by Rasta Magician

Example:

.. code-block:: pascal

DropPattern(dp_Snake);

*)

YoHoJo
03-07-2012, 05:44 AM
Change the False to a 1 or 2 (forget which one is right click)

Littellj
03-07-2012, 05:50 AM
You need to use DropArray unless you want to do one of the three patterns for DropPattern

DropPattern only does these patterns


Ok, that makes sense. So for future use where would i put that into my script. Under Var? and then the same thing after my InvBox('here'), and then same thing after my mouseitem('here')?







Change the False to a 1 or 2 (forget which one is right click)

Compiled successfully in 1592 ms.
Thanks :) YoHoJo

Daniel
03-07-2012, 10:24 AM
Compiled successfully in 1592 ms.
Thanks :) YoHoJo

Instead of using numbers, use mouse_Left, mouse_Middle or mouse_Right :) Much easier to remember, understand, and more change-proof :)