looneytoon
01-11-2007, 02:54 AM
I was wondering why you cant put functions or procesdures in your script if they are already in srl.scar, trade.scar, etc. You always get a duplicate identifier error. Is there a way to put functions and procedures in the script? Look at this script..when i try to run it i get a duplicate identifier error, am i doing something wrong?
{
__
/\ \
\ \ \ ___ ___ ___ __ __ __
\ \ \ __ / __`\ / __`\ /' _ `\ /'__`\/\ \/\ \
\ \ \L\ \/\ \L\ \/\ \L\ \/\ \/\ \ /\ __/\ \ \_\ \
\ \____/\ \____/\ \____/\ \_\ \_\\ \____\\/`____ \
\/___/ \/___/ \/___/ \/_/\/_/ \/____/ `/___/> \
/\___/
\/__/
____ __
/\ _`\ __ /\ \__
\ \,\L\_\ ___ _ __ /\_\ _____ \ \ ,_\ ____
\/_\__ \ /'___\/\`'__\\/\ \ /\ '__`\\ \ \/ /',__\
/\ \L\ \ /\ \__/\ \ \/ \ \ \\ \ \L\ \\ \ \_ /\__, `\
\ `\____\\ \____\\ \_\ \ \_\\ \ ,__/ \ \__\\/\____/
\/_____/ \/____/ \/_/ \/_/ \ \ \/ \/__/ \/___/
\ \_\
\/_/
_ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( L )( o )( o )( n )( e )( y ) ( M )( e )( r )( c )( h )( a )( n )( t )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
__________________________________________________ __________________
|Directions |
|Set Public Chat to 'Hide' or 'Friends' and Trade/Compete to 'On' |
|Enter your message in line 40. |
|_________________________________________________ ___________________|}
program LooneyMerchant;
{.Include SRL/SRL.Scar}
{.include srl\srl\extended\xtext.scar}
{.include srl\srl\misc\trade.scar}
Const
Message1 = 'Text Goes Here'; //Enter the message you want to say
procedure autotype;
begin
TypeSend(Message1);
wait(2000);
end;
var
xx,yy,accepttradetab:integer;
xa,ya,tradeop1:integer;
function GetTraderName: string;//This is where the duplicate identifier error is
var
colonx, colony: Integer;
begin
if (TradeScreen) then
begin
if (IsTextInAreaEx(2, 31, 477, 50, colonx, colony, ':', 0, upchars, False,
True, 0, 0, 65535)) then
begin
Result := Trim(GetTextAtEx(colonx + 8, colony, 0, upchars, False, True, 0,
2, 65535, 12, False, tr_AlphaNumericChars))
end
else
WriteLn('Couldnt get trader name');
end;
end;
procedure DeclareBMPS;
begin
accepttradetab := BitmapFromString(19, 13, 'z78DA33301805A380D' +
'6C01989A48F5DF845686717ADED1D281BF193C4E8A29D1F9D E91E' +
'AA83D14600263E17DE');
tradeop1 := BitmapFromString(2, 1, '800080BBAE92');
end;
Procedure FindBMPS;
begin
if(FindBitmap(accepttrade,xx,yy))then
autotype;
if(FindBitmap(tradeop1,xa,ya))then
GetTraderName;
end;
begin
repeat
wait(1300)
autotype;
DeclareBMPS;
FindBMPS;
until(false)
end.
{
__
/\ \
\ \ \ ___ ___ ___ __ __ __
\ \ \ __ / __`\ / __`\ /' _ `\ /'__`\/\ \/\ \
\ \ \L\ \/\ \L\ \/\ \L\ \/\ \/\ \ /\ __/\ \ \_\ \
\ \____/\ \____/\ \____/\ \_\ \_\\ \____\\/`____ \
\/___/ \/___/ \/___/ \/_/\/_/ \/____/ `/___/> \
/\___/
\/__/
____ __
/\ _`\ __ /\ \__
\ \,\L\_\ ___ _ __ /\_\ _____ \ \ ,_\ ____
\/_\__ \ /'___\/\`'__\\/\ \ /\ '__`\\ \ \/ /',__\
/\ \L\ \ /\ \__/\ \ \/ \ \ \\ \ \L\ \\ \ \_ /\__, `\
\ `\____\\ \____\\ \_\ \ \_\\ \ ,__/ \ \__\\/\____/
\/_____/ \/____/ \/_/ \/_/ \ \ \/ \/__/ \/___/
\ \_\
\/_/
_ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( L )( o )( o )( n )( e )( y ) ( M )( e )( r )( c )( h )( a )( n )( t )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
__________________________________________________ __________________
|Directions |
|Set Public Chat to 'Hide' or 'Friends' and Trade/Compete to 'On' |
|Enter your message in line 40. |
|_________________________________________________ ___________________|}
program LooneyMerchant;
{.Include SRL/SRL.Scar}
{.include srl\srl\extended\xtext.scar}
{.include srl\srl\misc\trade.scar}
Const
Message1 = 'Text Goes Here'; //Enter the message you want to say
procedure autotype;
begin
TypeSend(Message1);
wait(2000);
end;
var
xx,yy,accepttradetab:integer;
xa,ya,tradeop1:integer;
function GetTraderName: string;//This is where the duplicate identifier error is
var
colonx, colony: Integer;
begin
if (TradeScreen) then
begin
if (IsTextInAreaEx(2, 31, 477, 50, colonx, colony, ':', 0, upchars, False,
True, 0, 0, 65535)) then
begin
Result := Trim(GetTextAtEx(colonx + 8, colony, 0, upchars, False, True, 0,
2, 65535, 12, False, tr_AlphaNumericChars))
end
else
WriteLn('Couldnt get trader name');
end;
end;
procedure DeclareBMPS;
begin
accepttradetab := BitmapFromString(19, 13, 'z78DA33301805A380D' +
'6C01989A48F5DF845686717ADED1D281BF193C4E8A29D1F9D E91E' +
'AA83D14600263E17DE');
tradeop1 := BitmapFromString(2, 1, '800080BBAE92');
end;
Procedure FindBMPS;
begin
if(FindBitmap(accepttrade,xx,yy))then
autotype;
if(FindBitmap(tradeop1,xa,ya))then
GetTraderName;
end;
begin
repeat
wait(1300)
autotype;
DeclareBMPS;
FindBMPS;
until(false)
end.