Line 56: [Error] (16690:18): Type mismatch in script,Code:if TradeScreen then begin repeat Wait(1000); until(not TradeScreen); end; end;
What should i do to fix it?
Line 56: [Error] (16690:18): Type mismatch in script,Code:if TradeScreen then begin repeat Wait(1000); until(not TradeScreen); end; end;
What should i do to fix it?
is better standards, but post the whole scriptSCAR Code:if(TradeScreen)then
which line is 56?
Project: Welcome To Rainbow
Line 56 is the first line, 'if TradeScreen then'
benjaa, that's worse standards.
It should be if TradeScreen then.
Let me check to see if there's any syntax.
Try this:
SCAR Code:if not TradeScreen = 0 then
begin
repeat
Wait(1000);
until(not TradeScreen = 0);
end;
SCAR Code:program PC;
{.include SRL/SRL.scar}
{.include SRL/SRL/misc/trade.scar}
var
tradename: string;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'aaa';
Players[0].Pass := 'aaa;
Players[0].Nick := 'aaa;
Players[0].Active := True;
end;
procedure SetUp;
begin
SetupSRL;
writeln('Barts Trade helper!');
Wait(500);
ActivateClient;
if not LoggedIn then LogInPlayer;
end;
procedure SayText;
begin
SendKeys('glow2:shake:trade me for your price checks!');
Wait(300+random(300));
SendKeys(chr(13));
Wait(2000);
end;
procedure AntiRandom;
begin
FindNormalRandoms;
FindTalk;
if FindFight then RunAway('s', true, 1, 7000+random(3000));
end;
procedure CheckTrades;
begin
SayText;
AntiRandom;
if SomeoneTrades then
begin
tradename := GetTradersName;
SendKeys('Now trading '+ tradename);
Wait(300);
SendKeys(chr(13));
AcceptTrade;
end;
if (TradeScreen) then
begin
repeat
Wait(1000);
until(not TradeScreen);
end;
end;
begin
DeclarePlayers;
repeat
CheckTrades;
until(false);
end.
this is the whole script
You have syntax error in your declareplayers btw. That part you were talking about should be fine (other than poor standards), considering that all your function were written correctly. Don't know why you are getting error there.
However, there is a lot to improve on this script though. Good luck with it.
Freakymonkey: It's because TradeScreen returns an Integer, not a Boolean.
The integers are: 1 and 2 for trade screen, 0 for neither.
Oh, I stand corrected thanks Tv didn't know that.
SCAR Code:{*******************************************************************************
function TradeScreen: Integer;
By: ZephyrsFury and EvilChicken!
Description: Returns 1 or 2 for the respective tradescreens, 0 if neither is open.
*******************************************************************************}
function TradeScreen: Integer;
begin
Result := 0;
if GetColor(90, 61) = 2070783 then
Result := 1
else
if GetColor(142, 55) = 0 then
Result := 2;
end;
![]()
Shorter:
SCAR Code:While TradeScreen = 0 Do
Wait(1000);
asif, if(TradeScreen)then is much better standards
that's the way it should be written in C++ and HAS to be in GML
Project: Welcome To Rainbow
C++/GML != Pascal.
Well I don't know if you fixed this but here is an error.
SCAR Code:procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'aaa';
Players[0].Pass := 'aaa;
Players[0].Nick := 'aaa;
Players[0].Active := True;
end;
Should be:
SCAR Code:procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'aaa';
Players[0].Pass := 'aaa';
Players[0].Nick := 'aaa';
Players[0].Active := True;
end;
Hope this helps
~Camo
Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
{ MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }
When posting a bug, please post debug! Help us, help you!
I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.
SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.
TradeScreen IS NOT a boolean!
It returns an integer!
Look in Amount.scar for the answer to your question.
There are currently 1 users browsing this thread. (0 members and 1 guests)