Not sure if this is a bug but I can't run my script because of it (compiles perfectly). I get this error:
The issue code:Code:Error: Out Of Range at line 1121 The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2] The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap]
Code:function HPPercent: Integer; var ColorString: string; begin if (Players[CurrentPlayer].Level[SKILL_HITPOINTS] < 1) then Players[CurrentPlayer].Level[SKILL_HITPOINTS] := Max(1, GetSkillInfo('hitpoints', False)); if (Players[CurrentPlayer].Level[SKILL_HITPOINTS] > 1) then Result := Round(GetMMLevels('hp', ColorString) * 10 / Players[CurrentPlayer].Level[SKILL_HITPOINTS]) else Result := -1; end;
and now my script:
Code:program New; //{$DEFINE SMART} {$i srl/srl.simba} procedure antiban; var StartAngle, clicks, i: integer; begin StartAngle := round(rs_GetCompassAngleDegrees()); begin i := random(90); case (i) of 1: begin KeyDown(VK_Left); Wait((302)+random(50)); KeyUp(VK_Left); IncEx(clicks, 1); end; 2: begin KeyDown(VK_Right); Wait((302)+random(50)); KeyUp(VK_Right); IncEx(clicks, 1); end; 3: begin KeyDown(40); Wait((208)+random(50)); KeyUp(40); IncEx(clicks, 1); end; 4: begin KeyDown(38); Wait((201)+random(50)); KeyUp(38); IncEx(clicks, 1); end; end; end; Wait(100+Random(50)); MakeCompass(StartAngle); begin case random(90) of 0: RandomRClick; 2: PickUpMouse; 3: RandomMovement; 4: BoredHuman; 5: ExamineInv; end; end; end; procedure destroymosses; var x, y:integer; begin wait(130+randomrange(130,210)); If FindColorSpiral(x, y, 5866618, MSX1, MSY1, MSX2,MSY2) then writeln('Found Moss Giants attacking them soon'); repeat wait(350); until(not srl_InFight); writeln('Currently in a fight, waiting for it to die'); begin MMouse(x, y, 0, 0); writeln('Script not failed yet'); begin wait(100); Mouse(x, y, 0, 0, true); wait(3500+randomrange(300,340)); wait(100+randomrange(50,102)); Writeln('Moss giant should be dead soon'); end; end; end; procedure heal; var x, y, shark: integer; begin if HPPercent>40 then Writeln('We Definitely need to heal up!'); begin if FindDTM(shark, x, y, MIX1, MIY1, MIX2, MIY2) then begin MMouse(x, y, 5, 5); Mouse(x, y, 0, 0, true); Writeln('That shark healed some health'); FreeDTM(shark); end; end; end; procedure dtmz; var shark:integer; begin Writeln('Shark DTM has now been enabled'); shark := DTMFromString('mwQAAAHic42RgYLBjYmDwBmJzIDYEYjcg9oKyHYDYCogfAtV9AeLrQPwJiG8B8TMgfgql3wBxVZwrkGQkgAkDQiagmAIAZKMLiw=='); end; procedure freedtmz; var shark:integer; begin Writeln('Shark DTM has now been disabled'); FreeDTM(shark); end; begin SetUpSRL; dtmz; AddOnTerminate('freedtmz'); repeat antiban; destroymosses; heal; until(false); freedtmz; end.
I put a lot of unnecessary Writelns to be sure it wasn't a script error.



Reply With Quote


