Emarian
2013-03-29 16:50:55
I'm trying to implement antirandoms in my cowkilling SRL-OSR SMART8 script. I added the lines to declareplayers on 19, lines 28-31, and lines 143-146 in an effort to implement antirandoms and that was what broke it. It compiles but after it kills a few cows I get this error in the antirandoms file:
Error: Exception: Mask is invalid. Width/Height: (9,6). WhiteHi/BlackHi: (-1,53) at line 780
The following DTMs were not freed: [SRL - Lamp bitmap, SRL - Book of Knowledge]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Minimap Mask bitmap]
Thanks in advance for your help - this error is really frustrating because I was about to move onto making a functional progress report and then try banking >.< so I'm looking forward to getting this out of the way
http://pastebin.com/9MNRGJTm
Error: Exception: Mask is invalid. Width/Height: (9,6). WhiteHi/BlackHi: (-1,53) at line 780
The following DTMs were not freed: [SRL - Lamp bitmap, SRL - Book of Knowledge]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Minimap Mask bitmap]
Thanks in advance for your help - this error is really frustrating because I was about to move onto making a functional progress report and then try banking >.< so I'm looking forward to getting this out of the way
http://pastebin.com/9MNRGJTm
program PwnDemCows;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Misc/Debug.Simba}
const
cowCOLOR1 = 4938351;
cowCOLOR2 = 1188393;
greenLifeBar = 65280;
var
x, y, x1, y1: Integer;
procedure DeclarePlayer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
with Players[0] do
begin
Name := ''; // Username here
Pass := ''; // Password here
Active := True;
end;
end;
procedure AntiRandoms;
begin
FindNormalRandoms;
LampSkill := 'woodcutting'; // Skill you want to use the genie lamp on here
LevelUp;
end;
//More human like movement
Procedure HumanMove;
Begin
case random(200) of
1..160: MMouse(RandomRange(X - 7, X + 7), RandomRange(y - 7, y + 7), 0, 0);
161..190: MMouse(RandomRange(X - 9, X + 9), RandomRange(y - 9, y + 9), 0, 0);
191..200: MMouse(RandomRange(X - 12, X + 12), RandomRange(y - 12, y + 12), 0, 0);
End;
End;
procedure Antiban;
begin
case Random(100) of
1: HoverSkill('magic', False);
2: HoverSkill('random', False);
3: Boredhuman;
4: Wait(2500 + random(4500));
5: HoverSkill('smithing', False);
6: PickUpMouse;
7: RandomMovement;
8: RandomRClick;
end;
end;
procedure MiniBreaker;
begin
case Random(160) of
1: Wait(40000 + random(7400));
2: Wait(25500 + random(8550));
3: Wait(60040 + random(6759));
4: Wait(20400 + random(2549));
end;
end;
procedure SetupCowKiller;
begin
if (not LoggedIn) then
begin
LogInPlayer;
MakeCompass('N');
KeyDown(VK_UP);
Wait(RandomRange(1473, 2541));
KeyUp(VK_UP);
end
else
begin
KeyDown(VK_UP);
Wait(RandomRange(1473, 2541));
KeyUp(VK_UP);
end;
end;
function ClickCow: Boolean;
begin
repeat
wait(RandomRange(824, 1457));
until (FindColor(x, y, greenLifeBar, 206, 127, 298, 196) = false);
if FindObjCustom(x, y, ['Cow'], [cowCOLOR1, cowCOLOR2], 50) then
begin
x := x - 20;
y := y - 20;
if x < 0 then
begin
x := 0;
end;
if y < 0 then
begin
y := 0;
end;
end
else
begin
KeyDown(VK_DOWN);
Wait(RandomRange(246, 632));
KeyUp(VK_DOWN);
KeyDown(VK_RIGHT);
repeat
Wait(RandomRange(74, 236));
until (FindObjCustom(x, y, ['Cow'], [cowCOLOR1, cowCOLOR2], 25))
KeyUp(VK_RIGHT);
end;
if FindColor(x1, y1, greenLifeBar, x, y, x + 40, y + 40) = false then
begin
x := x + 20;
y := y + 20;
MMouse(x, y, 3, 3);
Writeln('Detected a cow, lets kill it!');
ClickMouse2(mouse_left);
Result := DidRedClick
end
else
begin
case Random(2) of
0: Antiban();
1: MiniBreaker();
end;
end;
wait(RandomRange(2017, 2451));
end;
begin
ClearDebug;
writeln('Thank you for trying my cowkiller!')
SetupSRL;
DeclarePlayer;
ActivateClient;
Wait(RandomRange(2011, 2461));
SetupCowKiller;
repeat
while ClickCow(True) do
AntiRandoms;
until(not LoggedIn);
end.

