Log in

View Full Version : Why doesn't this work?



KeepBotting
11-17-2012, 12:38 AM
This procedure does nothing when run in conjunction with the rest of my script, but works perfectly on its own.

Procedure:
procedure WalkMine;
begin
FindNormalRandoms;
AntiBanLg;
SPS_Setup(RUNESCAPE_SURFACE,['11_7','10_7']);
WriteLn('We have finished resting. Walking back to the mine...');
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
WalkToMine := [Point(4583, 2892), Point(4581, 2911), Point(4582, 2929), Point(4567, 2932), Point(4545, 2935), Point(4531, 2935), Point(4514, 2939), Point(4501, 2949), Point(4492, 2960), Point(4483, 2970), Point(4472, 2975), Point(4456, 2985), Point(4442, 2985), Point(4421, 2985), Point(4399, 2986), Point(4374, 2984), Point(4352, 2992), Point(4332, 2991), Point(4313, 2980), Point(4301, 2970), Point(4282, 2969), Point(4236, 2969), Point(4231, 2993), Point(4223, 3002), Point(4216, 3022), Point(4209, 3038), Point(4199, 3047), Point(4186, 3052), Point(4168, 3055)];
SPS_WalkPath(WalkToMine);
WriteLn('We are at the mine. Mining clay...');
end;

Script:
program kbClayBanker;
{$DEFINE SMART} //Comment this and select a client to run this kbScript in an Internet browser/Runescape client.
{$i srl/srl.simba}
{$i sps/sps.simba}

var //Don't touch these or your walking/progress reports won't work.
WalkToBank:TPointArray;
WalkToMine:TPointArray;
ClayMined: integer;

///////////////////////////////////Start setting up the script here. Refer to the comments if you don't know what you're doing.
///////////////////////////////////
///// Start Setup ///////
///////////////////////////////////
///////////////////////////////////Start setting up the script here. Refer to the comments if you don't know what you're doing.

const
{---SMART Setup Constants---}
WORLD = 0; //Put your desired Runescape world number here. Leave it as 0 to choose a random world.
MEMBERS = False; //False if you are Free-To-Play. True if you are a Member.
SIGNED = True; //True if running a single account, False otherwise. This script only declares 1 player anyway, so just leave it alone.
{---------------------------}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'Your_Username'; //Your Runescape username here.
Players[0].Pass := 'Your_Password'; //Your Runescape password here.
Players[0].Active := True; //Set to True if you want to use this player. Set to False to disable this player.
Players[0].Pin := 'Your_Bank_PIN'; //Put your Bank PIN here. Leave alone if you don't have a Bank PIN.
end;

///////////////////////////////////Don't modify the script ANY FURTHER unless you know what you're doing. You could break stuff!
///////////////////////////////////
///// Stop Setup ///////
///////////////////////////////////
///////////////////////////////////Don't modify the script ANY FURTHER unless you know what you're doing. You could break stuff!

procedure GetInfo;
begin;
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~');
WriteLn('Welcome to kbClayBanker v1 by kbScripts and KeepBotting!');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~');
WriteLn('This script is 90% credit to kbScripts and KeepBotting, unless otherwise noted.');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~');
WriteLn('This script is 10% credit to Siel of Villavu!');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~');
WriteLn('New in v2: everything has been completely revamped the the script has been re-released..');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~');
end;

procedure AntiBanSm; //This keeps the banhammah from striking.
begin
if(not(LoggedIn))then
exit;
FindNormalRandoms;
case Random(20) of
0:
begin;
WriteLn('AntiBanSm chosen: Pick Up Mouse.');
PickUpMouse; //This simulates a human picking the mouse up off the mouse pad, then setting it back down.
end;
2:
begin
WriteLn('AntiBanSm chosen: Random Right-Click.');
RandomRClick; //This randomly right-clicks somewhere in the game.
end;
3:
begin
WriteLn('AntiBanSm chosen: Random Mouse/Camera Movement.');
RandomMovement; //This moves the mouse or camera around randomly.
end;
4:
begin
WriteLn('AntiBanSm chosen: Examine Random Inventory Item.');
ExamineInv; //This chooses a random item in your inventory, and examines it.
end;
end;
end;

procedure AntiBanLg; //This also keeps the banhammah from striking.
begin
if(not(LoggedIn))then
exit;
FindNormalRandoms;
case Random(3) of
0:
begin
WriteLn('AntiBanLg chosen: Hover Skill.');
HoverSkill('Mining', false); //This hovers your mouse over the Mining skill.
wait(1000+Random(500));
end;
1:
begin
WriteLn('AntiBanLg chosen: Move Camera.');
MakeCompass('N'); //This fiddles around with the Camera. Aligns the Camera North, rotates the Camera South, then aligns North again.
wait(50+random(100));
MakeCompass('S');
wait(50+random(100));
MakeCompass('N');
end;
2:
begin
WriteLn('AntiBanLg chosen: Bored Human.');
BoredHuman; //This makes the script act like a bored human playing Runescape!
end;
end;
end;

procedure MineClay; //Credits to Siel of Villavu for the V1.0+ MineClay procedure.
var x, y, PlusOne, RockCounter: integer;
begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
repeat
FindNormalRandoms;
ToggleXPBar(true);
PlusOne:= InvCount + 1
WriteLn('Finding a rock to mine...');
if FindObj(x, y, 'ocks', 7647960, 10) then //This finds the object, records the X and Y values,
//and tells the script to find the option "Rocks".
WriteLn('Mining rock.');
Mouse(x, y, 0, 0, true);
ChooseOption('lay'); //This tells the script to left-click on the object and select "Clay".
MarkTime(RockCounter);
AntiBanSm;
repeat
Wait(150);
FindNormalRandoms;
until (InvCount=PlusOne) Or (TimeFromMark(RockCounter) > 10000 + random(1000))
if (InvCount=PlusOne) then
Inc(ClayMined);
if FindBlackChatMessage('urrently not ore inthis rock') then
begin
MineClay;
end;
until (InvFull); //This is an Until function. It stops the repeat function if the rock has been mined or your inventory is full.
end;

procedure WalkBank;
begin
FindNormalRandoms;
AntiBanLg;
SPS_Setup(RUNESCAPE_SURFACE,['10_7', '11_7']);
WriteLn('Our inventory is full. Walking to bank....');
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
WalkToBank := [Point(4180, 3056), Point(4188, 3050), Point(4196, 3042), Point(4206, 3035), Point(4215, 3029), Point(4217, 3020), Point(4222, 3010), Point(4229, 3002), Point(4234, 2993), Point(4237, 2979), Point(4239, 2969), Point(4276, 2968), Point(4288, 2968), Point(4300, 2970), Point(4311, 2976), Point(4321, 2986), Point(4331, 2993), Point(4343, 2993), Point(4355, 2992), Point(4367, 2986), Point(4382, 2985), Point(4396, 2985), Point(4411, 2984), Point(4426, 2984), Point(4440, 2986), Point(4453, 2985), Point(4465, 2976), Point(4478, 2971), Point(4491, 2959), Point(4498, 2948), Point(4508, 2942), Point(4516, 2937), Point(4528, 2934), Point(4538, 2937), Point(4548, 2935), Point(4560, 2932), Point(4571, 2931), Point(4581, 2929), Point(4579, 2904)];
SPS_WalkPath(WalkToBank);
end;

procedure GetBank; //My procedure, "GetBank" does just what it says on the tin. It Gets the Bank,
//and it Gets it much faster than SRL can.
var x, y: integer; //Thanks to nosaj.421 for suggesting this. Please report any bugs.
begin
FindNormalRandoms;
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
AntiBanSm;
WriteLn('We are at the bank. Finding a banker...');
repeat
if FindObj(x, y, 'anker', 4664372, 10) then //Finds the Banker. I had to use the Banker
//because the Bank Booth matches way too many colors.
WriteLn('Found a banker. Opening bank...');
Mouse(x, y, 0, 0, false);
ChooseOption('ank Ban'); //Gets the Bank.
wait(2000+random(1000));
until (BankScreen) or (PinScreen);
if PinScreen then //Credits to Sin, the greatest scripter under the sun.
begin
WriteLn('PinScreen detected! Entering PIN...');
InPin(Players[CurrentPlayer].Pin);
WriteLn('Checking to see if successfully entered.');
wait(1500+random(100));
WriteLn('Successfully entered!');
end;
end;

procedure BankClay;
begin
FindNormalRandoms;
if OpenBank('vwb', False, True) then
WriteLn('Opened bank. Depositing clay...');
Deposit(2, 28, True);
CloseBank;
AntiBanLg;
WriteLn('We have finished banking. Resting...');
RestUntil(100);
SetRun(True);
end;

procedure ProgressReport;
begin
ClearDebug;
Writeln('***************************************** ***'); //Sexy progress report is sexy.
Writeln('* kbClayBanker v2 *');
Writeln('***************************************** ***');
Writeln('We have mined ' + IntToStr(ClayMined) + ' clay. ');
Writeln('We have gained ' + IntToStr(ClayMined*5) + ' xp.');
Writeln('We have been running for ' + TimeRunning + '');
WriteLn('***************************************** ***');
end;


procedure WalkMine;
begin
FindNormalRandoms;
AntiBanLg;
SPS_Setup(RUNESCAPE_SURFACE,['11_7','10_7']);
WriteLn('We have finished resting. Walking back to the mine...');
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
WalkToMine := [Point(4583, 2892), Point(4581, 2911), Point(4582, 2929), Point(4567, 2932), Point(4545, 2935), Point(4531, 2935), Point(4514, 2939), Point(4501, 2949), Point(4492, 2960), Point(4483, 2970), Point(4472, 2975), Point(4456, 2985), Point(4442, 2985), Point(4421, 2985), Point(4399, 2986), Point(4374, 2984), Point(4352, 2992), Point(4332, 2991), Point(4313, 2980), Point(4301, 2970), Point(4282, 2969), Point(4236, 2969), Point(4231, 2993), Point(4223, 3002), Point(4216, 3022), Point(4209, 3038), Point(4199, 3047), Point(4186, 3052), Point(4168, 3055)];
SPS_WalkPath(WalkToMine);
WriteLn('We are at the mine. Mining clay...');
end;

begin
SRL_SixHourFix := True; //Enables the 6-hour reload.
Smart_FixSpeed := True;
SetupSRL; //This sets up SRL.

GetInfo; //This runs your GetInfo procedure, giving you information about this particular kbScript.
DeclarePlayers; //This runs your DeclarePlayers procedure, making sure that the script has a player to run.
LoginPlayer; //This logs in your player.

repeat
MineClay; //This mines your clay.
WalkBank; //This walks you to the bank.
GetBank; //My new banking procedure called GetBank opens the bank much faster than SRL doesd.
BankClay; //This banks your clay
ProgressReport; //This writes your progress reports.
WalkMine; //This walks you back to the mine.
until AllPlayersInactive;
end.


Help?

riwu
11-17-2012, 12:53 AM
if OpenBank('vwb', False, True) then
WriteLn('Opened bank. Depositing clay...');
Deposit(2, 28, True);
CloseBank;
AntiBanLg;
WriteLn('We have finished banking. Resting...');
RestUntil(100);
SetRun(True);

you forget a begin and end there.

Did your debug write 'We have finished resting. Walking back to the mine...'?

KeepBotting
11-17-2012, 12:53 AM
if OpenBank('vwb', False, True) then
WriteLn('Opened bank. Depositing clay...');
Deposit(2, 28, True);
CloseBank;
AntiBanLg;
WriteLn('We have finished banking. Resting...');
RestUntil(100);
SetRun(True);

you forget a begin and end there.

Did your debug write 'We have finished resting. Walking back to the mine...'?Whoopsie.

And yes it did. But it didn't walk back to the mine.

riwu
11-17-2012, 01:14 AM
Whoopsie.

And yes it did. But it didn't walk back to the mine.
That means SPS walk failed. The SPS maps are outdated afaik, use a different method or create your custom SPS maps.

KeepBotting
11-17-2012, 01:16 AM
That means SPS walk failed. The SPS maps are outdated afaik, use a different method or create your custom SPS maps.But my other one works fine.

riwu
11-17-2012, 01:19 AM
Try adding more debugs?

if SPS_WalkPath(WalkToMine) then
writeln('SPS walk succeeded')
else
writeln('SPS sucks');