ok ive spent likje 2 hours trying to fix this part of a script and i cant figure it out i cant remember all the parts of the script. can anyone just please do me a favor and help me out and fix it for me? what i want it to do is autocolor something and if it doesnt find a certain color in a certain direction. itll go in a diff direction and if it finds a certain color in that direction then it wont do it and itll go onto next direction. if it finds the color in all 4 directions itll go onto portions of a direction. and if i tfinds all of them there then itll do a random radial walk. oh yeah and if it doesnt find the color in the direction it should radial walk in that direction. heres what i have. please help i just learned radial walking today =)
program New;
{.include srl/srl.scar}
const
tlx1 = 573;
tly1 = 2;
tlx2 = 646;
tly2 = 82;
trx1 = 728;
try1 = 5;
trx2 = 650;
try2 = 82;
brx1 = 733;
bry1 = 159;
brx2 = 650;
bry2 = 84;
blx1 = 568;
bly1 = 159;
blx2 = 646;
bly2 = 84;
M11 = 586;
M22 = 10;
M33 = 725;
M44 = 160;
upx1 = 632;
upy1 = 27;
upx2 = 659;
upy2 = 66;
rightx1 = 705;
righty1 = 76;
rightx2 = 656;
righty2 = 94;
downx1 = 632;
downy1 = 90;
downx2 = 665;
downy2 = 136;
leftx1 = 633;
lefty1 = 77;
leftx2 = 581;
lefty2 = 89;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := ''; //3 - 4 letters of YOUR username, example: sern
Players[0].Active :=True;
end;
Function Ftc : Boolean;
begin
if (findcolortolerance(x,y,195836,M11,m22,m33,m44,1)) then
begin
Result:= True;
end;
end;
var
tr: boolean;
tl: boolean;
br: boolean;
bl: boolean;
found: boolean;
up: boolean;
right: boolean;
down: boolean;
left: boolean;
exittime: integer;
exitmee: integer;
blackdot: integer;
whitedot: integer;
orangedot: integer;
procedure loadbmaps;
begin
blackdot := loadbitmap('c:\program files\scar 3.11\blackbmp.bmp');
whitedot := loadbitmap('c:\program files\scar 3.11\whitedot.bmp');
orangedot := loadbitmap('c:\program files\scar 3.11\lavadot.bmp');
end;
var
wallcolor: integer;
lavacolor: integer;
floorcolor: integer;
procedure walk;
begin
exittime := 0;
exitmee := 0;
loadbmaps;
wallcolor := Autocolorthis(whitedot, 60, mmx1, mmy1, mmx2, mmy2);
wait(10 + random(2));
writeln('whitedot is' +inttostr(wallcolor));
lavacolor := Autocolorthis(orangedot, 60, mmx1, mmy1, mmx2, mmy2);
wait(10 + random(2));
writeln('orangedot is' +inttostr(lavacolor));
floorcolor := Autocolorthis(blackdot, 60, mmx1, mmy1, mmx2, mmy2);
wait(10 + random(2));
writeln('blackdot is' +inttostr(floorcolor));
//
repeat
wait(10 + random(2));;
tl := false;
br := false;
bl := false;
tr := false;
up := false;
right := false;
down := false;
left := false;
//
if findcolortolerance(x,y,wallcolor,tlx1,tly1,tlx2,tl y2,2) or findcolortolerance(x,y,lavacolor,tlx1,tly1,tlx2,tl y2,2) then tl := true;
wait(10 + random(2));;
if findcolortolerance(x,y,wallcolor,trx1,try1,trx2,tr y2,2) or findcolortolerance(x,y,lavacolor,trx1,try1,trx2,tr y2,2) then tr := true;
wait(10 + random(2));;
if findcolortolerance(x,y,wallcolor,brx1,bry1,brx2,br y2,2) or findcolortolerance(x,y,lavacolor,brx1,bry1,brx2,br y2,2) then br := true;
wait(10 + random(2));;
if findcolortolerance(x,y,wallcolor,blx1,bly1,blx2,bl y2,2) or findcolortolerance(x,y,lavacolor,blx1,bly1,blx2,bl y2,2)then bl := true;
wait(10 + random(2));;
if tl = true and tr = true and br = true and bl = true then
//piece of procedure that finds piece of angle activates after direction in every way covered
begin
if findcolortolerance(x,y,wallcolor,upx1,upy1,upx2,up y2,2) or findcolortolerance(x,y,lavacolor,upx1,upy1,upx2,up y2,2) then up := true;
wait(10 + random(2));;
if findcolortolerance(x,y,wallcolor,rightx1,righty1,r ightx2,righty2,2) or findcolortolerance(x,y,lavacolor,rightx1,righty1,r ightx2,righty2,2) then right := true;
wait(10 + random(2));;
if findcolortolerance(x,y,wallcolor,downx1,downy1,dow nx2,downy2,2) or findcolortolerance(x,y,lavacolor,downx1,downy1,dow nx2,downy2,2) then down := true;
wait(10 + random(2));;
if findcolortolerance(x,y,wallcolor,leftx1,lefty1,lef tx2,lefty2,2) or findcolortolerance(x,y,lavacolor,leftx1,lefty1,lef tx2,lefty2,2) then left := true;
wait(10 + random(2));;
//if all directions and piees are covered
if left = true and right = true and up = true and down = true then
begin
Radialwalk( floorcolor, 0, 360, 65, 2 + random(2), 2 + random(2));
writeln('everything fucked up. did a random radial walk');
exit;
end;
wait(10 + random(2));;
case random(4) of
1: if up = false then begin RadialWalk( floorcolor , 346, 374, 65, 2 + random(2), 2 + random(2)); found := true;end;
2: if right = false then begin RadialWalk( floorcolor , 66, 105, 65, 2 + random(2), 2 + random(2)); found := true; end;
3: if down = false then begin RadialWalk( floorcolor , 141, 195, 65, 2 + random(2), 2 + random(2)); found := true; end;
4: if left = false then begin RadialWalk( floorcolor , 256, 293, 65, 2 + random(2), 2 + random(2)); found := true; end;
end;
end else begin
wait(10 + random(2));;
case random(4) of
1: if tl = false then begin RadialWalk( floorcolor , 271, 359, 67, 2 + random(2), 2 + random(2)); found := true; end;
2: if tr = false then begin RadialWalk( floorcolor , 1, 89, 67, 2 + random(2), 2 + random(2)); found := true; end;
3: if br = false then begin RadialWalk( floorcolor , 91, 179, 67, 2 + random(2), 2 + random(2)); found := true; end;
4: if bl = false then begin RadialWalk( floorcolor , 181, 269, 67, 2 + random(2), 2 + random(2)); found := true; end;
end;
end;
until(found = true or ftc);
Freebitmap(blackdot);
Freebitmap(orangedot);
Freebitmap(whitedot);
end;
//////////////
begin
wait(500 + random(500));
setupsrl;
wait(500 + random(500));
activateclient;
wait(500 + random(500));
Declareplayers;
wait(500 + random(500));
if not(loggedin) then loginplayer;
repeat
walk;
wait(100 + random(100));
until(false);
end.
Edit: sorry for no scripting standards =/ i have to read a tut on how to do them
Edit 2: fixed some stuff in script forgot to put in there. also took out an extra end
Edit 3: wow i never thought id do an edit 3... anyways umm i fixed the script...no idea how but it works now


Reply With Quote