P1ng
2012-05-22 01:47:48
Not actually my first script, but it is my first script posted here and my first for testing out walking methods. I've tried ODTM, SPS and have now resorted to TPA for walking. I am attempting to test all walking methods and find what works best for me in different situations for future script-releases (my current WIP - guild miner).
- ODTM can't find it's way back to the bank due to lack of trees/ladders/etc
- SPS simply doesn't want to work for me
- TPA seems to be working quite well so far..
Aside from the walking this script still has some issues and is far from functional.
Main issues that I haven't been able to resolve are -
- Mainloop doesn't wish to repeat despite looping it both in my mainloop procedure and in the scripts official loop. I can't understand why, if someone has an explanation/fix for this it would be greatly appreciated. RESOLVED - Slight alteration to 'WalkBank' function and a 'continue' added to mainloop.
- I found the best method for finding the fountain was to use the FindObject function in ACA, and it is indeed quite successful in finding the fountain without looking bot-like, however it takes quite some time (don't have a great enough understanding of TPAs to make my own yet). RESOLVED - Using function posted by alevere4
- OpenBankNPC has so much trouble especially when on a heavily populated/laggy server. But I can't seem to find another option for banking at the GE. EDITED - Input a different function for finding and opening bank, still quite slow and bot-like.
- Also, despite my best attempts the script does not wait until 'dtm_Vial' is no longer visible in the inventory while filling and simply does the static wait then returns to the bank. RESOLVED - Changed repeat-until to a while-do statement.
- ODTM can't find it's way back to the bank due to lack of trees/ladders/etc
- SPS simply doesn't want to work for me
- TPA seems to be working quite well so far..
Aside from the walking this script still has some issues and is far from functional.
Main issues that I haven't been able to resolve are -
- Mainloop doesn't wish to repeat despite looping it both in my mainloop procedure and in the scripts official loop. I can't understand why, if someone has an explanation/fix for this it would be greatly appreciated. RESOLVED - Slight alteration to 'WalkBank' function and a 'continue' added to mainloop.
- I found the best method for finding the fountain was to use the FindObject function in ACA, and it is indeed quite successful in finding the fountain without looking bot-like, however it takes quite some time (don't have a great enough understanding of TPAs to make my own yet). RESOLVED - Using function posted by alevere4
- OpenBankNPC has so much trouble especially when on a heavily populated/laggy server. But I can't seem to find another option for banking at the GE. EDITED - Input a different function for finding and opening bank, still quite slow and bot-like.
- Also, despite my best attempts the script does not wait until 'dtm_Vial' is no longer visible in the inventory while filling and simply does the static wait then returns to the bank. RESOLVED - Changed repeat-until to a while-do statement.
Begin at NW bank of the Grand Exchange.
Have unfilled vials in first bank slot.
Post Proggies, bugs, suggestions and criticisms.
Have unfilled vials in first bank slot.
Post Proggies, bugs, suggestions and criticisms.
program Vi4lFi11er;
{$DEFINE SMART}
{$i srl/srl.simba}
var
dtm_Vial, dtm_Filled, FilledUp: integer;
x, y, C: integer;
const
VIALTOTAL = 300;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
// Start In GE North West Bank + Empty Vials In First Bank Slot //
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Pin := ''; // PIN
Players[0].Active :=True;
end;
procedure SetupLogin;
begin
ClearDebug;
Smart_Server := 0; // Preferred World Or 0 For Random//
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
if not LoggedIn then
LoginPlayer;
ActivateClient;
end;
//Antibanning
procedure AntiBan;
begin
if not LoggedIn then
Exit;
if not FindNormalRandoms then
begin
Status('AntiBan');
FindNormalRandoms;
FindNonInventoryRandoms;
LevelUpEx(false, true)
FindMod;
FindSpinTicket;
case Random(1000) Of
10:
begin
HoverSkill('random', False);
Wait(RandomRange(2000,2500));
GameTab(Tab_Inv);
end;
20:
begin
PickUpMouse;
end;
30:
begin
RandomMovement;
end;
40:
begin
RandomRClick;
end;
50:
begin
BoredHuman;
end;
60:
begin
ExamineInv;
end;
end;
end;
end;
function FindGEBank(x, y: Integer): Boolean;
var
CTS, I: Integer;
MyTPA: TPointArray;
ATPA: array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.45);
FindColorsSpiralTolerance(MSCX, MSCY, MyTPA, 4085863, MSX1, MSY1, MSX2, MSY2, 11);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(MyTPA, 20, 20);
for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 0, 0);
if (WaitUpTextMulti(['ank','ker','Ban','anker'],800)) then
begin
Result := True;
GetMousePos(x, y);
Break;
end;
end;
end;
// openbank
function OpenGE: Boolean;
begin
Status('OpenGE');
if not LoggedIn then
Exit else
if FindNormalRandoms then
Exit else
begin
SetAngle(SRL_ANGLE_LOW);
Wait(RandomRange(500,800));
if IsUpText('anker') then
ClickMouse2(mouse_left) else
if FindGEBank(x, y) then
begin
repeat
ClickMouse2(mouse_right);
WaitOption('ank B',2000);
FFlag(0);
Wait(RandomRange(1000,1500));
if BankScreen then
begin
Result := True;
Exit;
end else
Result := False;
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
Result := True;
Exit;
until BankScreen;
end else
CompassMovement(10, 30, false);
end;
end;
// deposititall
function DepositItAll: Boolean;
begin
Status('DepositItAll');
if not LoggedIn then
Exit else
if FindNormalRandoms then
Exit else
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
if BankScreen then
if InvCount <> 0 then
begin
Deposit(1, 28, True);
Result := True;
Exit;
end else
Result := False;
if InvCount = 0 then
Result := True;
Exit;
end;
// withdraw empty vials
function WithdVials: Boolean;
var
i: integer;
begin
Status('WithdVials');
if not LoggedIn then
Exit else
if FindNormalRandoms then
Exit else
if BankScreen then
begin
repeat
C := (GetBankItemAmount(0, 0))
if C < 29 then
TerminateScript else
Inc(i);
Withdraw(0, 0, 0);
Wait(RandomRange(1000,1500));
if InvFull then
begin
Result := True;
CloseBank;
Exit;
end else
Result := False;
Continue;
until(InvFull) or (i > 5);
end;
end;
// walkfountain
function WalkFountain: Boolean;
begin
Status('WalkFountain');
if not LoggedIn then
Exit else
if FindNormalRandoms then
Exit else
if BankScreen then
CloseBank else
MakeCompass('n');
SetAngle(SRL_ANGLE_HIGH);
if TPAWalk(9869214,10,0,0,point(MMX2, MMY2)) then
begin
FFlag(0);
While IsMoving do
Wait(RandomRange(50,100));
SymbolAccuracy := 0.3;
FindSymbolIn(x,y,'water',MMX1,MMY1,MMX2,MMY2);
Result := True;
Exit;
end else
SymbolAccuracy := 0.3;
if FindSymbolIn(x,y,'water',MMX1,MMY1,MMX2,MMY2) then
begin
WriteLn('Couldnt TPA walk, using symbol');
Mouse(x,y,2,2,true);
FFLag(0);
While IsMoving do
Wait(RandomRange(50,100));
Result := True;
end else
Result := False;
Exit;
end;
// walkbank
function WalkBank: Boolean;
begin
Status('WalkBank');
if not LoggedIn then
Exit else
if FindNormalRandoms then
Exit else
MakeCompass('n');
SetAngle(SRL_ANGLE_HIGH);
if TPAWalk(9869214,10,2,2,point(MMX1, MMY1)) then
begin
FFlag(0);
While IsMoving do
Wait(RandomRange(50,100));
SymbolAccuracy := 0.3;
FindSymbolIn(x,y,'bank',MMX1,MMY1,MMX2,MMY2);
Result := True;
Exit;
end else
SymbolAccuracy := 0.3;
if FindSymbolIn(x,y,'herbalist',MMX1,MMY1,MMX2,MMY2) then
begin
WriteLn('Couldnt TPA walk, using symbol');
Mouse(x,y,2,2,true);
FFLag(0);
While IsMoving do
Wait(RandomRange(50,100));
SymbolAccuracy := 0.3;
FindSymbolIn(x,y,'bank',MMX1,MMY1,MMX2,MMY2);
FFlag(0);
Result := True;
Exit;
end else
Result := False;
end;
// proggy
procedure Proggy;
begin
ClearDebug;
Writeln('|------>P1ngs Vi4l Fi11er<------|');
WriteLn('# Of Vials Filled: ' + IntToStr(FilledUp));
Writeln('Vials Per Hr: ' + IntToStr(round(3600000 * 1.0 / GetTimeRunning * FilledUp)));
WriteLn('Time runn1ng: ' + TimeRunning);
Writeln('|-------------------------------|');
end;
// loadDTMS
procedure LoadDTMs;
begin
dtm_Vial := DTMFromString('mggAAAHicY2NgYOAAYn4gFgZiXiBmBGImIBaBiosDsRwQS0HVJCWlQVWgYiMG7IARB4YAALUaAjI=');
dtm_Filled := DTMFromString('mggAAAHicY2NgYOAAYl4gFgBiISifEYj5gJgdiPmBWAKIpYFYHIjr2vYDSSYMbMSAHTDiwBAAANx8Aro=');
end;
// freeDTMS
procedure EndDTM;
begin
FreeDTM(dtm_Vial);
FreeDTM(dtm_Filled);
FreeSRL;
end;
function FindFountain(x, y: Integer): Boolean;
var
CTS, I: Integer;
MyTPA: TPointArray;
ATPA: array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.21, 0.56);
FindColorsSpiralTolerance(MSCX, MSCY, MyTPA, 11310978, MSX1, MSY1, MSX2, MSY2, 9);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(MyTPA, 30, 30);
for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 0, 0);
if (WaitUpText('ountain',800)) then
begin
Result := True;
GetMousePos(x, y);
Break;
end else
WriteLn('Fountain was not found');
end;
end;
function IsFilling: Boolean;
begin
Result := PixelShift(IntToBox(MSCX-30, MSCY-30, MSCX+30, MSCY+30), 500) > 300;
end;
procedure FillVials;
var
T: integer;
begin
Status('FillVials');
if not LoggedIn then
Exit else
if FindNormalRandoms then
Exit else
MakeCompass('n');
SetAngle(SRL_ANGLE_HIGH);
MarkTime(T);
Wait(RandomRange(500,700));
InvMouse(1,1);
Wait(RandomRange(300,500));
FindFountain(x, y);
ClickMouse2(mouse_left);
Wait(RandomRange(350,875));
while FindDTM(dtm_Vial,x,y,MIX1,MIY1,MIX2,MIY2) do
AntiBan;
Wait(RandomRange(2267,3294));
if (not(FindDTM(dtm_Vial,x,y,MIX1,MIY1,MIX2,MIY2))) then
begin
IncEx(FilledUp,28);
Exit;
end else
if (T > 25000 + Random(3000)) then
Exit;
end;
// mainloop
procedure MainLoop;
begin
repeat
if OpenGE then
begin
Wait(RandomRange(500,1000));
if DepositItAll then
begin
Wait(RandomRange(500,1000));
if WithdVials then
begin
Wait(RandomRange(500,1000));
if WalkFountain then
begin
Wait(RandomRange(500,1000));
FillVials;
Wait(RandomRange(500,1000));
if WalkBank then
begin
Wait(RandomRange(500,1000));
Proggy;
Continue;
end else
WriteLn('Couldnt Walk To Bank');
TerminateScript;
end else
WriteLn('Couldnt Walk To Fountain');
TerminateScript;
end else
WriteLn('Couldnt Withdraw Vials');
TerminateScript;
end else
WriteLn('Couldnt Deposit Items');
TerminateScript;
end else
WriteLn('Couldnt Open Bank');
TerminateScript;
until(not(LoggedIn)) or (FilledUp >= VIALTOTAL);
end;
begin
SetupLogin;
AddOnTerminate('EndDTM');
ActivateClient;
LoadDTMs;
Wait(RandomRange(1500,2000));
ExitSquealOfFortune;
if not LoggedIn then
Exit else
if FindNormalRandoms then
Exit else
MainLoop;
end.