I was inspired to write this by my complete inability to find an existing script that would take any two items and combine them without restrictions--specifically, the restriction of a left-click eat or consume option. This should be equally useful for cooking and moneymaking.
I owe some credit to Gucci for his Battlestaff Maker; I based my banking methods directly on his, though they are not direct copies (the withdrawl comes close, though). This has antiban (a standard procedure, variable wait times, and variable mouse speed), anti-randoms (completely useless for now, since it works at Soul Wars bank), and a basic (but usually reliable) failsafe.
I am aware that if the first inventory space has fourteen items left, and the third inventory space has at least that many, the failsafe will not function. I do not yet have the knowledge to check if inventory has actually changed, but that's what would be required.
Testing appreciated. I don't have much in the way of a proggy designed, so just let me know whether it worked, and please run for at least eleven inventories to test the mouse speed antiban.
Simba Code:
program RightClickCombiner;
// Script written by Nasus
// Credit to Gucci for basing my banking off his Battlestaff Maker
// Requirements: Stand in front of Soul Wars bank with empty inventory
// Intended items must be in first two slots of active bank tab
{$DEFINE SMART}
{$i srl/srl.simba}
var
loadsCombined, loadsAtSpeed, buttonColor, secondaryColor: Integer;
suppliesRemain: Boolean;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;
procedure Antiban;
begin
case Random(60) of // Random(60) generates a random integer from 0 to 59
10: RandomRClick;
20: HoverSkill('Cooking', False);
30: PickUpMouse;
40: RandomMovement;
50: BoredHuman;
59: ExamineInv;
end;
end;
procedure AntiRandoms; // We operate at Soul Wars, so no need for anti-randoms
begin // But let's include it anyway! Future use, maybe
FindNormalRandoms;
LampSkill := 'slayer';
end;
procedure CombineItems;
begin
//Writeln('Processing items now');
InvMouse(14, mouse_right); // Right-clicks first item, avoids consumption!
Wait(100 + Random(10));
ChooseOption('Use');
InvMouse(15, mouse_left);
// Only click to confirm operation when button has popped up!
buttonColor := GetColor(260, 430);
WaitColorGone(buttonColor, 260, 430, 4, 1000);
Wait(40 + Random(40)); // Slight human-like delay before continuing
Mouse(260, 430, 0, 0, True);
ClickMouse2(True);
// Tell this procedure to stop once all items are combined
secondaryColor := GetColor(702, 446);
if (not WaitColorGone(secondaryColor, 702, 446, 4, 20000)) then
Writeln('The script has advanced based on time, not color change.');
Wait(40 + Random(160)); // Slight human-like delay before continuing
end;
procedure GetItems; // Withdraws items from first two bank spaces
begin
//Writeln('Withdrawing items now);
Wait(200 + Random(100));
if (BankScreen) or (PinScreen) then // Confirms that we are in the bank
begin
if (PinScreen) then // Enter the PIN if required
repeat
InPin(Players[0].Pin);
until (BankScreen);
if (BankScreen) then
begin
DepositAll;
if (GetBankItemAmount(0, 0) <= 14) or (GetBankItemAmount(1, 0) <= 14) then
begin
suppliesRemain := False;
exit;
end;
Withdraw(0, 0, 14);
Withdraw(1, 0, 14);
Wait(200 + Random(100));
CloseBank;
end;
end;
end;
procedure DepositItems; // Banks items
begin
begin
//Writeln('Depositing inventory now');
OpenBankChest(SRL_BANK_SW);
if (BankScreen) then
begin
DepositAll;
Wait(200 + Random(100));
end;
end;
end;
procedure MainLoop;
begin
Repeat
GetItems; // Requires bank to be open, hence opening before loop
if (suppliesRemain) then // Don't want to try to mix items if we're out!
begin
CombineItems;
Antirandoms; // If we get randomed, it will be during prior step
Antiban; // Randomness in waiting timers will also contribute
LevelUp; // Just in case...
DepositItems;
Inc(loadsCombined);
Inc(loadsAtSpeed);
Writeln('Processed ' + IntToStr(loadsCombined) + ' loads.');
if (loadsAtSpeed = 10) then // Custom antiban by varying mouse speed
begin
MouseSpeed := 17 + Random(6);
loadsAtSpeed := 0;
end;
end else
exit;
Until(AllPlayersInactive);
end;
begin
Smart_Server := 60;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
MouseSpeed := 20; // Initialize variables
loadsCombined := 0;
loadsAtSpeed := 0;
buttonColor := 0;
secondaryColor := 0;
suppliesRemain := True;
SetAngle(SRL_ANGLE_HIGH); // Set correct camera angle
OpenBankChest(SRL_BANK_SW); // Opens the bank
DepositItems; // Allows items to be present in starting inventory
MainLoop;
end.