SCAR Code:
//----------------
// Welcome to AutoKebabber v0.03, by The Claw!
//
// Support: [url]http://www.villavu.com/forum/showthread.php?t=9678[/url]
// [url]http://www.rs-resources.com/mxvfh/viewtopic.php?f=17&t=5483[/url]
//
// If you use this script, please take the time to post a proggy or some comments
// on either of the two topics above. Thanks :)
//----------------
program KebabBuyer;
{.include SRL\SRL.scar}
var
x, y, cx, cy, zx, zy, bx, by, bkx, bky: Integer; //variables for the mouse to move to.
KebabCount: Integer; //how many kebabs bought
BankCount: Integer; //how many times banked, shown in proggy
LoadsNumb: Integer; //how many times banked, used for switching players
KebabSign: Integer; //kebabsign bmp
InStore: Boolean; //if in store or not
InBank: Boolean; //if in bank or not
S: Integer; //number of times to search for Karim before giving up
const
Loads = 5; //set this for the number of loads to buy.
Karim = 7159399; //colour of Karim's purple shirt
Talk = 65278; //colour of the Talk-to when you right click Karim
KebabColour = 1410574; //colour of green part of a kebab in inventory
BankColour = 5034473; //colour of the bank symbol, the yellow bit
SandColour = 5876155; //colour of the sand on the minimap
BankFloor = 4550516; //colour of the bank floor on minimap
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '----';
Players[0].Pass := '----';
Players[0].Nick := 'iti';
Players[0].Active := True;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
procedure LoadBmps;
begin
KebabSign := BitmapFromString(5, 3, '00000000FF0011FF0161FF' +
'2E00FF00000000000000000000F52825000000000000119201F52' +
'825F52825000000');
end;
procedure FreeBmps;
begin
FreeBitmap(KebabSign);
end;
/// Finding Randoms \\\
function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;
procedure FindRandoms;
begin
FindFastRandoms;
end;
procedure Login;
begin
if(not(LoggedIn)) then
LoginPlayer;
end;
//// Walking from Bank to the store \\\\
procedure StoreWalk;
begin
if(not(LoggedIn)) then exit;
InBank := True;
Instore := false;
RadialWalk(Sandcolour, 39, 13, 50, 5, 5);
Flag;
LoadBmps;
if(FindDeformed(x, y, KebabSign, 553, 6, 720, 160)) then
begin
Wait(100+random(10));
Mouse(x, y, 1, 1, true);
Writeln('Walking to Kebab Store');
Flag;
FreeBmps;
InStore := True;
InBank := False;
Writeln('We are in the store!');
end else
begin
Writeln('Store Bitmap not found...');
NextPlayer(False);
Exit;
end;
end;
//// Buying the Kebabs from Karim \\\\
procedure KarimTrade;
begin
if(not(LoggedIn)) then exit;
S:=0
if(InStore = true) then
begin
repeat
if(not(LoggedIn)) then exit;
FindRandoms; //Finding randoms
Wait(300 + random(100))
Writeln('In Store...attempting to right-click Karim');
S:=S+1;
if(FindObj(cx, cy, 'arim', Karim, 10)) then
begin
Mouse(cx, cy, 1, 1, false);
Wait(750 + random(250));
end;
if(S=50) then //change S to change number of times you look for karim
begin
Writeln('Took too long to find Karim...');
NextPlayer(False);
Exit;
end;
until(FindColorTolerance(zx, zy, Talk, 0, 0, 512, 337, 3)) or (S=50) //change S here as well
S:=0; //dont touch this S.
end;
begin
Wait(500+random(50));
ClickOption('alk',1)
Writeln('Talking to Karim');
Flag;
end;
end;
// Clicks on the text down the bottom of the screen to buy the kebabs. \\
procedure BuyKebabs;
begin
if(not(LoggedIn)) then exit;
KebabCount:=KebabCount;
ClickToContinue;
Wait(1200 + random(100));
ClickNPCChatText('Yes please.',true);
Wait(1200 + random(100));
ClickToContinue;
end;
// Deposits the kebabs into the bank. \\
procedure Depositing;
begin
if(not(LoggedIn)) then exit;
Writeln('bank opened, depositing..');
Deposit(2, 28, 2);
CloseBank;
Writeln('deposited, closing bank');
BankCount:=BankCount+1;
LoadsNumb:=LoadsNumb+1;
Writeln('Successfully banked! Starting loop all over again. ');
end;
/// Banking \\\
procedure Banking;
begin
if(not(LoggedIn)) then exit;
BankCount:=BankCount;
KebabCount:=KebabCount;
LoadsNumb:=LoadsNumb;
if(InStore = true) then
begin
FindRandoms; //Finding randoms
RadialWalk(SandColour, 178, 194, 70, 10, 10);
Writeln('Getting closer to the bank...');
Flag;
InStore := False;
end;
Writeln('finding bank symbol by symbol..');
if(FindSymbol(bx, by, 'Bank')) then
begin
Mouse(bx, by, 1, 1, true);
Flag;
InBank := True;
Writeln('in the bank');
FindRandoms; //Finding randoms
MakeCompass('E');
LowestAngle;
Writeln('opening bank');
OpenBankGlass('akb', false, false);
end else
if(FindColorTolerance(bkx, bky, BankColour, MSX1, MSY1, MSX2, MSY2, 5)) then
begin
Writeln('bank symbol not found. trying to find it by color instead');
Mouse(bkx, bky, 2, 2, true);
Flag;
InBank := True;
Writeln('in the bank');
FindRandoms; //Finding randoms
MakeCompass('E');
LowestAngle;
Writeln('opening bank');
OpenBankGlass('akb', false, false);
end;
begin
If(InBank = False) then
begin
Writeln('InBankbank symbol not found.');
NextPlayer(False);
Exit;
end;
end;
if(not(BankScreen)) then
begin
Writeln('opening bank quiet, seeing as the other bank isnt there');
OpenBankQuiet('akb');
end;
if(BankScreen) then
begin
Depositing;
end else
begin
Writeln('unable to open up the bank. logging out');
NextPlayer(False);
Exit;
end;
end;
/// Progress Report \\\
procedure ProgressReport;
begin
ClearDebug;
Writeln(' ');
Writeln(' ');
Writeln(' ');
WriteLn('<============== AutoKebbabber v0.03 =================>');
Writeln('Worked for '+ TimeRunning);
WriteLn('Banked '+IntToStr(BankCount)+' loads[s].');
WriteLn('Bought '+IntToStr(KebabCount)+' kebab[s].');
WriteLn('<============== AutoKebbabber v0.03 =================>');
end;
procedure SetupScript;
begin
SetupSRL;
ActivateClient;
DeclarePlayers;
end;
//// Main Loop \\\\
begin;
SetupScript;
Writeln('Somebody set us up the AutoKebabber. All your Kebab are belong to us.');
Writeln('Setup to buy a total of ' + IntToStr(Loads) + ' load[s] of kebabs.');
Wait(1000 + random(300))
repeat
Login;
HighestAngle;
FindRandoms; //Finding randoms
StoreWalk;
Wait(3000 + random(121)) //waits in store for a bit, seems to reduce errors in finding karim.
repeat
KarimTrade;
Wait(1500 + random(500));
BuyKebabs;
until(InvFull);
if(InvFull) then
begin
Status('Inventory full, banking.');
KebabCount:=KebabCount + CountItemsColor('inv', KebabColour, 10);
Banking;
end;
ProgressReport;
until(LoadsNumb = Loads) or (InChat('have enough coins.'));
if(LoadsNumb = Loads) then
begin
NextPlayer(True);
LoadsNumb:=0;
Highestangle;
end;
end.