SRL Archive - OSR Help

Some scripting help


Caniz

2013-03-19 11:09:09

Edit, I solved the problems myself! :) Thanks all for trying tho! ;) <3


So, yeah. I'm trying to create a basic Maple chop/fletch/dropper to level up my fletching, the problem is, I get this same error everytime I run my script and can't figure out what is causing it :/

program Kanin_Maple_fletcher;
{$I SRL/SRL.Simba}
{$I P07Include.Simba}

var x,y,Knifecol,Logcol: integer;


Procedure P07_DeclarePlayer;
begin
P07_PlayerName := '';
P07_PlayerPass := '';
end;

procedure WaitHumanClick;
begin
case random(600) of
1..450: Wait(RandomRange(0, 100));
451..570: Wait(RandomRange(0, 200));
571..590: Wait(RandomRange(0, 600));
591..600: Wait(RandomRange(400, 1100));
end;
end;

Procedure Maple;
begin
if P07_FindObjCustom(x, y, ['Chop down', 'Maple tree'], [22149,13393,3435667],15) then
begin
repeat
WaitHumanClick;
wait (randomrange (100, 250));
ClickMouse2(mouse_left);
wait (randomrange (100, 300));
wait (randomrange (3500, 5000));
Until (InvFull);
end;
end;

Procedure Fletch ;
begin
Knifecol:=9408666;
Logcol:= 3303564;
if P07_FindObjCustom (x, y, ['Use', 'Knife'], [Knifecol,7039860,7960961], 10) then
begin
Clickmouse2(mouse_right);
wait(randomrange(50, 150));
P07_ChooseOptionMulti(['Use']);
wait (randomrange (300, 450));
if P07_FindObjCustom (x, y, ['Maple logs'], [Logcol,937073,607333], 10) then
begin
Clickmouse2(mouse_left);
wait(randomrange(58,89));
Mmouse(x, y, 273, 411);
ClickMouse2(mouse_left);
P07_ChooseOptionMulti(['Make X']);
wait(randomrange(310, 400));
P07_TypeFast('33');
Keydown(13);
wait(RandomRange(48432,51130));
end;
end;
end;


begin
SetupP07Include;
ActivateClient;
P07_DeclarePlayer;


repeat
repeat
Maple;
until(InvFull);
Fletch;
wait (randomrange (500, 800));
P07_DropAllExcept([1]);
until(not P07_LoggedIn);

end.

The error message I'm getting is
Error: Exception: The bitmap[0] does not exist at line 664
The following DTMs were not freed: [0, 1, 2, 3]

If anyone could help, I would be honored to have your help :) T.hanks all! :)

Kyle Undefined

2013-03-19 11:40:15

You don't even have 664 lines of code.

What is it doing when the error occurs? Have you tried debugging it? I'd put writelines all throughout so you can see what's being executed when the error happens.

Caniz

2013-03-19 11:50:44

You lost me a bit, I'm not exactly sure what you mean with debugging it, since I'm only aware of debug box down below.. (Yes, I am a noob)

The bot begins chopping wood, and then after around 10 seconds that error message appears.
Looks like I forgot to mention, it opens up "globals" window, where the message points to an empty line :/


(*
GetFightBarTPA
~~~~~~~~~~~~~~

.. code-block:: pascal

Function GetFightBarTPA(SearchArea: TBox): TPointArray;

Used in various fighting functions, including srl_InFight

.. note::

by Narcle

Example:

.. code-block:: pascal


*)
This is the part from "globals" where the error is pointing at.

CynicRus

2013-03-19 11:53:13

SetupSRL must be before SetupP07Include;:)

Caniz

2013-03-19 12:01:49

If I add SetupSRL the script goes all wild, mouse getting all crazy and not clicking a single thing :/