PDA

View Full Version : My own DropTo replacement



Floor66
02-13-2008, 05:37 PM
Since DropTo was deleted, i kinda remade it, its very simple:

{************************************************* ******************************
Own made DropTo (Floor66)
************************************************** *****************************}

function DropTo(var StartSlot, EndSlot: Integer): Boolean;
var I : Integer;

begin
for I := StartSlot to EndSlot do
begin
DropItem(i);
end;
end;


{************************************************* ******************************
End
************************************************** *****************************}


EDIT:
I get error 'Variable Expected' when used in this:

procedure Drop2;
var J, I : Integer;
begin //
if (Players[CurrentPlayer].Booleans[2] = True) then //
begin //It's about this part
J := Players[CurrentPlayer].Integers[1] + 1; //
DropTo(J, 28); //
end else {Ignore this}
begin
DropTo(2, 28);
end;
if (Players[CurrentPlayer].Strings[1] = 'Bait') then
begin
DropTo(3, 28);
end;{To this}
end;

malotthouse
02-13-2008, 05:39 PM
just use this:

dropitem(1-28);

edit: with your loop, you didn't assign a number to variable j.
after the first begin put j:=0;

that should do it

Floor66
02-13-2008, 05:46 PM
meh, i think its cooler to make big ass neat-o functions :P

And, J := 0; didnt work ..
Maybe this helps?

Players[1].Name := ''; //Username
Players[1].Pass := ''; //Password
Players[1].Nick := ''; //3-4 letters of username. e.x sern
Players[1].Active := True;
Players[1].Strings[1] := 'Net'; //Net, Bait, Cage, Harpoon.
Players[1].Booleans[1]:= True; //Wait 'WaitTime' after done loads? Recommended if you use 1 player only.
Players[1].Integers[1]:= 3 //Amount of fishing equipment used
Players[1].Booleans[2]:= True; //Use multi equipment?.

malotthouse
02-13-2008, 05:58 PM
do you have a full script? or are you just making this function on its own?

Floor66
02-13-2008, 06:00 PM
Well, this is the script:

(The commented drop procedure is my old)
It uses the include InvFinds.scar, wich contents my DropTo procedure, and some other things :P

program MultiPowerFisher;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Fishing.scar}
{.include InvFinds.scar}

var x, y, loads, aproxfish, Net, Rod, CageC,
HarpoonC, NetDTM, FLvl, CageDTM, HarpoonDTM, RodDTM : Integer;

{************************************************* ******************************
My 2nd Script!
______
// ) )
//___/ / ___ ___ __
/ ____ / // ) ) // / / / / //___) ) // ) )
// // / / // / / / / // //
// ((___/ / ((__( (__/ / ((____ //


/| //| |
//| // | | // __ ___ ( )
// | // | | // / / // / / / /
// | // | | // / / // / / / /
// |// | | ((___( ( // / / / /
_______
//______|
//___ ( ) ___ / __ ___ __
//____| / / (( ) ) // ) ) //___) ) // ) )
// / / \ \ // / / // //
// / / ) ) // / / ((____ //

______
// ) ) \\ / /
//___/ / \\ / /
/ __ ( \\/ /
// ) ) / /
//____/ / / /
______ _ __ __
| ____| | / / / /
| |__ | | ___ ___ _ __ / /_ / /_
| __| | |/ _ \ / _ \| '__| '_ \| '_ \
| | | | (_) | (_) | | | (_) | (_) |
|_| |_|\___/ \___/|_| \___/ \___/


ChangeLog:

[v1 To v2]:
*SMART
*MultiPlayer
*Proggy
*Net OR Bait possibility
*Everything i forgot ^^

[v2 To v2.01]:
*FindObjCustom in use now [Thx heavenzeyez1]

[v2.0.1 To v2.0.2]
*SRL Script stats!

[v2.0.2 To v2.0.3]
*Fixed Script stats
*Better proggy
*Some minor changes

[v2.0.3 To v2.0.4]
*Added Equipment checking DTM's

[v2.0.4 To v2.0.5]
*Multiple fishing types now!
*Better equipment finding!


Features:

*SMART!!
*MultiPlayer (tested)
*Good AntiBan
*AntiRandom
*Proggy!
*Multiple equipment
*SCAR Title says Loads+Fishes fished!
*Many many more!

Credits:

* The Script: Me.
* Lots of help: n3ss3s
* Little help: JuKKa, heavenzeyez1 (Eerik)
* A great community: SRL-Forums.com!
* For all those i forgot:
BIG THANKS!!


Quick HowTo:

Setup Between 72&101:
Set Constants (const)
Set PlayerSetup
Make sure the character(s) are
next to a fishing spot!

P.S: It's better to have SMART
loaded from before. (Just launch script, and Re-Play it).

Press play, let SMART load, and off it goes!

{************************************************* ******************************
BEGIN SETUP
************************************************** ******************************}

const
LoadsToDo = 3; //How much loads/player? 3~5 recommended (to prevent alot randoms)
Dir = 'n'; //n, e, s, w run direction
RFar = True; //Run far away from fight?
World = 155; //Wich world to launch SMART in?
WaitTime = 3; //Time to wait (see .Booleans[1]), random 1 minute will be added.

procedure PlayerSetup;
begin

SRLID := ''; // SRL Stats ID -
SRLPassword := ''; // SRL Stats Password -

HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);

Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //3-4 letters of username. e.x sern
Players[0].Active := True;
Players[0].Strings[1] := 'Net'; //Net, Bait, Cage, Harpoon.
Players[0].Booleans[1]:= True; //Wait 'WaitTime' after done loads? Recommended if you use 1 player only.
Players[0].Integers[1]:= 3; //Amount of fishing equipment used
Players[0].Booleans[2]:= True; //Use multi equipment?.

{Players[1].Name := ''; //Username
Players[1].Pass := ''; //Password
Players[1].Nick := ''; //3-4 letters of username. e.x sern
Players[1].Active := True;
Players[1].Strings[1] := 'Net'; //Net, Bait, Cage, Harpoon.
Players[1].Booleans[1]:= True; //Wait 'WaitTime' after done loads? Recommended if you use 1 player only.
Players[1].Integers[1]:= 3 //Amount of fishing equipment used
Players[1].Booleans[2]:= True; //Use multi equipment?.}

Writeln('Using ' + IntToStr(HowManyPlayers) + ' Player(s)');
end;

{************************************************* ******************************
END SETUP!
DONT EDIT BELOW UNLESS YOU KNOW WHAT UR DOING!!!
************************************************** ******************************}

procedure FailSafe;
begin
if (not(LoggedIn)) then Exit;
end;


procedure LoadDTMs;
begin
NetDTM := DTMFromString('78DA6314636060106440019ECE960CFF813 42' +
'310FF0702461120839D010D302291409A0F48701350C30A24 4409' +
'A801B9459A801A79202143408D12901026A0066406177E350 088E' +
'6070F');

CageDTM := DTMFromString('78DA631466606000612490E2C2C3F01F483 30' +
'2F17F20609402323818D000231209A4F981041B01355C4082 8B80' +
'1A16202144400D2B909024A0860F48C81150230E24E409A89 1051' +
'2E204D480ECE1C5AF06005B7A0733');

HarpoonDTM := DTMFromString('78DA631465606010664001610E5C0CFF813 42' +
'31083693920C1CC800618E16AC03C0920C14D400D1F909024 A086174' +
'82812500372AF140135D2408287801A05C2FE0200BFD40AE7 ');

RodDTM := DTMFromString('78DA6314646060106540038C0CFFC124942 70' +
'7245808A8910412EC04D4F0010921026A3880841801355C40 4286801' +
'A909FA409A891021282F8D5000009800938');

end;

procedure Drop2;
var J, I : Integer;
begin
if (Players[CurrentPlayer].Booleans[2] = True) then
begin
J := Players[CurrentPlayer].Integers[1] + 1;
DropTo(J, 28);
end else
begin
DropTo(2, 28);
end;
if (Players[CurrentPlayer].Strings[1] = 'Bait') then
begin
DropTo(3, 28);
end;
end;

{procedure Drop;
var I, J : Integer;
begin
if (Players[CurrentPlayer].Booleans[2] = True) then
begin
J := Players[CurrentPlayer].Integers[1] + 1;
for I := J to 28 do
DropItem(i);
end else
for I := 2 to 28 do
DropItem(i);
if (Players[CurrentPlayer].Strings[1] = 'Bait') then
begin
for I := 3 to 28 do
DropItem(i);
end;
end;}

procedure Prog;
begin
Writeln('=======================================') ;
Writeln(' ');
Writeln(' Floor66`s PowerNetter! ');
Writeln(' Ran for '+TimeRunning+' ! ');
Writeln(' '+Players[CurrentPlayer].Name+' Completed ' +IntToStr(Loads)+ ' Load(s) ');
Writeln(' '+Players[CurrentPlayer].Name+' Fished ' +IntToStr(AproxFish)+ ' Fishes ');
Writeln(' ©Floor66 ~ SRL-Forums.com ');
Writeln(' Post proggys!! ');
Writeln(' ');
Writeln('=======================================') ;
Writeln(' ');
Writeln(' ');
Writeln(' ');
Writeln(' ');
Writeln(' ');
end;

procedure RandomTalk;
begin
case random(21) of
0 : TypeSend('Hey');
1 : TypeSend('Sup?');
2 : TypeSend('Fish lbls?');
3 : TypeSend('Fish lvls?');
4 : TypeSend('Booriiing');
5 : TypeSend('....');
6 : TypeSend('This takes so long');
7 : TypeSend('Any skillers here?');
8 : TypeSend('Fish lvs?');
9 : TypeSend('>.<');
10: TypeSend('Hmm..');
11: TypeSend('..');
12: TypeSend(':P');
13: TypeSend('xD');
14: TypeSend('Fish lvls?');
15: TypeSend('Argh.. so much xp to lvl');
16: TypeSend('I got full friends list');
17: TypeSend('white: ');
18: TypeSend('Lol');
19: TypeSend('Boredom ftw');
20: TypeSend(' ..');

end;
end;

procedure AntiBan;
begin
FailSafe;
Status('AntiBanning');
case random(7) of
0: RandomRClick;
1: BoredHuman;
2: HoverSkill('fishing', False);
3: AlmostLogout;
4: SleepAndMoveMouse(2337+random(667));
5: RandomTalk;
6: PickUpMouse;
end;
Wait(2000+random(2000+random(500)));
end;

procedure FindSpotAndFish;
var c, c1, c2, c3 : Integer;
begin
FailSafe;
SetAngle(true);
Status('Searching, clicking spot');
if (Players[CurrentPlayer].Strings[1] = 'Net') then
begin
repeat
C := C + 1;
if (C = 50) then
begin
Writeln('Better luck next time.. couldnt find it in 50 times, now you have to wait for AntiBan to go..');
end;
until(FindObjCustom(x,y,['pot','ishing', 'et'],[15394011,13216659], 35));
begin
FailSafe;
Mouse(x, y, 5, 5, false);
ChooseOption('et');
Status('Clicked spot');
SleepAndMoveMouse(2500+random(1337+random(3000)));
C := 0;
end;
end;
if (Players[CurrentPlayer].Strings[1] = 'Bait') then
begin
repeat
C1 := C1 + 1;
if (C1 = 50) then
begin
Writeln('Better luck next time.. couldnt find it in 50 times, now you have to wait for AntiBan to go..');
end;
until(FindObjCustom(x,y,['pot','ishing', 'ait'],[15394011,13216659], 35));
begin
FailSafe;
Mouse(x, y, 5, 5, false);
ChooseOption('ait');
Status('Clicked spot');
SleepAndMoveMouse(2500+random(1337+random(3000)));
C1 := 0;
end;
end;
if (Players[CurrentPlayer].Strings[1] = 'Cage') then
begin
repeat
C2 := C2 + 1;
if (C2 = 50) then
begin
Writeln('Better luck next time.. couldnt find it in 50 times, now you have to wait for AntiBan to go..');
end;
until(FindObjCustom(x,y,['pot','ishing', 'age'],[15394011,13216659], 35));
begin
FailSafe;
Mouse(x, y, 5, 5, false);
ChooseOption('age');
Status('Clicked spot');
SleepAndMoveMouse(2500+random(1337+random(3000)));
C2 := 0;
end;
end;
if (Players[CurrentPlayer].Strings[1] = 'Harpoon') then
begin
repeat
C3 := C3 + 1;
if (C3 = 50) then
begin
Writeln('Better luck next time.. couldnt find it in 50 times, now you have to wait for AntiBan to go..');
end;
until(FindObjCustom(x,y,['pot','ishing', 'arpoon'],[15394011,13216659], 35));
begin
FailSafe;
Mouse(x, y, 5, 5, false);
ChooseOption('arpoon');
Status('Clicked spot');
SleepAndMoveMouse(2500+random(1337+random(3000)));
C3 := 0;
end;
end;
end;

procedure Randoms;
begin
FailSafe;
Status('Doing AntiRandom!');
if (FindFight = True) then
begin
RunTo(Dir, RFar);
Writeln('Found Fight!');
end;
if (FindTalk = True) then
begin
SolveChatRandoms := True;
end;
FindNormalRandoms;
if (Players[CurrentPlayer].Strings[1] = 'Bait') then
begin
FindFishingEquipmentColor('fishingrod');
Rod := GetColor(x, y);
FindFishingEquipment(Rod, 'Fishing Rod');
if (Players[CurrentPlayer].Strings[1] = 'Net') then
begin
FindFishingEquipmentColor('smallnet');
Net := GetColor(x, y);
FindFishingEquipment(Net, 'Small Fishing Net');
end;
if (Players[CurrentPlayer].Strings[1] = 'Cage') then
begin
FindFishingEquipmentColor('cage');
CageC := GetColor(x, y);
FindFishingEquipment(CageC, 'Lobster Cage');
end;
if (Players[CurrentPlayer].Strings[1] = 'Harpoon') then
begin
FindFishingEquipmentColor('harpoon');
HarpoonC := GetColor(x, y);
FindFishingEquipment(HarpoonC, 'Harpoon');
end;
if (NoGameTab = True) then
begin
LogOut;
NextPlayer(true);
end;
Wait(1000+random(2344));
end;
end;

procedure Find;
var Tries, Tries1, Tries2, Tries3, i : Integer;
begin
FailSafe;
if (Players[CurrentPlayer].Strings[1] = 'Net') then
begin
repeat
begin
Tries := Tries + 1;
if (Tries = 50) then
begin
Writeln('Didnt find net after 50 tries, make sure you have it!');
end;
end;
until(FindDTM(NetDTM, x, y, 1, 1, 800, 600) or CheckNet(i));
begin
Writeln('Found net!');
Tries := 0;
end;
if (Players[CurrentPlayer].Strings[1] = 'Bait') then
begin
repeat
begin
Tries1 := Tries1 + 1;
if (Tries1 = 50) then
begin
Writeln('Didnt find Fishing Rod after 50 tries! Make sure you have it!');
end;
end;
until(FindDTM(RodDTM, x, y, 1, 1, 800, 600) or CheckRod(i));
begin
Tries1 := 0;
Writeln('Found rod!');
end;
if (Players[CurrentPlayer].Strings[1] = 'Cage') then
begin
repeat
begin
Tries2 := Tries2 + 1;
if (Tries2 = 50) then
begin
Writeln('Didnt find cage after 50 tries, make sure you have it!');
end;
end;
until(FindDTM(CageDTM, x, y, 1, 1, 800, 600) or CheckCage(i));
begin
Writeln('Found cage!');
Tries2 := 0;
end;
if (Players[CurrentPlayer].Strings[1] = 'Harpoon') then
begin
repeat
begin
Tries3 := Tries3 + 1;
if (Tries3 = 50) then
begin
Writeln('Didnt find harpoon after 50 tries, make sure you have it!');
end;
end;
until(FindDTM(HarpoonDTM, x, y, 1, 1, 800, 600) or CheckHarpoon(i));
begin
Writeln('Found harpoon!');
Tries3 := 0;
end;
end;// Excuses for the ugly looking much ends!
end;// Excuses for the ugly looking much ends!
end;// Excuses for the ugly looking much ends!
end;// Excuses for the ugly looking much ends!
end;// Excuses for the ugly looking much ends!

procedure Prog2;
begin
Writeln('=======================================') ;
Writeln(''+Players[CurrentPlayer].Name+' Completed another load');
Writeln(''+Players[CurrentPlayer].Name+' Fished another ±27 Fishes');
Writeln('=======================================') ;
Writeln(' ');
Writeln(' ');
end;

procedure FreeDTMs;
begin
FreeDTM(NetDTM);
FreeDTM(CageDTM);
FreeDTM(HarpoonDTM);
end;

begin
SetUpSRL;
ScriptID := '637';
PlayerSetUp;
SmartSetupEx(World, False, False);
SetTargetDC(SmartGetDC);
ActivateClient;
if (SRLID = '') or (SRLPassword = '') then
begin
Writeln('Without SRLID this script will NOT work! Get one!');
TerminateScript;
end;
repeat
if (Players[CurrentPlayer].Active = False) then NextPlayer(True);
LoginPlayer;
LoadDTMs;
Find;
Repeat
Repeat
FailSafe;
FindSpotAndFish;
Randoms;
AntiBan;
Until(InvFull);
FailSafe;
Loads := Loads + 1;
ReportVars[0] := ReportVars[0] + 1;
AproxFish := AproxFish + 27;
ReportVars[1] := ReportVars[1] + 27;
SendSRLReport;
Disguise('Done ' + IntToStr(Loads) + ' Loads, Done aprox. ' +IntToStr(AproxFish)+ ' Fishies');
Status('Dropping');
Drop2;
FLvl := GetSkillInfo('fishing', false);
Writeln(''+Players[CurrentPlayer].Name+'`s Fish lvl is ' +IntToStr(FLvl)+'');
Prog2;
Until(Loads = LoadsToDo);
SRLRandomsReport;
SendSRLReport;
Prog;
FreeDTMs;
if (Players[CurrentPlayer].Booleans[1] = True) then
begin
Wait(WaitTime+random(1) * 60000);
end;
NextPlayer(true);
Until(false);
end.

malotthouse
02-13-2008, 06:13 PM
why don't you do this:


{************************************************* ******************************
Own made DropTo (Floor66)
************************************************** *****************************}

function DropTo(var StartSlot, EndSlot: Integer): Boolean;
var I : Integer;

begin
for I := StartSlot to EndSlot do
begin
DropItem(i);
end;
end;


{************************************************* ******************************
End
************************************************** *****************************}


and then make constants for Startslot and Endslot. so it would look something like this:

program New;
{.include SRL/SRL.scar}

var
i:Integer;


const
Startslot=2;
Endslot=28;

procedure Dropto;
begin
for I:= startslot to Endslot do
begin
DropItem(i);
end;
end;



begin
wait(2000);
DropTo;
end.

note- i turned it into a procedure, not a function... sorry if that screws you up but im better with procedures.

malotthouse
02-13-2008, 06:18 PM
okay, so you are trying to tell the thing to drop everything except the number of equipment you use. ill work on it!

Floor66
02-13-2008, 06:19 PM
Yeha, thats what i meant, not that people have to set consts, but just, auto it :p
If u get it good to work +repp :)

malotthouse
02-13-2008, 06:32 PM
there. i redid it even better :)

also, i changed some of the stuff (playersinteger,playersstring, etc.) because i wanted to just make this part of the script. If you replace it back with the Players[currentplayer].integer[1] or whatever it should work.

program New;
{.include SRL/SRL.scar}

var
startslot,endslot,I:Integer;

const
playersinteger=3;
Playersstring='bait';
Playerboolean=True;

procedure DeclareDropTo;
begin
if Playerboolean=true then
begin
Startslot:= PlayersInteger+1;
Endslot:=28;
end else
Startslot:=2;
Endslot:=28;
if Playersstring='bait' then
begin
Startslot:=3;
Endslot:=28
end;
end;



procedure Dropto;
begin
for I:= startslot to Endslot do
begin
DropItem(i);
writeln('dropped');
end;
end;




begin
wait(2000);
Dropto;
end.

Floor66
02-13-2008, 06:44 PM
+rep well eart ^^