vilon
2007-10-31 07:48:48
<!– BEGIN TEMPLATE: formanswers –>
vilon - SRL Member Application Form
vilon
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
(HTML,) PHP, AutoIt, C#.
Other Communitys
None related to "runescape cheating".
How Long have You Played Runescape
About 5 years.
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Hello,
Some of you might have seen me around here for a time now, some not. I would like to start by saying that I'm the kind of person that sees everything in a logical way, maybe this is why I enjoy mathematics so much. The thoughts about programming/scripting has always been there in my head, ever since back when I was 14 or maybe a bit younger, and I first learned HTML and was amazed about it.
But HTML was never a "programming" experience. I moved on to PHP and studied that for about a year. About the same time I also became interested in Autoit (some of you might have heard about it), since it was very user friendly and easy to use. When I later found out how boring it was, I decided I should move to something else. C# was next in turn and I'm still taking classes in it at the moment. And finally, I'm now into pascal and especially SCAR/runescape scripting.
I'm not the kind of guy who scripts because he wants to earn respect or anything similar. I do it because I enjoy it, want to learn more, enjoy the challenge and simply loves the logical parts.
- vilon
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
——————————————————
<!– END TEMPLATE: formanswers –>
vilon - SRL Member Application Form
vilon
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
(HTML,) PHP, AutoIt, C#.
Other Communitys
None related to "runescape cheating".
How Long have You Played Runescape
About 5 years.
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Hello,
Some of you might have seen me around here for a time now, some not. I would like to start by saying that I'm the kind of person that sees everything in a logical way, maybe this is why I enjoy mathematics so much. The thoughts about programming/scripting has always been there in my head, ever since back when I was 14 or maybe a bit younger, and I first learned HTML and was amazed about it.
But HTML was never a "programming" experience. I moved on to PHP and studied that for about a year. About the same time I also became interested in Autoit (some of you might have heard about it), since it was very user friendly and easy to use. When I later found out how boring it was, I decided I should move to something else. C# was next in turn and I'm still taking classes in it at the moment. And finally, I'm now into pascal and especially SCAR/runescape scripting.
I'm not the kind of guy who scripts because he wants to earn respect or anything similar. I do it because I enjoy it, want to learn more, enjoy the challenge and simply loves the logical parts.
- vilon
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
{==================================================================]
[ _ _ _ _ ]
[ | | | | (_) | | ]
[ | | _ _ _ __ ___ | |__ _ __ _ __| | __ _ ___ ]
[ | | | | | | '_ ` _ \| '_ \| '__| |/ _` |/ _` |/ _ \ ]
[ | |___| |_| | | | | | | |_) | | | | (_| | (_| | __/ ]
[ |______\__,_|_| |_| |_|_.__/|_| |_|\__,_|\__, |\___| ]
[ Castle Flax Spinner v1.2b __/ | ]
[ by Vilon |___/ ]
[==================================================================]
[ NAME : Lumbridge Castle Flax Spinner (LumbCFS) ]
[ AUTHOR : Vilon ]
[ CATEGORY : Fletching ]
[ DESCRIPTION : Spins flax into bowstrings, at Lumbridge. ]
[ MEMBERS ONLY : Yes ]
[ MULTIPLAYER : Yes ]
[ SCAR VERSION : 3.12c ]
[ SRL VERSION : 4 #rev 6 ]
[ RELEASE DATE : 28/10/2007 ]
[==================================================================]
[ 01. Use the offical runescape client, with low detail and very ]
[ bright. Set your screen resolution to 32bit true color. ]
[ 02. Setup your player(s), starting at line 40. ]
[ 03. Position your runescape characters in the one and only open ]
[ bankslot, in the lumbridge castle (third floor). Also make ]
[ sure your inventory is empty and flax is in the 1st bankslot.]
[ 04. Drag the crosshair over the runescape client and press play. ]
[ 05. Enjoy the script and please post progress/feedback :D ]
[==================================================================}
program LumbCFS;
{.include SRL/SRL.scar}
{-------------------------------------------------------------------------------
procedure DeclarePlayers;
Description: Here is where you declare your player(s).
-------------------------------------------------------------------------------}
procedure DeclarePlayers;
begin
HowManyPlayers:=4; // Type in the number of players you are going to use
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0; // Type in the number of the player you want to start with.
Players[0].Name:='Username'; // Enter your username
Players[0].Pass:='Password'; // Enter your password
Players[0].Nick:='sern'; // Enter your nickname (3-4 letters from your username)
Players[0].Loc:='Bank'; // Enter start-location (don't touch)
Players[0].Pin:=1234; // Enter your bank-pin, if you have one
Players[0].Skill:='crafting'; // Enter skill for genie lamp(s)
Players[0].Integers[0]:=100; // Enter number of loads
Players[0].Active:=True; // Enter True if you want to use this player, else False.
Players[1].Name:='Username';
Players[1].Pass:='Password';
Players[1].Nick:='sern';
Players[1].Loc:='Bank';
Players[1].Pin:=1234;
Players[1].Skill:='crafting';
Players[1].Integers[0]:=100;
Players[1].Active:=True;
Players[2].Name:='Username';
Players[2].Pass:='Password';
Players[2].Nick:='sern';
Players[2].Loc:='Bank';
Players[2].Pin:=1234;
Players[2].Skill:='crafting';
Players[2].Integers[0]:=100;
Players[2].Active:=True;
Players[3].Name:='Username';
Players[3].Pass:='Password';
Players[3].Nick:='sern';
Players[3].Loc:='Bank';
Players[3].Pin:=1234;
Players[3].Skill:='crafting';
Players[3].Integers[0]:=100;
Players[3].Active:=True;
Writeln('[Notice] Using: '+IntToStr(HowManyPlayers)+' player(s).');
CheckUserNicks;
end;
{///////////////////////////////////////////////////////////////////////////////
/| THERE IS NO NEED TO CHANGE ANYTHING BELOW THIS LINE! |\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}
{-------------------------------------------------------------------------------
const Setup
Description: Declare constants.
-------------------------------------------------------------------------------}
const
ScriptName = 'Lumbridge Castle Flax Spinner (LumbCFS)';
ScriptVersion = '1.2b';
{-------------------------------------------------------------------------------
var Setup
Description: Declare global variables.
-------------------------------------------------------------------------------}
var
Times, TotalTimes, Bowstrings, TotalBowstrings, Repeats, x, y : Integer;
FlaxDTM, BowstringDTM, DoorBMP, SpinBMP, GuideBMP, BankBMP : Integer; // DTM's and BMP's
{-------------------------------------------------------------------------------
procedure PlayerLogin;
Description: Login the "CurrentPlayer".
-------------------------------------------------------------------------------}
procedure PlayerLogin;
begin
LoginPlayer;
end;
{-------------------------------------------------------------------------------
procedure PlayerLogout;
Description: Logout the "CurrentPlayer".
-------------------------------------------------------------------------------}
procedure PlayerLogout;
begin
Players[CurrentPlayer].Active := False;
LogOut;
Exit;
end;
{-------------------------------------------------------------------------------
procedure PlayerCheck;
Description: Check if the "CurrentPlayer" is loggedin.
-------------------------------------------------------------------------------}
procedure PlayerCheck;
begin
if(not(LoggedIn))then Exit;
end;
{-------------------------------------------------------------------------------
procedure PlayerCheckLoc;
Description: Check if the "CurrentPlayer" has the correct location set.
-------------------------------------------------------------------------------}
procedure PlayerCheckLoc;
begin
if(Players[CurrentPlayer].Loc = 'Error')then
begin
Writeln('[Error] Location unknown, switching character...');
PlayerLogout;
end;
end;
{-------------------------------------------------------------------------------
procedure AlignCompass;
Description: Aligns the compass.
-------------------------------------------------------------------------------}
procedure AlignCompass;
begin
PlayerCheck;
HighestAngle;
MakeCompass('N');
end;
{-------------------------------------------------------------------------------
procedure AntiBan;
Description: Antiban procedure.
-------------------------------------------------------------------------------}
procedure AntiBan;
begin
PlayerCheck;
case random(35) + 1 of
0: HoverSkill('crafting', false);
1: HoverSkill('random', false);
2: BoredHuman;
3: HoverSkill('crafting', false);
4: BoredHuman;
5: BoredHuman;
6: HoverSkill('crafting', false);
end;
end;
{-------------------------------------------------------------------------------
procedure AntiRandom;
Description: The procedure we use for finding random events.
-------------------------------------------------------------------------------}
procedure AntiRandom;
begin
PlayerCheck;
FindNormalRandoms;
end;
{-------------------------------------------------------------------------------
procedure SetupDTMs;
Description: Loads DTMs.
-------------------------------------------------------------------------------}
procedure SetupDTMs;
begin
FlaxDTM := DTMFromString('78DA638C676460686440038C4824900E06B2E' +
'A08A80903B23A08A84902B23A09A8C902B29A09A84901B22A09A8' +
'8926AC060068650635');
BowstringDTM := DTMFromString('78DA63B467666090606440058C482490F607A' +
'A9123A0C605A84699801A33A01A45026AAC806A8409A83105AA11' +
'C5AF0600243E0244');
end;
{-------------------------------------------------------------------------------
procedure FreeDTMs;
Description: Frees DTMs.
-------------------------------------------------------------------------------}
procedure FreeDTMs;
begin
FreeDTM(FlaxDTM);
FreeDTM(BowstringDTM);
end;
{-------------------------------------------------------------------------------
procedure SetupBMPs;
Description: Loads BMPs.
-------------------------------------------------------------------------------}
procedure SetupBMPs;
begin
DoorBMP := BitmapFromString(1, 4, 'beNpjYPjOwPCfAUR+BwAVfgPl');
SpinBMP := BitmapFromString(1, 1, 'beNoLUM0CAAGnAOA=');
GuideBMP := BitmapFromString(1, 1, 'beNqLaVQCAAI7AQA=');
BankBMP := BitmapFromString(1, 1, 'beNo77XELAAPOAe4=');
end;
{-------------------------------------------------------------------------------
procedure FreeBMPs;
Description: Frees BMPs.
-------------------------------------------------------------------------------}
procedure FreeBMPs;
begin
FreeBitmap(DoorBMP);
FreeBitmap(SpinBMP);
FreeBitmap(GuideBMP);
FreeBitmap(BankBMP);
end;
{-------------------------------------------------------------------------------
procedure SetupProgress;
Description: Setup and display the progress report.
-------------------------------------------------------------------------------}
procedure SetupProgress;
begin
PlayerCheck;
// Increase times done
Inc(Times);
Inc(TotalTimes);
// Disguise title
Disguise(''+IntToStr(Times)+'/'+IntToStr(Players[CurrentPlayer].Integers[0])+' [ '+IntToStr(Bowstrings)+' | '+IntToStr(TotalBowstrings)+' ]');
// Progress report
Writeln('[=================================================]');
Writeln('[ '+ScriptName+' v'+ScriptVersion+'');
Writeln('[=================================================]');
Writeln('[Name: ['+IntToStr(CurrentPlayer)+'] '+Players[CurrentPlayer].Name+'');
Writeln('[Worked (total): '+TimeRunning+'.');
Writeln('[Loads done: '+IntToStr(times)+'/'+IntToStr(Players[CurrentPlayer].Integers[0])+' ('+IntToStr(TotalTimes)+')');
Writeln('[Bowstrings made: '+IntToStr(Bowstrings)+' ('+IntToStr(TotalBowstrings)+')');
Writeln('[=================================================]');
// SRL randomevent report
SRLRandomsReport;
end;
{-------------------------------------------------------------------------------
procedure SetupScript;
Description: Does the nessecary things to set up the script properly.
-------------------------------------------------------------------------------}
procedure SetupScript;
begin
// "Reset" values
Times := 0;
Repeats := 0;
Bowstrings := 0;
TotalBowstrings := 0;
TotalTimes := 0;
// Rest of setup
ClearReport;
ClearDebug;
SetupSRL;
DeclarePlayers;
LampSkill := (Players[CurrentPlayer].Skill); // Set lampskill
FindRS;
ActivateClient;
end;
{-------------------------------------------------------------------------------
procedure DepositBowstrings;
Description: Deposists bowstrings (called from BankFB).
-------------------------------------------------------------------------------}
procedure DepositBowstrings;
var
DepositMark, InvAmount : Integer;
begin
PlayerCheck;
if(not(Repeats = 0))then
begin
// Look for bowstrings in inventory
if(FindDTM(BowStringDTM, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
// Count how many items there are in the inventory.
InvAmount := InvCount;
// Deposit the bowstrings, if they were found.
MarkTime(DepositMark);
repeat
Mouse(x, y, 10, 10, false);
ChooseOption('Store All');
Wait(500+random(250));
until((not(InvCount = InvAmount)) or (TimeFromMark(DepositMark) > 3000));
// Let's count how many bowstrings we made during this run.
Bowstrings := Bowstrings + (InvAmount - InvCount);
TotalBowstrings := TotalBowstrings + (InvAmount - InvCount); // Count total number of bowstrings.
end;
end;
// Lets deposit everything now, since we counted the bowstrings.
DepositAll;
// Wait until the inventory is empty.
MarkTime(DepositMark);
repeat
Wait(100+random(100));
until((InvCount = 0) or (TimeFromMark(DepositMark) > 2000));
end;
{-------------------------------------------------------------------------------
procedure BankFB;
Description: Withdraws flax (and deposits bowstrings).
-------------------------------------------------------------------------------}
procedure BankFB;
var
BankTries, BankTries2, BankActive, BankMark, BankColor : Integer;
begin
BankTries2 := 0;
BankColor := 8032931;
PlayerCheck;
PlayerCheckLoc;
repeat
BankTries := 0;
BankActive := 0;
Inc(BankTries2);
if(Players[CurrentPlayer].Loc = 'Bank')then
begin
repeat
if((not(BankScreen)) and (not(PinScreen)))then
begin
Inc(BankTries);
AntiRandom;
if(FindObjCustom(x, y, ['ank', 'oot'], [BankColor], 15))then // Open bank
begin
Mouse(x, y, 5, 5, false);
if(not(ChooseOption('Use-quickly')))then Continue;
end else
begin
OpenBankFast('lb');
end;
MarkTime(BankMark);
repeat
Wait(100+random(50));
until((PinScreen) or (BankScreen) or (TimeFromMark(BankMark) > 3000));
if(PinScreen or BankScreen)then
begin
BankActive := 1;
Break;
end;
end else
begin
BankActive := 1;
Break;
end;
until((BankTries = 3) or (BankActive = 1));
if(PinScreen)then InPin(IntToStr(Players[CurrentPlayer].Pin)); // Enter PIN
MarkTime(BankMark);
repeat
Wait(100+random(50));
until((BankScreen) or (TimeFromMark(BankMark) > 1500));
if(BankScreen)then
begin
FixBank;
SetupDTMs;
DepositBowstrings; // Deposit inventory items
if(FindDTM(FlaxDTM, x, y, MSX1, MSY1, MSX2, MSY2))then // If we can't find flax, exit.
begin
if(not(Repeats >= Players[CurrentPlayer].Integers[0]))then Withdraw(1, 1, 0);
end else
begin
Writeln('[Notice] You have run out of flax, switching character...');
FreeDTMs;
MarkTime(BankMark);
repeat
CloseBank;
until((not(BankScreen)) or (TimeFromMark(BankMark) > 2000));
PlayerLogout;
Break;
end;
FreeDTMs;
Wait(500+random(250));
MarkTime(BankMark);
repeat
CloseBank;
until((not(BankScreen)) or (TimeFromMark(BankMark) > 2000));
AntiRandom;
end else if(FindSymbol(x, y, 'guide'))then // Failsafe, if we cant find bank, try walking closer.
begin
if(MFNF(x, y, 1, -random(3)))then
begin
MarkTime(BankMark);
repeat
Wait(100+random(250));
until((FlagDistance = 0) or (TimeFromMark(BankMark) > 5000));
Continue;
end else
begin
Writeln('[Error] Failure when trying to walk closer to bank, switching character...');
PlayerLogout;
Break;
end;
end else
begin
Writeln('[Error] Could not open bank, switching character...');
PlayerLogout;
Break;
end;
end;
until((BankActive = 1) or (BankTries2 = 2));
end;
{-------------------------------------------------------------------------------
function ClimbLadder(Direction : String) : Boolean
Description: Climbs ladder in given direction.
-------------------------------------------------------------------------------}
function ClimbLadder(Direction : String) : Boolean;
var
LadderDown, LadderUp, LadderMark, LadderTries : Integer;
begin
LadderDown := 602440;
LadderUp := 540510;
LadderTries := 0;
PlayerCheck;
PlayerCheckLoc;
case LowerCase(Direction) of
'down': begin
MarkTime(LadderMark);
repeat
Inc(LadderTries);
if(LadderTries = 5)then
begin
Writeln('[Error] Could not climb ladder (down), switching character...');
PlayerLogout;
Break;
end;
if(FindObjEx(x, y, 'own', 125, 140, 300, 250, LadderDown, 15, 1, 1, 0, false))then
begin
Mouse(x, y, 5, 5, false);
if(ChooseOption('Climb-down'))then
begin
Result := True;
Break;
end;
end else Result := False;
until((LadderTries = 5) or (TimeFromMark(LadderMark) > 10000))
end;
'up': begin
MarkTime(LadderMark);
repeat
Inc(LadderTries);
if(FindObjCustom(x, y, ['lim', 'imb'], [LadderUp], 15))then
begin
Mouse(x+5, y+10, 10, 5, false);
if(ChooseOption('Climb-up'))then
begin
Result := True;
Break;
end else Result := False;
end else Result := False;
until((LadderTries = 3) or (TimeFromMark(LadderMark) > 10000))
end;
end;
end;
{-------------------------------------------------------------------------------
procedure CheckDoor
Description: Checks for door and opens if it's closed.
-------------------------------------------------------------------------------}
procedure CheckDoor;
var
DoorMark, DoorColor, DoorTries : Integer;
begin
DoorColor := 2772852;
DoorTries := 0;
PlayerCheck;
PlayerCheckLoc;
MarkTime(DoorMark);
repeat
Inc(DoorTries);
if(DoorTries = 5)then
begin
Writeln('[Error] Could not find the door, switching character...');
PlayerLogout;
Break;
end;
if(FindObjCustom(x, y, ['oor'], [DoorColor], 20))then
begin
if(IsUpText('pen'))then
begin
Mouse(x, y, 5, 5, false);
if(ChooseOption('Open'))then
begin
FFlag(0);
Break;
end;
end else if(IsUpText('los'))then
begin
Break;
end;
end;
until((DoorTries = 5) or (TimeFromMark(DoorMark) > 3000));
end;
{-------------------------------------------------------------------------------
procedure WalkSpinner;
Description: Walks to spinner.
-------------------------------------------------------------------------------}
procedure WalkSpinner;
var
WalkMark, WalkMark2, WalkTries, WalkTries2, DoorColor, SpinColor, GuideColor : Integer;
begin
WalkTries := 0;
PlayerCheck;
PlayerCheckLoc;
SetupDTMs;
// If we don't have flax in inventory, we should try to open bank again.
if(not(FindDTM(FlaxDTM, x, y, MIX1, MIY1, MIX2, MIY2)))then BankFB;
FreeDTMs;
// The first time we want to set run to "on".
if(Repeats = 0)then
begin
SetRun(true);
GameTab(4);
end;
// Walk to ladder and climb down
PlayerCheckLoc;
if(Players[CurrentPlayer].Loc = 'Bank')then
begin
if(RadialWalk(FindLadderColor, 230, 150, 70, -random(3), random(3)))then
begin
MarkTime(WalkMark);
repeat
Wait(100+random(250));
until((FlagDistance < 2) or (TimeFromMark(WalkMark) > 10000));
Wait(500+random(250));
Players[CurrentPlayer].Loc := 'LadderUpStairs';
if(ClimbLadder('down')) then Players[CurrentPlayer].Loc := 'LadderDownStairs' else Players[CurrentPlayer].Loc := 'Error';
end else Players[CurrentPlayer].Loc := 'Error';
end;
// Walk to door
PlayerCheckLoc;
if(Players[CurrentPlayer].Loc = 'LadderDownStairs')then
begin
MarkTime(WalkMark);
repeat
Wait(100+random(250));
until((FindSymbol(x, y, 'spin')) or (TimeFromMark(WalkMark) > 3000));
// Lets get to the spinner...
MarkTime(WalkMark);
repeat
Inc(WalkTries);
// Try to open/walk to the door directly (by right-clicking).
if(not(Players[CurrentPlayer].Loc = 'Door'))then
begin
WalkTries2 := 0;
repeat
Inc(WalkTries2);
if(FindObjEx(x, y, 'oor', 250, 1, 500, 50, 2772852, 20, 20, 0, 0, false))then
begin
if(IsUpText('pen'))then
begin
Mouse(x, y, 5, 5, false);
if(ChooseOption('Open'))then
begin
MarkTime(WalkMark2);
repeat
Wait(100+random(250));
until((FlagDistance < 2) or (TimeFromMark(WalkMark2) > 5000));
Players[CurrentPlayer].Loc := 'Door';
Break;
end;
end else if(IsUpText('los'))then
begin
if(WalkTries2 = 3)then Break;
Mouse(x, y, 5, 5, false);
if(ChooseOption('Walk here'))then
begin
MarkTime(WalkMark2);
repeat
Wait(100+random(250));
until((FlagDistance = 0) or (TimeFromMark(WalkMark2) > 3000));
Players[CurrentPlayer].Loc := 'Door';
Break;
end;
end;
end else
begin
if(WalkTries2 = 2)then Break;
Mouse(250, 130, 15, 5, false);
ChooseOption('Walk here');
MarkTime(WalkMark2);
repeat
Wait(500+random(250));
until((FlagDistance < 2) or (TimeFromMark(WalkMark2) > 3000));
end;
until((Players[CurrentPlayer].Loc = 'Door') or (WalkTries2 = 2) or (TimeFromMark(WalkMark) > 15000));
// Now, if we still failed walking to door, walk back to the ladder, so we can use the rest of the failsafes.
if(not(Players[CurrentPlayer].Loc = 'Door'))then
begin
RadialWalk(FindLadderColor, 265, 150, 50, 1, 1);
Wait(750+random(250));
end;
end;
// Try to radialwalk to the door
if(not(Players[CurrentPlayer].Loc = 'Door'))then
begin
SetupBMPs;
DoorColor := AutoColorThis(DoorBMP, 50, MMX1, MMY1, MMX2, MMY2);
FreeBMPs;
if(not(DoorColor = 0))then
begin
if(RadialWalk(DoorColor, 300, 425, 35, 1, 1))then
begin
CheckDoor;
Players[CurrentPlayer].Loc := 'Door';
Break;
end;
end;
end;
// Try to find the spinsymbol
if(not(Players[CurrentPlayer].Loc = 'Door'))then
begin
if(FindSymbol(x, y, 'spin'))then
begin
if(MFNF(x, y, 1, 1))then
begin
MarkTime(WalkMark2);
repeat
Wait(100+random(250));
until((FlagDistance < 2) or (TimeFromMark(WalkMark2) > 5000));
CheckDoor;
Players[CurrentPlayer].Loc := 'Door';
Break;
end;
end;
end;
// Try to radialwalk to the spinsymbol
if(not(Players[CurrentPlayer].Loc = 'Door'))then
begin
SetupBMPs;
SpinColor := AutoColorThis(SpinBMP, 50, MMX1, MMY1, MMX2, MMY2);
FreeBMPs;
if(not(SpinColor = 0))then
begin
if(RadialWalk(SpinColor, -50, 100, 45, 1, 1))then
begin
CheckDoor;
Players[CurrentPlayer].Loc := 'Door';
Break;
end;
end;
end;
// Try finding the guide symbol
if(not(Players[CurrentPlayer].Loc = 'Door'))then
begin
if(FindSymbol(x, y, 'guide'))then
begin
if(MFNF(x, y, 1, 1))then
begin
MarkTime(WalkMark2);
repeat
Wait(100+random(250));
until((FlagDistance < 2) or (TimeFromMark(WalkMark2) > 5000));
CheckDoor;
Players[CurrentPlayer].Loc := 'Door';
Break;
end;
end;
end;
// Try to radialwalk to the guidesymbol
if(not(Players[CurrentPlayer].Loc = 'Door'))then
begin
SetupBMPs;
GuideColor := AutoColorThis(GuideBMP, 50, MMX1, MMY1, MMX2, MMY2);
FreeBMPs;
if(not(GuideColor = 0))then
begin
if(RadialWalk(GuideColor, -50, 100, 45, 1, 1))then
begin
CheckDoor;
Players[CurrentPlayer].Loc := 'Door';
Break;
end;
end;
end;
until((WalkTries = 3) or (Players[CurrentPlayer].Loc = 'Door') or (TimeFromMark(WalkMark) > 10000));
end;
// If we're not at the door now, something went wrong.
if(not(Players[CurrentPlayer].Loc = 'Door'))then
begin
Writeln('[Error] Could not walk to door/spinner, switching character...');
PlayerLogout;
end;
end;
{-------------------------------------------------------------------------------
procedure AntiFight;
Description: Handles fighting.
-------------------------------------------------------------------------------}
procedure AntiFight;
var
WalkMark : Integer;
begin
PlayerCheck;
if(FindFightEx)then
begin
CheckDoor;
RunAwayDirection('N');
Wait(10000+random(10000));
GameTab(4);
if(FindSymbol(x, y, 'spin'))then // Try to walk back by finding the spin symbol.
begin
if(MFNF(x, y, 1, 1))then
begin
MarkTime(WalkMark);
repeat
Wait(100+random(250));
until((FlagDistance < 5) or (TimeFromMark(WalkMark) > 5000));
CheckDoor;
end else PlayerLogout;
end else if(FindSymbol(x, y, 'guide'))then // Try the guide symbol
begin
if(MFNF(x, y, 1, 1))then
begin
MarkTime(WalkMark);
repeat
Wait(100+random(250));
until((FlagDistance < 5) or (TimeFromMark(WalkMark) > 5000));
CheckDoor;
end else PlayerLogout;
end else PlayerLogout;
end;
end;
{-------------------------------------------------------------------------------
procedure SpinFlax;
Description: Spins flax into bowstrings.
-------------------------------------------------------------------------------}
procedure SpinFlax;
var
SpinMark, SpinMark2, SpinTries, SpinColor, SpinColor2, SpinLevel : Integer;
begin
SpinColor := 11330;
SpinColor2 := 1339815;
SpinTries := 0;
SpinLevel := 0;
PlayerCheck;
PlayerCheckLoc;
SetupDTMs;
// Walk to spinner
MarkTime(SpinMark);
repeat
Inc(SpinTries);
if(FindObjCustom(x, y, ['pin', 'nni'], [SpinColor, SpinColor2], 20))then
begin
Mouse(x, y, 4, 4, false);
if(ChooseOption('Spin'))then
begin
// Wait until we see the window
MarkTime(SpinMark2);
repeat
if(InChat('ach'))then Break;
Wait(500+random(250));
until((FindColorTolerance(x, y, 65024, 225, 129, 302, 167, 5)) and (FindColorTolerance(x, y, 2070783, 36, 29, 462, 51, 5)) or (TimeFromMark(SpinMark2) > 10000));
// Check if we got locked out
if(InChat('ach'))then
begin
CheckDoor;
Continue;
end;
// Make bowstrings
Mouse(261, 122, 28, 33, false);
if(ChooseOption('Make X'))then
begin
Wait(1000+random(250));
// Send random numbers, containing 1-5 and together form a number greater then 28 (lowest is 111).
case random(1) + 1 of
0: TypeSend(''+IntToStr(Random(5) + 1)+''+IntToStr(Random(5) + 1)+''+IntToStr(Random(5) + 1)+''+IntToStr(Random(5) + 1)+'');
1: TypeSend(''+IntToStr(Random(5) + 1)+''+IntToStr(Random(5) + 1)+''+IntToStr(Random(5) + 1)+'');
end;
// Wait until we find a bowstring
MarkTime(SpinMark2);
repeat
AntiRandom;
if(ClickContinue(true, true))then Break;
if(FindFight)then Break;
until((FindDTM(BowstringDTM, x, y, MIX1, MIY1, MIX2, MIY2)) or (TimeFromMark(SpinMark2) > 3500));
// Check if we breaked out of loop
if(not(FindDTM(BowstringDTM, x, y, MIX1, MIY1, MIX2, MIY2)))then
begin
MarkTime(SpinMark2);
repeat
AntiRandom;
AntiFight;
until(TimeFromMark(SpinMark2) > 7500);
Continue;
end;
// Find bowstring in inventory
if(FindDTM(BowstringDTM, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Players[CurrentPlayer].Loc := 'Spinner';
Break;
end;
end;
end;
end;
until((SpinTries = 5) or (Players[CurrentPlayer].Loc = 'Spinner') or (TimeFromMark(SpinMark) > 60000));
FreeDTMs;
end;
{-------------------------------------------------------------------------------
procedure WaitWhileSpinning;
Description: Performs different actions while spinning.
-------------------------------------------------------------------------------}
procedure WaitWhileSpinning;
var
WaitMark, WaitMark2 : Integer;
begin
PlayerCheck;
PlayerCheckLoc;
SetupDTMs;
MarkTime(WaitMark2);
repeat
if(Players[CurrentPlayer].Loc = 'Spinner')then
begin
// Wait while spinning
MarkTime(WaitMark);
repeat
if(not(FindDTM(BowstringDTM, x, y, MIX1, MIY1, MIX2, MIY2)))then SpinFlax;
if(TimeFromMark(WaitMark) < 5000)then AntiBan;
if(ClickContinue(true, true))then Break;
if(FindFight)then Break;
AntiRandom;
until((FindDTM(BowstringDTM, x, y, 682, 426, 727, 462)) or (TimeFromMark(WaitMark) > 60000));
// When we should be done with spinning, make sure we have no more flax in inventory.
if(FindDTM(FlaxDTM, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
MarkTime(WaitMark);
repeat
AntiRandom;
AntiFight;
until(TimeFromMark(WaitMark) > 7500);
SpinFlax;
end else Break;
end else
begin
Players[CurrentPlayer].Loc := 'Spinner';
Break;
end;
until(FindDTM(BowstringDTM, x, y, 682, 426, 727, 462) or (not(FindDTM(FlaxDTM, x, y, MIX1, MIY1, MIX2, MIY2))) or (TimeFromMark(WaitMark2) > 80000));
FreeDTMs;
PickUpMouse; // "Pick up the mouse"
AlignCompass; // Realign compass and set to highest angle
CheckDoor; // Check the door so we know its open.
end;
{-------------------------------------------------------------------------------
procedure WalkBank;
Description: Walks from spinner back to bank.
-------------------------------------------------------------------------------}
procedure WalkBank;
var
WalkTries, WalkMark, WalkMark2, GuideColor, BankColor : Integer;
begin
WalkTries := 0;
PlayerCheck;
PlayerCheckLoc;
// Go to ladder
MarkTime(WalkMark);
repeat
Inc(WalkTries);
if(Players[CurrentPlayer].Loc = 'Spinner')then
begin
if(RadialWalk(FindLadderColor, 275, 180, 70, -5, 5))then
begin
MarkTime(WalkMark2);
repeat
Wait(100+random(250));
until((FlagDistance < 2) or (TimeFromMark(WalkMark2) > 4000));
if(ClimbLadder('up')) then Players[CurrentPlayer].Loc := 'LadderUpStairs' else
begin
CheckDoor;
Continue;
end;
end else Players[CurrentPlayer].Loc := 'Error';
end else Players[CurrentPlayer].Loc := 'Error';
until((Players[CurrentPlayer].Loc = 'LadderUpStairs') or (WalkTries = 2) or (TimeFromMark(WalkMark) > 20000));
// Go to bank
WalkTries := 0;
PlayerCheckLoc;
if(Players[CurrentPlayer].Loc = 'LadderUpStairs')then
begin
MarkTime(WalkMark2);
repeat
Wait(250+random(250));
until((FindSymbol(x, y, 'bank')) or (TimeFromMark(WalkMark2) > 3000));
MarkTime(WalkMark);
repeat
Inc(WalkTries);
// Try to walk into bank, by finding the banker on the minimap
if(not(Players[CurrentPlayer].Loc = 'Bank'))then
begin
if(RadialWalk(52428, 300, 400, 65, 3, 7))then Players[CurrentPlayer].Loc := 'Bank';
end;
// Try walk to bank by banksymbol
if(not(Players[CurrentPlayer].Loc = 'Bank'))then
begin
if(FindSymbol(x, y, 'bank'))then
begin
if(MFNF(x, y, 1, -random(3)))then
begin
MarkTime(WalkMark2);
repeat
Wait(100+random(250));
until((FlagDistance = 0) or (TimeFromMark(WalkMark2) > 5000));
Players[CurrentPlayer].Loc := 'Bank';
end;
end;
end;
// Try radialwalking to bank, by banksymbol.
if(not(Players[CurrentPlayer].Loc = 'Bank'))then
begin
SetupBMPs;
BankColor := AutoColorThis(BankBMP, 50, MMX1, MMY1, MMX2, MMY2);
FreeBMPs;
if(not(BankColor = 0))then
begin
if(RadialWalk(BankColor, 300, 400, 65, 3, 7))then Players[CurrentPlayer].Loc := 'Bank';
end;
end;
// Try walk to bank by guide symbol
if(not(Players[CurrentPlayer].Loc = 'Bank'))then
begin
if(FindSymbol(x, y, 'guide'))then
begin
if(MFNF(x, y, 1, -random(3)))then
begin
MarkTime(WalkMark2);
repeat
Wait(100+random(250));
until((FlagDistance = 0) or (TimeFromMark(WalkMark2) > 5000));
Players[CurrentPlayer].Loc := 'Bank';
end;
end;
end;
// Try radialwalking to bank, by guide symbol
if(not(Players[CurrentPlayer].Loc = 'Bank'))then
begin
SetupBMPs;
GuideColor := AutoColorThis(GuideBMP, 50, MMX1, MMY1, MMX2, MMY2);
FreeBMPs;
if(not(GuideColor = 0))then
begin
if(RadialWalk(GuideColor, 300, 400, 65, 3, 7))then Players[CurrentPlayer].Loc := 'Bank';
end;
end;
until((Players[CurrentPlayer].Loc = 'Bank') or (WalkTries = 3) or (TimeFromMark(WalkMark) > 30000));
end;
// If we're not at the bank now, something went wrong.
if(not(Players[CurrentPlayer].Loc = 'Bank'))then
begin
Writeln('[Error] Could not walk to bank, switching character...');
PlayerLogout;
end;
end;
{-------------------------------------------------------------------------------
Main loop
Description: This is where we execute the script.
-------------------------------------------------------------------------------}
begin
SetupScript;
PlayerLogin;
repeat
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
Times := 0;
Repeats := 0;
Bowstrings := 0;
AlignCompass;
repeat
BankFB;
if(not(Repeats = 0))then SetupProgress;
if((Times >= Players[CurrentPlayer].Integers[0]) or (not(LoggedIn)))then Break;
WalkSpinner;
SpinFlax;
WaitWhileSpinning;
WalkBank;
Inc(Repeats);
until((Times >= Players[CurrentPlayer].Integers[0]) or (not(LoggedIn)));
NextPlayer(Players[CurrentPlayer].Active); // Next player
until(false);
end.——————————————————
<!– END TEMPLATE: formanswers –>