Log in

View Full Version : Need quick help for first script.(Fiisher)



Cerealkillr
02-22-2012, 11:59 PM
So i just got into coding this week but im starting to put alot of time into it. I know its a really bad script but take it easy on me! I'm just trying to get basics down.

Right now my problem is that it clicks a fishing spot, then after antiban it clicks it again, but if theres another one close it will potentially click that one. Is there a way to set the first clicked fishing spot to be fished until false? Help me out please i want to keep coding@!.




---------------------------------------------------------------------------------




program new;
{$define srl5}
{$loadlib sps}
//{$define smart}
{$i srl/srl.simba}
{$i sps/sps.simba}
var
LobCage:Integer;

procedure AntiBan;
begin

case Random(70) of
0: RandomRClick;
1: GameTab(1 + Random(12));
2: PickUpMouse;
3: RandomMovement;
4: BoredHuman;
end;
end;

function FishSpotColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.17, 0.55);

if not (FindColorsTolerance(arP, 11972006, MSX1, MSY1, MSX2, MSY2, 9)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;


Function FishSpot:Boolean;
var
x,y,PlusOne,StartFishing,FishCounter:Integer;


Begin
MarkTime(StartFishing);
PlusOne:= InvCount+1;


If FindObjTPA(x,y,FishSpotColor,5,1,15,7,7,['Fish']) Then
Begin

WriteLn('Found Spot!');
MarkTime(FishCounter);
GetMousePos(x,y);


Case Random(2) Of
0: Mouse(x,y,2,2,True);
1: Begin

Mouse(x,y,2,2,False);

WaitOption('Fishi', 200+Random(100));
ChooseOption('Fishi');
end;
end; end; end;
procedure WhileFishing;
var
C:Integer;
begin
MarkTime(c);
begin
While(TimeFromMark(c))<7000 do
begin
Wait(100+random(2000));
AntiBan;


end;end;end;

Procedure DropFish;
var
x,y,FishDTM,I: Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;
Begin
FishDTM:=DTMFromString('mwQAAAHic42RgYFBgYWBQA2IDI DYBYi0oXwaIxYFYCoiTmBgYwoA4EIgjgDgBiNOBOAuIM4E4EYh nT5kCNI0JL2ZlIAwYicBwAACnzwbE');
LogPattern:=[5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23 ,27,4,8,12,16,20,24,28]

For I:=0 To 26 Do
Begin
SlotBox:=InvBox(LogPattern[I]);
If FindDTM(FishDTM,x,y,SlotBox.X1,SlotBox.Y1,SlotBox. X2,SlotBox.Y2) Then

Begin
MouseItem(LogPattern[I],0);
Wait(1+random(500));
ChooseOption('Dro');

End;
End;
End;






Begin
SetupSRL;
Repeat
FishSpot;
WhileFishing;
If InvFull Then
DropFish;
Until(false);

End.

RyGuy
02-23-2012, 12:03 AM
Use simba tags :)

Cerealkillr
02-23-2012, 12:07 AM
How do i do that?

RISK
02-23-2012, 12:10 AM
[simba]Your code goes here.[*/simba]

Remove the * and place your code in-between them like shown.

Cerealkillr
02-23-2012, 12:15 AM
Could someone show me an example using my code please. Sorry, its still alot to take in. Ive never heard of tags before.

masterBB
02-23-2012, 12:16 AM
While(TimeFromMark(c))<7000 do


should be


While(TimeFromMark(c)<7000) do

Cerealkillr
02-23-2012, 12:27 AM
Thanks :D.

I still have the issue with Clicking a different fishing spot sometimes tho. Can anyone script it in for me?

masterBB
02-23-2012, 12:28 AM
You mean like every 7 seconds? Cause that's what the script says it should do.

Cerealkillr
02-23-2012, 12:32 AM
Yes, sometimes it clicks to the spot beside where im fishing. I want it to remember the first spots location until it goes away tho then search for a new spot. (the one beside it)

Cerealkillr
02-23-2012, 01:38 AM
i assume its in this text


If FindObjTPA(x,y,FishSpotColor,5,1,15,7,7,['Net']) Then
Begin

WriteLn('Found Spot!');
MarkTime(FishCounter);
GetMousePos(x,y);




Case Random(2) Of
0: Mouse(x,y,2,2,True);
1: Begin

Mouse(x,y,2,2,False);

WaitOption('Net', 200+Random(100));
ChooseOption('Net');


end;end; end; end;

Hero
02-23-2012, 01:46 AM
program new;
{$define srl5}
{$loadlib sps}
//{$define smart}
{$i srl/srl.simba}
{$i sps/sps.simba}
var
LobCage:Integer;

procedure AntiBan;
begin

case Random(70) of
0: RandomRClick;
1: GameTab(1 + Random(12));
2: PickUpMouse;
3: RandomMovement;
4: BoredHuman;
end;
end;

function FishSpotColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.17, 0.55);

if not (FindColorsTolerance(arP, 11972006, MSX1, MSY1, MSX2, MSY2, 9)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;


Function FishSpot:Boolean;
var
x,y,PlusOne,StartFishing,FishCounter:Integer;


Begin
MarkTime(StartFishing);
PlusOne:= InvCount+1;


If FindObjTPA(x,y,FishSpotColor,5,1,15,7,7,['Fish']) Then
Begin

WriteLn('Found Spot!');
MarkTime(FishCounter);
GetMousePos(x,y);


Case Random(2) Of
0: Mouse(x,y,2,2,True);
1: Begin

Mouse(x,y,2,2,False);

WaitOption('Fishi', 200+Random(100));
ChooseOption('Fishi');
end;
end; end; end;
procedure WhileFishing;
var
C:Integer;
begin
MarkTime(c);
begin
While(TimeFromMark(c))<7000 do
begin
Wait(100+random(2000));
AntiBan;


end;end;end;

Procedure DropFish;
var
x,y,FishDTM,I: Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;
Begin
FishDTM:=DTMFromString('mwQAAAHic42RgYFBgYWBQA2IDI DYBYi0oXwaIxYFYCoiTmBgYwoA4EIgjgDgBiNOBOAuIM4E4EYh nT5kCNI0JL2ZlIAwYicBwAACnzwbE');
LogPattern:=[5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23 ,27,4,8,12,16,20,24,28]

For I:=0 To 26 Do
Begin
SlotBox:=InvBox(LogPattern[I]);
If FindDTM(FishDTM,x,y,SlotBox.X1,SlotBox.Y1,SlotBox. X2,SlotBox.Y2) Then

Begin
MouseItem(LogPattern[I],0);
Wait(1+random(500));
ChooseOption('Dro');

End;
End;
End;






Begin
SetupSRL;
Repeat
FishSpot;
WhileFishing;
If InvFull Then
DropFish;
Until(false);

End.

This had me laughing.

http://puu.sh/hZsH

Cerealkillr
02-23-2012, 02:40 AM
First script, glad your amused.