Simba Code:
program CookGuildMatters;
{$i SRL/SRL/Misc/Smart.simba}
{$i SRL/srl.simba}
{========================= Cook Guild Matters ==============================}
// Hehe, here we go. This script was created because I couldn't,
// and still have trouble working with the msi scripts.
// The MSI cooker doesn't support cooking guild either, so I was out of luck.
// Now I'm just trying something out and hoping for the best.
// So here we go!
// I can't say how much I'll be updating, but it's working decently well.
// For my needs, it fits.
//*************Gotta Start with an Urn in the Inventory for now...************
{-----------------------------Setup!-----------------------}
//1. Fill out the Form Below
//2. It's lengthy because I am a fan of choice.
//3. Position Yourself Pretty Much Anywhere In the Cooking Room of the Guild
//4. I think you should be good?
//5. AntiRandom is included in the Antiban
//6. Oh yeah! Set Your Graphics Settings!
{+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Known Issues:
-Fashionable people rarely will don the colors of the range and cause a derp
-Crowds Stacked on the Range can be dangerous as well}
Procedure DeclarePlayers;
begin
HowManyPlayers :=1;
NumberofPlayers(1);
CurrentPlayer :=0;
Players[0].Name := ''; //Insert Username in ''
Players[0].Pass := ''; // insert password in ''
Players[0].Nick := ''; // Nickname = 3-4 lowercase letters of character name
Players[0].Active:= True; //I think you want to use this.
Players[0].Pin := ''; // Leave Blank if none
end;
Const
//******************* Fill in Stuff Under Here*******************************
SRLStats_Username = ''; //Would Much Appreciate
SRLStats_Password = ''; //To See Exp Gains
Tab = 2; //What Bank Tab is Your Stuff in? Keep it all in one. Looking for a #
RawCol = 4; //Replace With the Raw Food's Column ****** Note counts from 0 up so
RawRow = 0; //Replace With Raw Food Row ****** ex: row 1 would be 0
UseUrns = True ; //Want to Use Urns? True/False
UrnCol = 6; //Same Deal Here As With Raw Food
UrnRow = 0; //Keep Going
UrnType = 'Decorated'; //Valid Inputs are (cracked, fragile, cooking, strong, decorated)
RawColor= 8355717; //Insert a good raw food color
CookedColor = 3162454; //Insert A *Good* Cooked Food Color
FoodExp = 210;// How much exp does cooking 1 of your food give?
FoodName = 'Shark';//Just for stat purposes (Lobster, Tuna, Swordfish, etc.) Fish only for the moment!
//****************************STOP********************************************
//*****************************************************************************
var
x, y, Rounds, ExpGained, Cooked, UrnsTeled, UrnTypeExp: integer;
CUrn: boolean;
str, coo, Urn: TStringArray;
Procedure AntiBanning;
var
r: integer;
begin
FindNormalRandoms;
r:= Random(120);
if (r <= 6) then
Debugln('Antiban Time!');
case r of
1, 2, 3: HoverSkill('cooking', false);
4: ExamineInv;
5: PickUpMouse;
6: Wait(2000 + Random(2000));
end;
if (r < 6) then
Debugln('Antiban Done!');
end;
Procedure CheckUrn;
begin
if FindColorTolerance(x, y, 5006162, 576, 203, 584, 239, 4) then
begin
Mouse(x, y, 5, 5, true); //Clicks the urn found
Wait(2000+random(150));
FindColorTolerance(x, y, 1907518, 204, 386, 320, 460, 4); //Finds Full Urn
Mouse(x, y, 5, 5, true);
Writeln('Urn Sent! Yay XP');
CUrn:= False;
Inc(UrnsTeled)
Wait(1000+random(100));
end else
Curn:= True; //This is why an urn is needed on startup >.<
end;
Procedure GuildBank;
begin
OpenBankNPC;
Wait(100+random(50));
if BankScreen then
begin
Deposit(2, 28, true);
if UseUrns then
begin
if CUrn = True then
begin
Withdraw(RawCol, RawRow, 27);
CloseBank;
Writeln('Withdrew Uncooked Food');
end else
begin
WithdrawEx(UrnCol, UrnRow, 1, Urn);
CUrn:= True;
Wait (50+random(50));
WithDrawEx(RawCol, RawRow, 27, ['aw', 'ster']);
CloseBank;
Writeln('Withdrew Urn and Uncooked Food');
end;
end else
begin
Withdraw(RawCol, RawRow, 28);
CloseBank;
Writeln('Withdrew Uncooked Food');
end;
end;
end;
Procedure RangeCook;
var
rangeFound: boolean;
rangeFail, t, s: integer;
begin
s:= Random(2);
if FindColorTolerance(x, y, RawColor, 607, 213, 645, 241, 7) then
InvMouse(3 + s, 1)
else
begin
GuildBank;
InvMouse(3 + s, 1);
end;
wait(500+random(100));
repeat
if FindObjTPAMulti(x, y, [2175214, 1318291, 1581998], 10, -1, 5, 5, 12, ['aw', 'ang']) then
begin
Writeln('Range Found!');
rangeFound:= true;
MMouse(x, y, 3, 3);
ClickMouse2(false);
WaitOptionMulti(['ange', 'aw Shark'], 2000);
MarkTime(t);
repeat
Wait(200+random(100));
if FindColorTolerance(x, y, RawColor, 224, 401, 294, 455, 4) then
Mouse(x, y, 5, 5, true);
if TimeFromMark(t) > 5000 then
begin
Writeln('Some Reason It did not start cooking?');
TerminateScript;
end;
until FindColorTolerance(x, y, RawColor, 224, 401, 294, 455, 4)
rangeFail:= 0;
end else
begin
Writeln('Range Not Found! Trying Again');
AntiBanning;
Inc(rangeFail);
Writeln('Range Fail Count + : ' + ToStr(RangeFail) + ' total');
if rangeFail > 3 then //3 Strikes
begin
Writeln('Range Fail > 3 Calls For Termination');
TerminateScript;
end;
end;
until(rangeFound);
end;
Procedure CookProcess;
var
lastCooked: boolean;
cookCycle: integer;
begin
repeat //Searches last inv spot for cooked item color
LevelUp;
if FindColorTolerance(x, y, CookedColor, 700, 439, 716, 459, 4) then
begin
Writeln('Finishing Cooking!');
cookCycle:= 0;
lastCooked:= true;
end else
begin
AntiBanning;
Wait(3000 + Random(250));
Inc(cookCycle);
Debugln('Cycle' + ToStr(cookcycle));
if cookCycle >= 30 then
begin
Writeln('Not good! We are not cooking for some reason.');
FindNormalRandoms;
Exit;
end;
end;
until(lastCooked);
inc(Rounds);
Writeln('Round: ' + ToStr(Rounds) + ' Completed!' );
end;
Procedure Report;
Var
timeRun, h, m, s, u: integer;
begin
Case UrnType of
'cracked': u:= 400;
'fragile': u:= 550;
'cooking': u:= 950;
'strong': u:= 1050;
'decorated': u:= 1547;
else
u:= 0;
end;
UrnTypeExp:= u; //Add Form for Other Types later
Cooked:= Rounds * 27;
ExpGained:= (Cooked * FoodExp) + (UrnsTeled * UrnTypeExp);
timeRun:= GetTimeRunning;
ConvertTime(timeRun, h, m, s);
Writeln('~~~~~~~~~~~~~~~~Cook Guild Matters~~~~~~~~~~~~');
Writeln('Time Run: ' + ToStr(h) + 'h, ' + ToStr(m) + 'm, ' + ToStr(s) + 's');
Writeln('Exp Gained: ' + IntToStr(ExpGained));
Writeln('Exp/Hour: ' + IntToStr((ExpGained * 3600) / (timeRun / 1000)));
Writeln('# Food Cooked: ' + IntToStr(Cooked));
Writeln('# Cooked/Hour: ' + IntToStr((Cooked * 3600) / (timeRun / 1000)));
if UseUrns then
Writeln('Urns Teled:' + IntToStr(UrnsTeled));
Stats_Commit;
stats_IncVariable('Cooking EXP (Gained)', (FoodExp * 27));
stats_IncVariable((FoodName + ' Cooked'), 27);
end;
Procedure Setup;
begin
Smart_Server := 1;
Smart_Members :=True;
Smart_Signed :=True;
Smart_SuperDetail :=False;
ClearDebug;
SetupSRL;
SetupSRLStats(438, SRLStats_Username, SRLStats_Password);
ActivateClient;
DeclarePlayers;
LoginPlayer;
MakeCompass('w');
SetAngle(0);
OpenBankNPC;
Wait(300+random(50));
BankTab(Tab);
if not ExistsItem(1) then
CUrn := False;
end;
begin
Setup;
repeat
if UseUrns then
CheckUrn;
GuildBank;
RangeCook;
CookProcess;
Report;
until(AllPlayersInactive);
end.