TheShinyTuxedo
2011-12-20 09:16:23
Tree Lopper
by TheShineyTuxedo
Just started to get the hang of scripting for Simba. I don't really have anything fancy to show off yet but just wanted to show what I have. It's the tutorial script that Yohojo did in his videos added with not much of my own stuff yet.
I really enjoyed scripting for Runescape bots but most of them are down now so why not try Simba. I will hopefully get the hang of it and learn some pretty cool stuff while im here.
Let me know what you think.
Version Log:
1.0 Alpha
- Only cuts Trees
- Script will terminate if it can't find a tree after 10 camera turns
- Saves a log to your Simba\Scripts folder
Instructions
- Start anywhere near Trees
- Make sure to have an axe equipt
program TreeLopper;
{$i SRL\SRL\MISC\SMART.scar}
{$i SRL\SRL.scar}
{$i SRL\SRL\Misc\Stats.simba}
const
Version = '1.0 Alpha';
NumbOfPlayers = 1;
StartPlayer = 0;
var
CameraTurns, LogCount: Integer;
procedure DeclarePlayers;
var
i:Integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers - 1 do
Players[i].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
with Players[0] do
begin
Name := 'YOUR USERNAME HERE';
Pass := 'YOUR PASSWORD HERE';
Nick := '3-4 CHARACTERS FROM YOUR NICKNAME'
Active := True;
end;
end;
procedure StatsGuise(wat:String);
begin
Status(wat);
Disguise(wat);
end;
procedure Antiban;
begin
case Random(500) of
0: begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('Woodcutting', False) GameTab(tab_Inv); end;
50: begin StatsGuise('Antiban') SleepAndMoveMouse(7000 + Random(500)); end;
125: begin StatsGuise('Antiban') GameTab(tab_Inv) ExamineInv; end;
150: begin StatsGuise('Antiban') RandomAngle(1); end;
200: begin StatsGuise('Antiban') GameTab(tab_Stats); Wait(3000 + Random(500)); GameTab(tab_Inv); end;
245: begin StatsGuise('Antiban') MakeCompass(Random(360)) end;
end;
end;
procedure ProgressReport(Text, FileName:String);
var
thePath: String;
theFile: Integer;
begin
thePath := AppPath + 'Scripts\';
try
theFile := RewriteFile(thePath + FileName, False);
except
Writeln('Error Opening File!');
finally
Writeln('Done trying to open file!');
end;
CloseFile(theFile);
end;
procedure FailSafe(Reason:String);
begin
Logout;
ProgressReport(Reason, 'TreeLopper_Log.txt')
TerminateScript;
end;
procedure Chop;
var
X, Y, PlusOne, TreeCounter:Integer;
begin
FindNormalRandoms;
PlusOne := InvCount + 1;
X := MSCX;
Y := MSCY;
if CameraTurns > 10 then
FailSafe('Could Not FInd A Tree!');
if FindObjTPA(X, Y, 3163478, 9, 1, 20, 60, 700, ['C', 'Ch']) or
FindObjTPA(X, Y, 3427166, 9, 1, 20, 60, 700, ['C', 'Ch']) or
FindObjTPA(X, Y, 2636617, 9, 1, 20, 60, 700, ['C', 'Ch']) or
FindObjTPA(X, Y, 3031635, 9, 1, 20, 60, 700, ['C', 'Ch']) then
begin
StatsGuise('Chopping A Tree!');
case Random(2) of
0: Mouse(X, Y, 5, 5, True);
1: begin Mouse(X, Y, 5, 5, False); WaitOption('Chop', (100 + Random(100))); ChooseOption('Chop'); end;
end;
Flag;
MarkTime(TreeCounter);
repeat
CameraTurns := 0;
FindNormalRandoms;
StatsGuise('Antiban + Chopping');
Antiban;
Wait(1000 + Random(150));
if InvCount = Plusone then
Writeln('Log Chopped!');
LogCount := LogCount + 1;
until (InvCount = Plusone) Or (TimeFromMark(TreeCounter) > 7000)
end else
begin
CameraTurns := CameraTurns + 1;
MakeCompass(Random(360));
Wait(1000 + Random(1500));
end;
end;
procedure Drop;
var
X, Y, LogDTM, KnotDTM, {RockDTM,} I:Integer;
SlotBox:TBox;
InventoryPattern:TIntegerArray;
begin
LogDTM := DTMFromString('mbQAAAHicY2VgYChmY2BIBeIaIK4G4kIgPsvIwHAGiK8C8SkgPgLEHmYKQNVMKPg/AyZgxILBAABy9AgP');
{RockDTM := DTMFromString('mbQAAAHicY2VgYPBkY2BwZoPQQUDsDcSnGRkYTgDxFUYI+wgQ+/v6AFUzoeD/DJiAEQsGAwA1SweF');}
KnotDTM := DTMFromString('mbQAAAHicY2VgYChkY2DIBeIiIC4H4hIgFmViYBAEYlkgFgZiXiDuiLcBqmZCwf8ZMAEjFgwGAH7LBPs=');
InventoryPattern := [1, 5, 9, 13, 17, 21, 25, 2, 6, 10, 14, 18, 22, 26, 3, 7, 11, 15, 19, 23, 27, 4, 8, 12, 16, 20, 24, 28];
for I := 0 to 27 do
begin
SlotBox := InvBox(InventoryPattern[I]);
if FindDTM(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) or
FindDTM(KnotDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) {or
FindDTM(RockDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2)} then
begin
MouseItem(InventoryPattern[I], False);
WaitOption('D', (100 + Random(100)));
end;
end;
end;
begin
Smart_Server := 92;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers;
if not LoggedIn then
LoginPlayer;
SetAngle(False);
repeat
if CameraTurns >= 10 then
FailSafe('Could not find a Tree!');
if InvFull then
Drop
else
Chop;
until(false);
end.