Help with my power cutter
Now on my fourth day of scripting!
Hi guys! - I fixed the original problem, but this script has come a longggg way since then, Im keeping it up for people to have a look at, offer their suggestions, or even use it for themselves :)
This post has sort of evolved into a scripting log of my Powercutter, so check it out!
The edits regard what I am changing to make the script better.
EDIT: Sorted the script out, looked at some tutorials, began to piece together what will eventually be a reliable, undetectable powercutter, It's a bit messy at the moment!
EDIT: I have now put forms into it and it's all peachy, they dont do anything yet, but give it time :) However, I dont know how to make the const change through using the form... if that makes sense?
EDIT: I have now included SRL, as of it yet it serves no purpose, but im going to start experimenting with it, Also made my name at the top a bit snazzy :)
EDIT: Morning all! Third day of scripting; Progress report added, AntiRandoms added, SRL setup, DropLogs added. Things are picking up, but at the moment i have an error :O
EDIT: As my third day of scripting comes to an end, I'v finnaly managed to sort a script out that has a use lol, pick any tree color and put it into the const value, and it will chop that tree, then when the logs are full it will drop them. Pretty simple but im proud of it :)
Im now going to work on making it more human, logging in and out for example, and actually put those nice pretty forms i spent so much time messing around with to use!
EDIT: Touched on some RadialWalking tuts, it seems a really nifty feature, thumbs up to Yakman for the great aid, I even managed to get my character to walk out of the bank :)
I'v also been advised to tidy my script up, and neatness has always been a major concern of mine, so thats a major priority, I wasn't aware there was a strict order of a script, so I looked it up and am working on it now...
EDIT: Standardized it all, it took ages, looks a little sexier now though :)
EDIT: Afternoon my fellow scripters :) Day four of my scripting life, things are looking up! The script works great, but I need to sort out the AntiRandoms, I ended up In Oracle mountain with some of those annoying boxes the old man gives to you... I also need to sort out the forms, now my major priority :) Thanks for all the support guys!
EDIT: Ok the forms now work for the user and password, yay :) Having a bit of trouble with the old enter color on form though... working on it now :)
EDIT: Big thanks to 3Garett3 for explaining how to make the AntiRandom more effective, and explaining findcolortolerance, both of which have been added :D
EDIT: Remapped the forums so they can be used with SRL login, also tidyed up the forum label names etc...
EDIT: Yay, got my first progress report posted below... It's pointed out how much work my Progress reports need! So I'll work on that now... overall really nice though! 305 maple logs... thats about 12k exp :) Im going to take the clicks out because its not nesscary.
Any help will be much appreciated :) This has taken me hours of editing, checking for mistakes, fixing errors, checking tuts, comparing scripts, tidying up, i really respect you guys for all the effort you put in to beat the game :P
SCAR Code:
[]========================================[]
---------------->Progress report<----------------
Cut 350 logs
---------------------------------------------
Did 0 Clicks
[]========================================[]
Successfully executed
SCAR Code:
///////////////////////////
//// Power-Cutter ////
//// ////
//// A Shadows~Collide ////
//// Script ////
///////////////////////////
// This script will cut any tree
// you tell it to, use the color
// clicker to pick a large color
// on the tree, then paste it
// into the const section and hit
// run. Ignore the forms for now!
// Start at the log-in page,
// Dont worry, the log-in
// Procedure will get better!
program PowerCutter;
{.include SRL/SRL.scar}
////////////////////////////////
// Set-up //
////////////////////////////////
const
TreeColor = 14448;
///////////////////////////////
// End of Set-up //
///////////////////////////////
var
TreesCut, Clicks, Chop: Integer;
frmDesign: TForm;
Title: TLabel;
User: TLabel;
Pass: TLabel;
CharNick: TLabel;
EditUser: TEdit;
EditPass: TEdit;
EditNick: TEdit;
StartButton: TButton;
procedure ClickStartButton(sender: TObject);
begin
ClearDebug;
Writeln(' ');
Writeln(' --- A Shadows~collide Script ---');
Writeln(' ');
Writeln(' This is my first script.');
Writeln(' Hopefully it will chop any tree you set the color too!');
Writeln(' Please post any feedback or suggestions.');
Writeln(' ');
Writeln(' --- A Shadows~collide Script ---');
wait(10 + random(800));
frmDesign.ModalResult := mrOk;
end;
procedure ProgressReport;
begin
ClearDebug;
Writeln('[]========================================[]');
Writeln('---------------->Progress report<----------------');
Writeln(' Cut ' + IntToStr(TreesCut) + ' logs ' + ' ');
Writeln('---------------------------------------------');
Writeln(' Did ' + IntToStr(Clicks) + ' Clicks' + ' ');
Writeln('[]========================================[]');
end;
procedure DoAntiRandoms;
begin
FindTalk;
FindNormalRandoms;
if (FindFight = true) then
begin
RunAwayDirection('N');
Wait(10000 + random(2000));
RunBack;
end;
end;
procedure MainForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 417;
frmDesign.Height := 266;
frmDesign.Caption := 'A Shadows-Collide Script';
frmDesign.Color := clMonkeyGreen;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Title := TLabel.Create(frmDesign);
Title.Parent := frmDesign;
Title.Left := 24;
Title.Top := 10;
Title.Width := 348;
Title.Height := 22;
Title.Caption := 'Shadows-Collide Power-Cutter';
Title.Color := clBtnFace;
Title.Font.Color := clWindowText;
Title.Font.Height := -19;
Title.Font.Name := 'Rockwell Extra Bold';
Title.Font.Style := [fsBold];
Title.ParentColor := False;
Title.ParentFont := False;
User := TLabel.Create(frmDesign);
User.Parent := frmDesign;
User.Left := 25;
User.Top := 45;
User.Width := 61;
User.Height := 19;
User.Caption := 'Username';
User.Font.Color := clWindowText;
User.Font.Height := -16;
User.Font.Name := 'Times New Roman';
User.Font.Style := [];
User.ParentFont := False;
Pass := TLabel.Create(frmDesign);
Pass.Parent := frmDesign;
Pass.Left := 25;
Pass.Top := 75;
Pass.Width := 60;
Pass.Height := 19;
Pass.Caption := 'Password';
Pass.Font.Color := clWindowText;
Pass.Font.Height := -16;
Pass.Font.Name := 'Times New Roman';
Pass.Font.Style := [];
Pass.ParentFont := False;
CharNick := TLabel.Create(frmDesign);
CharNick.Parent := frmDesign;
CharNick.Left := 25;
CharNick.Top := 105;
CharNick.Width := 121;
CharNick.Height := 19;
CharNick.Caption := 'Character nickname';
CharNick.Font.Color := clWindowText;
CharNick.Font.Height := -16;
CharNick.Font.Name := 'Times New Roman';
CharNick.Font.Style := [];
CharNick.ParentFont := False;
EditUser := TEdit.Create(frmDesign);
EditUser.Parent := frmDesign;
EditUser.Left := 205;
EditUser.Top := 45;
EditUser.Width := 121;
EditUser.Height := 21;
EditUser.ParentShowHint := False;
EditUser.ShowHint := True;
EditUser.TabOrder := 8;
EditUser.Text := 'Enter Username';
EditPass := TEdit.Create(frmDesign);
EditPass.Parent := frmDesign;
EditPass.Left := 205;
EditPass.Top := 75;
EditPass.Width := 121;
EditPass.Height := 21;
EditPass.ParentShowHint := False;
EditPass.ShowHint := True;
EditPass.TabOrder := 9;
EditPass.Text := 'Enter Password';
EditNick := TEdit.Create(frmDesign);
EditNick.Parent := frmDesign;
EditNick.Left := 205;
EditNick.Top := 105;
EditNick.Width := 121;
EditNick.Height := 21;
EditNick.TabOrder := 10;
EditNick.Text := '3 letters of user, in order';
StartButton := TButton.Create(frmDesign);
StartButton.Parent := frmDesign;
StartButton.Left := 160;
StartButton.Top := 160;
StartButton.Width := 75;
StartButton.Height := 25;
StartButton.Caption := 'StartButton';
StartButton.TabOrder := 11;
StartButton.OnClick := @ClickStartButton;
end;
procedure LoadForm;
var
V: TvariantArray;
begin
Setarraylength(V, 0);
ThreadSafeCall('MainForm', V);
end;
procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;
procedure ShowFormModal2;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := EditUser.Text;
Players[0].Pass := EditPass.Text;
Players[0].Nick := EditNick.Text;
Players[0].Active := True
end;
procedure CutTheTree;
begin
repeat;
wait(1000 + random(500));
if FindColorSpiralTolerance(x, y, TreeColor, 3, 3, 514, 338, 5) then
begin
MMouse(x, y, 5, 8);
Wait(50 + random(25));
if (IsUpText('hop')) then
begin
Wait(200 + random(100));
Mouse(x, y, 1, 1, true);
Wait(500 + random(500));
DoAntiRandoms;
end;
end;
Wait(3000 + random(500));
DoAntiRandoms;
TreesCut := TreesCut + 1;
until (InvFull);
end;
procedure DropLogs;
begin
wait(100 + random(50));
wait(2000 + random(1000));
dropto(2, 28);
wait(100 + random(50));
end;
begin
SetupSRL;
LoadForm;
ShowFormModal2;
DeclarePlayers;
repeat
ActivateClient;
LoginPlayer;
HighestAngle;
CutTheTree;
DropLogs;
ProgressReport;
until (False)
end.
Many thanks!
- Shadows-Collide -