What is wrong with my if statements?
Simba Code:begin
repeat
if (not(MinethatOtherjoint)); and
(not(Minethatjoint)); then
Writeln('Couldnt find that purp lls');
until InvFull;
end.
What is wrong with my if statements?
Simba Code:begin
repeat
if (not(MinethatOtherjoint)); and
(not(Minethatjoint)); then
Writeln('Couldnt find that purp lls');
until InvFull;
end.
Your semi-colons..
I am Ggzz..
Hackintosher
i put them inside and now it gives me a parenthesis error... btw if hows ur itemfinding function coming along? i want to do a waterfiends bot but with cockroach soldiers lol
Change this ...
Simba Code:begin
repeat
if (not(MinethatOtherjoint)); and
(not(Minethatjoint)); then
Writeln('Couldnt find that purp lls');
until InvFull;
end.
... to this
Simba Code:begin
repeat
if (not MinethatOtherjoint) and (not Minethatjoint) then
Writeln('Couldnt find that purp lls');
until InvFull
end.
Ciao
NM
thanks! im getting a type mismatch error though..Imma see if i can figure it out myself![]()
your probably trying to use a procedure as a function
Currently: Working on Defending&Attacking in my Castle-Wars ScriptProject Rebuild: 90M/170M
Post your code
Ciao
NM
http://www.aspisfun.com/errors/typemismatch.html
Probably this, check it out.
For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip
here it is....
Simba Code:program Script;
{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
SetLength(Players, HowManyPlayers);
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Member := True;
Players[0].Active := True;
Players[0].Pin := '';
end;
procedure Minethatjoint; //Mines right rock
var
MyTPA : TPointArray;
MyPoint : TPoint;
x, y, i : Integer;
begin
FindColorsTolerance(MyTPA, 9209708, 388, 142, 424, 175, 10);
if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 11446662, MSX1, MSY1, MSX2, MSY2, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 3, 3);
if (IsUpTextMultiCustom(['ine'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, 1);
Wait(500+random(250));
Exit;
end;
Wait(350+random(350));
end;
end;
procedure MinethatOtherjoint; //Mines left rock
var
MyTPA : TPointArray;
MyPoint : TPoint;
x, y, i : Integer;
begin
FindColorsTolerance(MyTPA, 15327132, 248, 201, 274, 227, 10);
if Length(MyTPA) = 0 then
FindColorsTolerance(MyTPA, 9801842, 248, 201, 274, 227, 10);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 3, 3);
if (IsUpTextMultiCustom(['ine'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, 1);
Wait(500+random(250));
Exit;
end;
Wait(350+random(350));
end;
end;
begin
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
SetupSRL;
//ObjDTM_Setup;
DeclarePlayers;
begin
repeat
if (not MinethatOtherjoint) and (not Minethatjoint) then
Writeln('Couldnt find that purp lls');
until InvFull;
end;
end.
This is the error you get ...
What this means is that you have coded one variable type and then try to use it as another ie trying to use a boolean as an integer. PatDuffy actually gave you the answer a few posts back, and so did joeygupta.[Error] (86:56): Type mismatch at line 85
Compiling failed.
You need to change these two procedures to functions that return a boolean.
This ...
Simba Code:procedure Minethatjoint;
procedure MinethatOtherjoint;
... to this!
Simba Code:function Minethatjoint:boolean;
function MinethatOtherjoint:boolean;
Also in each function you need to set 'Result' to either true or false. 'Result' allocates if you will the answer of true or false to the name of the function. So that when you use this piece of code (below) - it will then work for you.
See the trivial function code below to illustrate ...
Simba Code:function EqualsOne:boolean;
var
x:Integer;
begin
if x = 1 then
Result := True
else
Result := False
end;
Then a statement like this will have meaning and be correct ...
Simba Code:... other code ...
if EqualsOne then // ie If EqualsOne is true then do.
...
else
...
end;
Last edited by NickMystre; 01-31-2012 at 01:00 PM.
Ciao
NM
For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip
thanks guys! i sort of understand now. happy belated birthday joeygupta! ima test it and see how it works out thanks again!
For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip
Instead of doing:
If X = 1 then
Result....
Do:
Result:= (X = 1);
Much cleaner.
I am Ggzz..
Hackintosher
There are currently 1 users browsing this thread. (0 members and 1 guests)