SRL Archive - Senior Scripts and Snippets

What needs done?


pwnaz0r

2007-12-31 14:50:48

Well, to be honest, I'm really bored.. I want to do something. If anyone has any ideas, please feel free to post here.

Town

2007-12-31 14:56:46

Make a canvas game.

Special Ed

2008-01-02 16:20:09

Make a BigFish Handler meaning you call it when your fishing to check if there is a big fish, and if there is it will find your equipment (if it took it) and pick it up off the ground. I was working on one but I never get one to test it on…


procedure HandleBigFish;
var
Bx, By, Fx, Fy, a: Integer;
i, ArrLength: Byte;
tSpot: TBoxArray;
begin
if(not(LoggedIn))then Exit;
ColorToleranceSpeed(2);
if(FindColorTolerance(Bx, By, 4675930, Area[FTN].x1, Area[FTN].y1, Area[FTN].x2, Area[FTN].y2, 7))then
begin
while(FindColorTolerance(Bx, By, 4675930, Area[FTN].x1, Area[FTN].y1, Area[FTN].x2, Area[FTN].y2, 7))do
Wait(36);
Wait(250 + Random(100));
ColorToleranceSpeed(0);
Fx:= MSCX;
Fy:= MSCY;
SetArrayLength(tSpot, 1);
tSpot[0].x1:= MSX1;
tSpot[0].y1:= MSY1;
tSpot[0].x2:= MSX2;
tSpot[0].y2:= MSY2;
for i:= 0 to GetArrayLength(Equip.Slots[CurrentPlayer]) - 1 do
if(not(ExistsItem(Equip.Slots[CurrentPlayer][i])))then
begin
if(FindColorSpiralTolerance(Fx, Fy, 16363446, MSX1, MSY1, MSX2, MSY2, 26))then
begin
while(FindColorSpiralTolerance(Fx, Fy, 16363446, tSpot[a].x1, tSpot[a].y1, tSpot[a].x2, tSpot[a].y2, 26))do
begin
a:= a + 1;
SetArrayLength(tSpot, a + 1);
tSpot[a].x1:= Fx - 60;
tSpot[a].y1:= Fy - 60;
tSpot[a].x2:= Fx + 60;
tSpot[a].y2:= Fy + 60;
Wait(150);
end;
Wait(100 + Random(50));
FFlag(0);
Wait(500 + Random(150));
ArrLength:= High(tSpot);
ColorToleranceSpeed(Equip.Color[CurrentPlayer][2]);
if(FindColorSpiralTolerance(Bx, By, Equip.Color[CurrentPlayer][0], tSpot[ArrLength].x1, tSpot[ArrLength].y1, tSpot[ArrLength].x2, tSpot[ArrLength].y2, Equip.Color[CurrentPlayer][1]))then
begin
if(CountColorTolerance(Equip.Color[CurrentPlayer][0], Bx - 20, By - 20, Bx + 20, By + 20, Equip.Color[CurrentPlayer][1]) > 9)then
begin
MMouse(Bx, By, 0, 0);
Wait(250 + Random(100));
if(IsUpText(Equip.Name[CurrentPlayer]))then
begin
Mouse(Bx, By, 0, 0, True);
FFlag(0);
Wait(250 + Random(100));
end;
end;
end else
begin
Mouse(Fx, Fy, 0, 0, False);
if(ChooseOption(Equip.Name[CurrentPlayer]))then
begin
FFlag(0);
Wait(250 + Random(100));
end;
end;
end else Exit;
end else Exit;
end else Exit;
ColorToleranceSpeed(1);
end;

From my powerfisher… that I'm still working on… XD

The Claw

2008-01-02 20:59:19

special ed, just a tip - forget about finding the big fish in the water, instead search the inventory for your equipment and if the bitmap isnt found, assume the fish has taken it and its on the floor :)

Special Ed

2008-01-03 15:54:02

Well I guess that would probably be better, but the main thing I'm trying to do is figure out a way to have SCAR follow the little water ball thing, so that it can just click where the equipment is, because sometimes people are standing on where it landed or there are similar colored objects on the screen.

Your right about not having to detect the fish if you want to do it the easy way, but the order of the BigFish random goes like this…

  • Fish Appears
  • Stop Fishing
  • Fish Disappears
  • Waterball Appears
  • Waterball Disappears
  • Equipment Disappears in Inventory
  • Equipment Appears in Mainscreen


at least I think thats how it goes. If the equipment disappears before the waterball does then I think not searching for the fish would be better like you said, but for the sake of human-ness and accuracy I want to see if we can make it "SMART"-er.