SCAR Code:
program log_cutter_with_responder ;
{THIS IS NEGS AUTO FLETCHER WITH AN ADDED AUTO RESPONDER ! !
THIS IS NEGS AUTO FLETCHER WITH AN ADDED AUTO RESPONDER ! !
THIS IS NEGS AUTO FLETCHER WITH AN ADDED AUTO RESPONDER ! !}
{include SRL/SRL.scar}
var
Number, LogsDone, Knife,report, Log: Integer;
StartXP, EndXP, TotalXP: Integer;
HaveKnife: boolean;
var
ChatText:String;
const
LogsToDo = 3000; //How many logs to cut.
Longbow = True; //LongBows =true. Shorts = false, i think theres a problem with shorts though.
Message1 = '-';//Type a message to say randomly to fletchers. ANTIBAN
Message2 = '-';//The same thing ^^^
Message3 = '-';//^^^^^
Message4 = '-';//^^^^^^^
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '---------';
Players[0].Pass := '---------';
Players[0].Nick := 'iti';
Players[0].Active := True;
end;
procedure DeclareDTMS;
begin
Knife := DTMFromString('78DA631462606010664001A539D90CFF81342' +
'310FF0702462E204399010D302291409A0F48C81250230124F808' +
'A89104126C04D48800092EFC6A000CC50739');
Log := DTMFromString('78DA632C66626078C1800282BD6419FE03694' +
'620FE0F048C8D986A20B23012485702D5BC25A026830835354035' +
'8FF0AB01002EEB0CAB');
end;
procedure RunAway;
begin
if(not(LoggedIn))then Exit;
WriteLn('>>Running Away');
RunAwayDirection('S');
Wait(12000 + random(2000));
RunBack;
end;
procedure Randoms;
begin
FindTalk;
wait(10)
FindNormalRandoms;
if (FindFight) then RunAway;
end;
function InBank: Boolean;
begin
Result := GetColor(282, 41) = 2070783;
end;
procedure CheckKnife;
begin
if(not(LoggedIn))then Exit;
GameTab(4);
if FindDTM(Knife, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
WriteLn('>Found knife in inventory.')
HaveKnife := True;
end else HaveKnife := False;
end;
procedure WithdrawLogs;
begin
if(not(LoggedIn))then Exit;
WriteLn('>Withdrawing Logs');
if FindDTM(Log, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 1, 1, false)
Wait(100 + Random(200))
ClickOption('All', 1)
end else begin WriteLn('>>Didnt Find Logs!');Logout;Exit;end;
end;
procedure WithdrawKnife;
begin
if(not(LoggedIn))then Exit;
if(not(HaveKnife)) then
begin
if FindDTM(Knife, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
WriteLn('>Withdrawing Knife')
Mouse(x, y, 1, 1, True)
Wait(100)
HaveKnife := True
end else begin WriteLn('>>No knife to be found!');Logout;Exit;end;
end;
end;
procedure RandomRotate;
begin
ActivateClient;
case Random(5) of
0: SendArrowSilentWait(1, 500 + Random(500));
1: SendArrowSilentWait(3, 500 + Random(500));
2: SendArrowSilentWait(1, 1500 + Random(500));
3: SendArrowSilentWait(3, 1500 + Random(500));
4: SendArrowSilentWait(1, 100 + Random(500));
5: SendArrowSilentWait(3, 100 + Random(500));
end;
end;
procedure DoLongBows;
var
LB:integer;
FoundLBIcon:boolean;
begin
if(not(LoggedIn))then Exit;
repeat
MouseBox(204, 382, 305, 435, 0);
if (IsUpText('ake')) then
begin
FoundLBIcon:= True;
GetMousePos(x, y);
Mouse(x, y, 2, 2, false);
FTWait(1);
ClickOption('X', 3);
FTWait(5);
Number := 27 + Random(11);
TypeSend(IntToStr(Number));
Wait(100 + Random(250));
TypeSend(Chr(13));
end else
begin
RandomRotate;
LB:= LB+1
if LB>10 then
begin
WriteLn('>>Couldnt find longbow icon')
WriteLn('>>Logging Out')
Logout;
TerminateScript;
end;
end;
until(FoundLBIcon);
FoundLBIcon:= False;
end;
procedure DoShortBows;
var
SB:integer;
FoundSBIcon:boolean;
begin
if(not(LoggedIn))then Exit;
repeat
MouseBox(60, 380, 140, 433, 0);
if (IsUpText('ake')) then
begin
FoundSBIcon:= True;
GetMousePos(x, y)
Mouse(x, y, 2, 2, false);
FTWait(1);
ClickOption('X', 3);
FTWait(5);
Number := 27 + Random(11);
TypeSend(IntToStr(Number));
Wait(100 + Random(250));
TypeSend(Chr(13));
end else
begin
RandomRotate;
SB:= SB+1
if SB>10 then
begin
WriteLn('>>Couldnt find longbow icon')
WriteLn('>>Logging Out')
Logout;
TerminateScript;
end;
end;
until(FoundSBIcon);
FoundSBIcon:= False;
end;
procedure ClickBows;
begin
if(not(LoggedIn))then Exit;
WriteLn('>Clicking Bow + Log');
GameTab(4)
if FindDTM(Knife, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, true)
end else begin WriteLn('>>Didnt Find Knife!');Logout;Exit;end;
Wait(100 + Random(800));
if FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, true)
end else begin WriteLn('>>Didnt Find Logs!');Logout;Exit;end;
end;
function DoneFletching: boolean;
begin
if (GetColor(717, 447) = 65536) or
(GetColor(717, 444) = 65536) then
begin
Result := True;
end;
end;
procedure LvlUp;
begin
if(not(LoggedIn))then Exit;
if (FindNpcChatText('continue')) then
begin
ClickBows;
Wait(100 + Random(500))
if Longbow then DoLongBows;
if not (Longbow) then DoShortBows;
end;
end;
procedure GetTotalXp;
begin
if(not(LoggedIn))then Exit;
WriteLn('>>Getting XP');
EndXP := GetXp('Fletching');
wait(10);
TotalXP := (EndXP - StartXP);
wait(10)
end;
procedure neGwait;
var neG: integer;
begin
neG := Random(15);
case neG of
1: RandomRotate;
2: RandomRotate;
3: RandomRotate;
4: GetTotalXp;
end;
end;
procedure WaitForFletch;
var FTM:integer;
begin
if(not(LoggedIn))then Exit;
MarkTime(FTM);
repeat
FTWait(3);
Randoms;
LvlUp;
neGwait;
if (TimeFromMark(FTM) > 90 * 1000) then Exit;
until (DoneFletching);
end;
procedure DoneLoad;
begin
if(not(LoggedIn))then Exit;
if (DoneFletching) then
begin
WriteLn('>Finished Load');
LogsDone := LogsDone + 27;
GetTotalXp;
end;
end;
procedure respond;
begin
ChatText:=GetLastChatText;
ChatBoxRespond(ChatText,'Hey','yo!')
ChatBoxRespond(ChatText,'fletching lvls','59 you?')
ChatBoxRespond(ChatText,'fletch lvl','59 u?')
ChatBoxRespond(ChatText,'fletch levels?','59')
ChatBoxRespond(ChatText,'total lvls','970')
procedure mail;
begin
TypeSend(Message1);
Wait(25000+random(19000));
TypeSend(Message2);
Wait(25000+random(19000));
TypeSend(Message3);
Wait(25000+random(19000));
TypeSend(Message4);
Wait(25000+random(19000));
end;
procedure DoFletching;
begin
if(not(LoggedIn))then Exit;
ClickBows;
Wait(100 + Random(500))
if Longbow then DoLongBows;
if not (Longbow) then DoShortBows;
WaitForFletch;
DoneLoad;
end;
procedure PlayerSetup;
begin
if(not(LoggedIn))then Exit;
WriteLn('>Setting Up Player');
StartXP := GetXp('Fletching');
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
DeclareDTMS;
CheckKnife;
end;
procedure CloseBankneG;
var
CBBM, CBx, CBy: Integer;
begin
if(not(LoggedIn))then Exit;
WriteLn('>Closing Bank');
if(not(InBank))then Exit;
CBBM := BitmapFromString(4, 3, 'z78DA3330000243030CD2C' +
'CC4D4DC848008320900F6350DC1');
if FindBitmapToleranceIn(CBBM, CBx, CBy, 450, 30, 500, 50, 50) then
begin
MMouse(CBx, CBy, 4, 4);
GetMousePos(CBx, CBy);
Mouse(CBx, CBy, 0, 0, True);
end;
FreeBitmap(CBBM);
end;
procedure DepositFix(slot, toslot, thetype: Integer);
var
slotnumber, col, row: Integer;
begin
if(not(LoggedIn))then Exit;
if (InBank) then
begin
slotnumber := slot;
while (slotnumber <= toslot) do
begin
if ((slotnumber mod 4) = 0) then
col := 3
else
col := (slotnumber mod 4) - 1;
row := (slotnumber - 1) / 4;
if (FindColor(x, y, 65536, (571 + 47 * col), (215 + 36 * row), (601 + 47 *
col), (245 + 36 * row))) then
begin
if (thetype = 1) then
Mouse(x, y + 3, 5, 5, True);
if (thetype = 2) then
begin
Mouse(x, y + 3, 5, 5, False);
if (ChooseOption(x, y, 'All')) then
Wait(1000 + Random(100));
end;
end;
slotnumber := slotnumber + 1;
end;
end;
end;
procedure OpenBankneG;
var
c,TOL,FS: Integer;
begin
if(not(LoggedIn))then Exit;
HighestAngle;
TOL:=10
repeat
if (FindObj(x, y, 'oot', 2842746, TOL)) then
begin
Mouse(x, y, 1, 1, False);
Wait(500 + Random(750))
if (ChooseOption(x, y, 'quickly')) then
begin
Flag;
repeat
Wait(100);
c := c + 1
until (InBank) or (c >= 50);
end;
end else
begin
WriteLn('>>Didnt Find Bank, Increasing Tolerance')
TOL:= TOL + 5
FS:= FS + 1
if FS>5 then
begin
WriteLn('>>Couldnt Find Bank')
Logout;
Exit;
end;
end;
until(InBank);
end;
procedure DepositLogs;
begin
if(not(LoggedIn))then Exit;
WriteLn('>>Depositing Inventory');
DepositFix(2, 28, 2)
end;
procedure DoBanking;
begin
FixBank;
DepositLogs;
WithdrawKnife;
WithdrawLogs;
CloseBankneG;
end;
////////////////////////////////////////////////////////
{---------------------------------------------------------}
{ Main Loop }
{---------------------------------------------------------}
begin
SetupSRL;
ActivateClient;
DeclarePlayers;
begin
if (not (LoggedIn)) then
begin
Loginplayer;
HighestAngle;
end;
end;
PlayerSetup;
repeat
OpenBankneG;
DoBanking;
DoFletching;
respond;
mail
until (LogsDone >= LogsToDo);
if (LogsDone >= LogsToDo) then
begin
Logout;
TerminateScript;
end;
end.
{Thanks to all The tutorials on everything. Ive used NEGS auto fletcher and added a auto responder. Hope its ok with u neg.