Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program SWFish0r;
- const
- {Player Detection Thingys:}
- NameColor = 62208; // Color of the name?
- nXS = 194;
- nYS = 203;
- nXE = 238;
- nYE = 220;
- // NOTE: Both up there are in SECONDS! (LogBackIn's)
- {-------------------------}
- MobX = 233;
- MobY = 256;
- {Fishing Stoof:}
- NetInInventoryBox = 1; // Is it in 1, 2 or 3? Keep other 2 empty for fishes.
- FishingSpotXS = 88;
- FishingSpotYS = 325;
- FishingSpotXE = 303;
- FishingSpotYE = 379;
- AlideFioling = True; // Fishing with alide fioling or not.. False for not.
- FiolingFKey = 'F1'; // The F* for alide fioles? Can be between F1-F8.
- {--------------}
- UntargetHP = 80;
- TargetHP = 180;
- var
- AFKey, EmptyColor1, efX, efY, EmptyColor2, Fish1X, Fish1Y, Fish2X, Fish2Y,
- targMark, afMark, FNetX, FNetY, MPMark, MyChars, wordCount, alarmMark, sayMark: Integer;
- PlayerIsDetected: Boolean;
- words: TStringArray;
- procedure TimeMark(var Mark: Integer);
- begin
- Mark:= GetSystemTime;
- end;
- function TimeFromTimeMark(var Mark: Integer): Integer;
- begin
- Result:= GetSystemTime - Mark;
- end;
- function FindColorInSkipBox(var x, y: Integer; TheColor: Integer; xFs, yFs, xFe, yFe, xIs, yIs, xIe, yIe: Integer): Boolean;
- begin
- if(FindColorSpiral(x, y, TheColor, xFs, yFs, xFe, yIs - 1))or
- (FindColorSpiral(x, y, TheColor, xFs, yIs, xIs - 1, yIe))or
- (FindColorSpiral(x, y, TheColor, xFs + 1, yIe + 1, xFe, yFe))or
- (FindColorSpiral(x, y, TheColor, xIe + 1, yIs, xFe, yIe))then
- Result:= True
- else
- Result:= False;
- end;
- function GetHP: Integer;
- begin
- Result := StrToIntDef(Trim(Copy(GetTextAtEx(462, 386, 0, MyChars, False, False, 0, 0, 16316664, 8, True, tr_AllChars), 0, 8)), -1);
- end;
- function GetMP: Integer;
- begin
- Result := StrToIntDef(Trim(Copy(GetTextAtEx(531, 386, 0, MyChars, False, False, 0, 0, 16316664, 8, True, tr_AllChars), 0, 8)), -1);
- end;
- function PlayerDetected: Boolean;
- var
- x, y: Integer;
- begin
- Result:= FindColorInSkipBox(x, y, NameColor, 3, 29, 442, 449, nXS, nYS, nXE, nYE);
- end;
- procedure SitDown;
- begin
- KeyDown(18);
- Wait(10);
- KeyDown(GetKeyCode('s'));
- Wait(25 + Random(15));
- KeyUp(GetKeyCode('s'));
- Wait(10);
- KeyUp(18);
- end;
- function TargetSet: Boolean;
- var
- TPA: TPointArray;
- begin
- if FindColors(TPA, 255, 142, 147, 289, 296) then
- Result := (Length(TPA) >= 50);
- SetLength(TPA, 0);
- end;
- procedure Target;
- var
- cur_HP, c_tm, c_tm2: Integer;
- begin
- cur_HP := GetHP;
- if (cur_HP <= UntargetHP) then
- begin
- KeyDown(17);
- Wait(20);
- repeat
- if ((GetSystemTime - c_tm) >= 800) then
- begin
- ClickMouse(214, 236, True);
- Wait(20);
- MoveMouse(615, 553);
- Wait(50);
- c_tm := GetSystemTime;
- end;
- if IsFKeyDown(12) then
- begin
- KeyUp(17);
- TerminateScript;
- end;
- Wait(1);
- until not TargetSet;
- KeyUp(17);
- SitDown;
- end;
- if not TargetSet then
- if (cur_HP >= TargetHP) then
- if ((GetSystemTime - targMark) >= 700) then
- begin
- KeyDown(16);
- Wait(25);
- ClickMouse(MobX, MobY, True);
- Wait(50);
- MoveMouse(615, 553);
- Wait(25);
- KeyUp(16);
- Wait(15);
- SitDown;
- end;
- end;
- procedure PDWait(Time: Integer);
- var
- Mark: Integer;
- begin
- TimeMark(Mark);
- repeat
- Target;
- if IsFKeyDown(12) then
- TerminateScript;
- if(PlayerDetected)then
- begin
- PlayerIsDetected := True;
- Break;
- end;
- Target;
- Wait(1);
- until (TimeFromTimeMark(Mark) >= Time);
- end;
- procedure TakeABreak;
- var
- m, c_tm: Integer;
- begin
- if ((GetSystemTime - sayMark) <= 300000) then
- Exit;
- PlaySound(ScriptPath + 'siren.wav');
- alarmMark := GetSystemTime;
- KeyDown(17);
- Wait(20);
- repeat
- if ((GetSystemTime - c_tm) >= 800) then
- begin
- ClickMouse(214, 236, True);
- Wait(20);
- MoveMouse(615, 553);
- Wait(50);
- c_tm := GetSystemTime;
- end;
- if IsFKeyDown(12) then
- TerminateScript;
- Wait(1);
- until not TargetSet;
- KeyUp(17);
- SitDown;
- m := GetSystemTime;
- repeat
- if IsFKeyDown(12) then
- TerminateScript;
- until ((GetSystemTime - m) >= 7000);
- SendKeys(words[Random(wordCount)] + Chr(13));
- sayMark := GetSystemTime;
- repeat
- Wait(1);
- if IsFKeyDown(12) then
- TerminateScript;
- if PlayerDetected then
- if ((GetSystemTime - alarmMark) >= 3000) then
- begin
- PlaySound(ScriptPath + 'siren.wav');
- alarmMark := GetSystemTime;
- end;
- until ((GetSystemTime - sayMark) >= 20000);
- end;
- procedure Warning;
- begin
- TakeABreak;
- if ((GetSystemTime - alarmMark) >= 3000) then
- begin
- PlaySound(ScriptPath + 'siren.wav');
- alarmMark := GetSystemTime;
- end;
- end;
- procedure SetupIT;
- begin
- MyChars := LoadChars2(ScriptPath + 'SWFont\');
- end;
- procedure UnSetupIT;
- begin
- FreeChars2(MyChars);
- end;
- procedure FishingSetup;
- begin
- case NetInInventoryBox of
- 1: begin
- EmptyColor1 := 5395018;
- EmptyColor2 := 3750193;
- FNetX := 490;
- FNetY := 257;
- Fish1X := 526;
- Fish1Y := 256;
- Fish2X := 567;
- Fish2Y := 257;
- end;
- 2: begin
- EmptyColor1 := 4541513;
- EmptyColor2 := 4344394;
- FNetX := 525;
- FNetY := 380;
- Fish1X := 495;
- Fish1Y := 385;
- Fish2X := 565;
- Fish2Y := 385;
- end;
- 3: begin
- EmptyColor1 := 4541513;
- EmptyColor2 := 5397082;
- FNetX := 562;
- FNetY := 380;
- Fish1X := 495;
- Fish1Y := 385;
- Fish2X := 530;
- Fish2Y := 385;
- end;
- else
- begin
- WriteLn('Unknown inventory box... Terminating.');
- TerminateScript;
- end;
- end;
- end;
- procedure FiolingSetup;
- begin
- case LowerCase(FiolingFKey) of
- 'f1': AFKey:= 112;
- 'f2': AFKey:= 113;
- 'f3': AFKey:= 114;
- 'f4': AFKey:= 115;
- 'f5': AFKey:= 116;
- 'f6': AFKey:= 117;
- 'f7': AFKey:= 118;
- 'f8': AFKey:= 119;
- else
- begin
- WriteLn('Unknown alide fioling FKey... Terminating.');
- TerminateScript;
- end
- end
- end;
- function CaughtFish: Boolean;
- begin
- if(not(GetColor(526, 262) <> 10865889 ))or
- (not(GetColor(564, 263) <> 6524065 ))or
- (not(GetColor(530, 263) <> 7049634 ))or
- (not(GetColor(525, 263) <> 4348256 ))or
- (not(GetColor(526, 263) <> 3952727 ))or
- (not(GetColor(561, 261) <> 11916518 ))then
- Result:= True
- else
- Result:= False;
- end;
- procedure EatFish;
- begin
- if IsFKeyDown(12) then
- TerminateScript;
- Target;
- MoveMouse(Fish1X - 5 + Random(15), Fish1Y - 5 + Random(15));
- GetMousePos(efX, efY);
- ClickMouse(efX, efY, False);
- MoveMouse(Fish2X - 5 + Random(15), Fish2Y - 5 + Random(15));
- GetMousePos(efX, efY);
- ClickMouse(efX, efY, False);
- PDWait(50);
- if PlayerIsDetected then
- Warning;
- end;
- procedure Fish;
- var
- fnX, fnY, fX, fY, rXf, rYf: Integer;
- begin
- Target;
- PDWait(1);
- if PlayerIsDetected then
- Warning;
- Target;
- rXf:= FishingSpotXE - FishingSpotXS;
- rYf:= FishingSpotYE - FishingSpotYS;
- PDWait(1);
- if PlayerIsDetected then
- Warning;
- MoveMouse(FNetX + Random(15), FNetY + Random(15));
- GetMousePos(fnX, fnY);
- ClickMouse(fnX, fnY, False);
- PDWait(30);
- if PlayerIsDetected then
- Warning;
- MoveMouse(FishingSpotXS + Random(rXf), FishingSpotYS + Random(rYf));
- GetMousePos(fX, fY);
- ClickMouse(fX, fY, True);
- PDWait(90);
- if PlayerIsDetected then
- Warning;
- end;
- procedure AlideFioleAndFish;
- begin
- while (GetMp >= 20) do
- begin
- PDWait(8);
- if PlayerIsDetected then
- Warning;
- if ((GetSystemTime - afMark) >= 2000) then
- begin
- KeyDown(AFKey);
- Wait(8);
- KeyUp(AFKey);
- afMark := GetSystemTime;
- end;
- PDWait(15);
- if PlayerIsDetected then
- Break;
- TimeMark(MPMark);
- repeat
- PDWait(15);
- if PlayerIsDetected then
- Warning;
- Fish;
- PDWait(15);
- if PlayerIsDetected then
- Warning;
- if (CaughtFish) then
- EatFish;
- PDWait(150 + Random(15));
- if PlayerIsDetected then
- Warning;
- until (TimeFromTimeMark(MPMark) >= 2000);
- PDWait(40);
- end;
- Target;
- if PlayerIsDetected then
- Warning;
- Fish;
- if CaughtFish then
- EatFish;
- PDWait(25 + Random(15));
- if PlayerIsDetected then
- Warning;
- end;
- procedure ScriptTerminate;
- begin
- PlaySound(ScriptPath + 'empty.wav');
- end;
- begin
- words := ['ey', 'eyyyy', 'sup', 'yoooo', 'hia', '=)', 'ello', 'hiya', '=p', 'MeOw',
- 'yo', 'allo!', 'hey.', 'oi', 'hi', 'hello', '=D'];
- wordCount := Length(words);
- FishingSetup;
- ActivateClient;
- Wait(100);
- if(AlideFioling)then
- FiolingSetup;
- SetupIT;
- repeat
- Target;
- PDWait(1);
- if PlayerIsDetected then
- Warning;
- if AlideFioling then
- AlideFioleAndFish
- else
- begin
- Target;
- Fish;
- if CaughtFish then
- EatFish;
- end;
- Target;
- until IsFKeyDown(12);
- UnSetupIT;
- end.
Advertisement
Add Comment
Please, Sign In to add comment