SRL Archive - OSR Help

need some eazy script help


remco1337

2012-06-05 08:04:44

Sup guys I am making a w100 cookahh, but i can“t make the cooking procedure
that clicks on the fire than select the option cook all

script :

program ShantayCooker;
{$DEFINE SMART}
{$i srl\srl.simba}
var
Lobster:integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
end;
function BankScreenEx: boolean; //New
begin
result:= BankScreen or PinScreen;
end;
Procedure SetDTMs;
begin
Lobster := DTMFromString('mlwAAAHicY2dgYHjKzMDwAYi/AvErIL4PxDeB+B4QezMyMNgDsQMQhwNxIBB7ALErEPPx8jIkW8oBTWBiqPdUZ0i0kGPw0hYHY1yAFYgZ8WAoAABSkwwb');

end;
Procedure FreeTheDtms;
begin
FreeDTM(Lobster);
end;
function ClickFire: Boolean;
var
x, y:Integer;
begin;
if FindObjTPA(x, y, 6272239, 20 ,5 , 15 ,60 ,450 ['Walk Here'])

end;
Procedure Cook;
var x, y :integer;
//If FindDTM(Lobster, x ,y, MBX1, MBY1, MBX2, MBY2) then

begin
MouseItem(RandomRange(1,27),mouse_Left);
wait(1250);
ClickFire;
end;
function FindShantayChest: boolean; //ty erik
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
result:=false;
if not LoggedIn then Exit;
if BankScreenEx then
begin
result:=true;
Exit;
end;
FindNormalRandoms;

tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.12);

if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
begin
ATPA:= TPAtoATPAEx(tpa, 25, 25);
for a:=0 to high(atpa) do
begin
MP:= MiddleTPA(atpa[a]);
Mouse(mp.x, mp.y, 4, 4, mouse_move);
if WaitUpText('Open', 500) then
begin
ClickMouse2(mouse_left);
if WaitFunc(@DidRedClick, 50, 1000) then
begin
writeln('Clicked Bank chest');
if WaitFunc(@BankScreenEx, 100, 5000) then
begin
writeln('BankScreen found');
result:= true;

break;
end;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

procedure Antiban;
begin
case Random(2300) of
0..1: begin; HoverSkill('cooking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
2..3: begin; HoverSkill('firemaking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
4: begin; HoverSkill('random', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
5..7: RandomRClick;
8..10: PickUpMouse;
11..13: RandomMovement;
14..16: BoredHuman;
17: ExamineInv;
18..22: SleepAndMoveMouse(Random(5000));

end;
end;

Procedure Bank;
var X, Y, P: Integer;
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
x := MSCX;
y := MSCY;
if not LoggedIn or FindNormalRandoms then
Exit;
Antiban;
// 5859188
//if FindObjTPA(X,Y, 2572631,5 ,1 ,20 ,20, 600, ['Open']) then
//if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
if FindShantayChest then
Mouse(X, Y, 3, 3, False);
WaitOption('Open', 500);

if PinScreen then
InPin(Players[CurrentPlayer].Pin);

if Bankscreen then
Wait(RandomRange(800, 1500));
if InvFull then DepositAll;
WithDraw(0,0,0);
Closebank;



end;

Procedure Startup;
begin

if not LoggedIn then
LoginPlayer;
If loggedIn then
debugln('Starting up');
MakeCompass('N');
GameTab(Tab_Inv);
SetAngle(SRL_ANGLE_HIGH);
end;
Procedure Mainloop;
Begin
repeat
If LoggedIn then
debugln('Performing the mainloop');
Startup;
Bank;
Cook;
until not LoggedIn
end;

begin
ClearDebug;
DeclarePlayers;
Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
SetUpSRL;
repeat
MainLoop;
until(AllPlayersInactive)
end.

edited script :

program ShantayCooker;
{$DEFINE SMART}
{$i srl\srl.simba}
var
Lobster:integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
end;
function BankScreenEx: boolean; //New
begin
result:= BankScreen or PinScreen;
end;
Procedure SetDTMs;
begin
Lobster := DTMFromString('mlwAAAHicY2dgYHjKzMDwAYi/AvErIL4PxDeB+B4QezMyMNgDsQMQhwNxIBB7ALErEPPx8jIkW8oBTWBiqPdUZ0i0kGPw0hYHY1yAFYgZ8WAoAABSkwwb');

end;
function ClickFire: Boolean;
var x, y :Integer;
begin
//if FindObjTPA(x, y, 6272239,20 ,5 , 15 ,60 ,450 ['Walk']) then
if FindObjTPA(X, Y, 6272239, 15 ,7, 15 , 40 , 450,['Alk Here']) then
begin
GetMousePos(X, Y);
Mouse(x, y, 5 , 5, True);
end;
end;
Procedure Cook;
var x, y :integer;
//If FindDTM(Lobster, x ,y, MBX1, MBY1, MBX2, MBY2) then

begin
MouseItem(RandomRange(1,27),mouse_Left);
wait(1250);
ClickFire;
end;
function FindShantayChest: boolean; //ty erik
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
result:=false;
if not LoggedIn then Exit;
if BankScreenEx then
begin
result:=true;
Exit;
end;
FindNormalRandoms;

tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.12);

if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
begin
ATPA:= TPAtoATPAEx(tpa, 25, 25);
for a:=0 to high(atpa) do
begin
MP:= MiddleTPA(atpa[a]);
Mouse(mp.x, mp.y, 4, 4, mouse_move);
if WaitUpText('Open', 500) then
begin
ClickMouse2(mouse_left);
if WaitFunc(@DidRedClick, 50, 1000) then
begin
writeln('Clicked Bank chest');
if WaitFunc(@BankScreenEx, 100, 5000) then
begin
writeln('BankScreen found');
result:= true;

break;
end;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

procedure Antiban;
begin
case Random(2300) of
0..1: begin; HoverSkill('cooking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
2..3: begin; HoverSkill('firemaking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
4: begin; HoverSkill('random', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
5..7: RandomRClick;
8..10: PickUpMouse;
11..13: RandomMovement;
14..16: BoredHuman;
17: ExamineInv;
18..22: SleepAndMoveMouse(Random(5000));

end;
end;
Procedure FreeTheDtms;
begin
FreeDTM(Lobster);
end;
Procedure Bank;
var X, Y, P: Integer;
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
x := MSCX;
y := MSCY;
if not LoggedIn or FindNormalRandoms then
Exit;
Antiban;
// 5859188
//if FindObjTPA(X,Y, 2572631,5 ,1 ,20 ,20, 600, ['Open']) then
//if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
if FindShantayChest then
Mouse(X, Y, 3, 3, False);
WaitOption('Open', 500);

if PinScreen then
InPin(Players[CurrentPlayer].Pin);

if Bankscreen then
Wait(RandomRange(800, 1500));
if InvFull then DepositAll;
WithDraw(0,0,0);
Closebank;



end;

Procedure Startup;
begin

if not LoggedIn then
LoginPlayer;
If loggedIn then
debugln('Starting up');
MakeCompass('N');
GameTab(Tab_Inv);
SetAngle(SRL_ANGLE_HIGH);
end;
Procedure Mainloop;
Begin
repeat
If LoggedIn then
debugln('Performing the mainloop');
Startup;
Bank;
Cook;
until not LoggedIn
end;

begin
ClearDebug;
DeclarePlayers;
Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
SetUpSRL;
repeat
MainLoop;
until(AllPlayersInactive)
end.

stuartroad

2012-06-05 08:21:52

Hi, I am no expert on scripting, but could it have anything to do with the fact that you freed the DTM too early?, Perhaps moving the free dtm bit to after the cooking bit?

I used "MouseBox" to click where the cook all option would come up, here is an example.


find dtm lobster
click lobster
find fire
click fire
MouseBox(300,420,313,425, mouse_Left); //Numbers = 2 different coords that the mouse is located at on the rs screen.

remco1337

2012-06-05 08:32:54

I think i first need to click the fish on the fire.

stuartroad

2012-06-05 08:36:04

From: remco1337
I think i first need to click the fish on the fire.


So what are you actually struggling with? Are you finding the lobster and clicking on it? Can you find a fire? Can you Click on it with the lobster?

remco1337

2012-06-05 08:37:29

It can't find tha fire and it's only selectecting the food by left clicking it

P1ng

2012-06-05 08:44:21

function ClickFire: Boolean;
var
x, y:Integer;
begin;
if FindObjTPA(x, y, 6272239, 20 ,5 , 15 ,60 ,450 ['Walk Here'])
//FindObjTPA(x,y,6272239,20,cts,objwidth,objheight,mincount,[uptext]);
end;

I commented in the parameters for FindObjTPA
- the x, y, colour and tolerance are all correct.
- CTS can only be 0, 1, 2 or 3 AFAIK (as standard it is 1, lots of functions for finding things change it temporarily to 2).
- Great tutorial on understanding CTS - http://villavu.com/forum/showthread.php?t=74908
- Try using a couple of smaller bits of UpText as well and avoid capitals to make it better
e.g. ['alk', 'ere']

Also for your Cook procedure -
Procedure Cook;
var x, y :integer;
//If FindDTM(Lobster, x ,y, MBX1, MBY1, MBX2, MBY2) then

begin
MouseItem(RandomRange(1,27),mouse_Left);
wait(1250);
ClickFire;
end;

- Though it's commented out I would assumed in this procedure you want to look for lobsters in your inventory. These co-ords (MBX1, MBY1, MBX2, MBY2) search your bankscreen. Try MIX1, MIY1, MIX2, MIY2.


Finally, you shouldn't need to repeat your mainloop in the procedure if you repeat it again in your script's loop.
Procedure Mainloop;
Begin
repeat //Un-necessary repeat and until
If LoggedIn then
debugln('Performing the mainloop');
Startup;
Bank;
Cook;
until not LoggedIn // Because you tell your script to repeat these steps below
end;

begin
ClearDebug;
DeclarePlayers;
Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
SetUpSRL;
repeat //Does the same thing as up above
MainLoop;
until(AllPlayersInactive);
end.

Mufasa

2012-06-05 08:51:20

I know like absolutely nothing about scripting as you can see in my sig but taking an educated guess. I'd say;

function ClickFire: Boolean;
var x, y :Integer;
begin
//if FindObjTPA(x, y, 6272239,20 ,5 , 15 ,60 ,450 ['Walk']) then
if FindObjTPA(X, Y, 6272239, 15 ,7, 15 , 40 , 450,['Alk Here']) then
begin
GetMousePos(X, Y);
Mouse(x, y, 5 , 5, True);
end;
end;
Finding Fire
It looks like you're using an arbitrary stand alone colour to find the fire. You should maybe try using Auto Colour Aid. (If you don't know how you can follow YoHoJo's Video) It's really simple to use.

Edit: Posted this before I saw the post above mine -.-… Ignore mine.. One above is much better

putonajonny

2012-06-05 08:54:25

  if FindObjTPA(X, Y, 6272239, 15 ,7, 15 , 40 , 450,['Alk Here']) then
shouldn't that be:
  if FindObjTPA(X, Y, 6272239, 15 ,7, 15 , 40 , 450,['alk Here']) then
or even better:
  if FindObjTPA(X, Y, 6272239, 15 ,7, 15 , 40 , 450,['alk', 'ere']) then

remco1337

2012-06-05 09:04:06

edited :

program ShantayCooker;
{$DEFINE SMART}
{$i srl\srl.simba}
var
Lobster:integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
end;
function BankScreenEx: boolean; //New
begin
result:= BankScreen or PinScreen;
end;
Procedure SetDTMs;
begin
Lobster := DTMFromString('mlwAAAHicY2dgYHjKzMDwAYi/AvErIL4PxDeB+B4QezMyMNgDsQMQhwNxIBB7ALErEPPx8jIkW8oBTWBiqPdUZ0i0kGPw0hYHY1yAFYgZ8WAoAABSkwwb');

end;
function ClickFire: Boolean;
var x, y :Integer;
begin
//if FindObjTPA(x, y, 6272239,20 ,5 , 15 ,60 ,450 ['Walk']) then
//if FindObjTPA(X, Y, 2722521, 14 ,7, 15 , 40 , 450,['fire']) then
if FindObjTPA(X, Y, 6272239, 15 ,7, 15 , 40 , 450,['alk', 'ere']) then
begin
GetMousePos(X, Y);
Mouse(x, y, 5 , 5, False);
WaitOption('Fire', 500);
end;
end;
Procedure Cook;
var x, y :integer;
//If FindDTM(Lobster, x ,y, MIX1, MIY1, MIX2, MIY2) then

begin
MouseItem(RandomRange(1,27),mouse_Left);
wait(1250);
ClickFire;
end;
function FindShantayChest: boolean; //ty erik
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
result:=false;
if not LoggedIn then Exit;
if BankScreenEx then
begin
result:=true;
Exit;
end;
FindNormalRandoms;

tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.12);

if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
begin
ATPA:= TPAtoATPAEx(tpa, 25, 25);
for a:=0 to high(atpa) do
begin
MP:= MiddleTPA(atpa[a]);
Mouse(mp.x, mp.y, 4, 4, mouse_move);
if WaitUpText('Open', 500) then
begin
ClickMouse2(mouse_left);
if WaitFunc(@DidRedClick, 50, 1000) then
begin
writeln('Clicked Bank chest');
if WaitFunc(@BankScreenEx, 100, 5000) then
begin
writeln('BankScreen found');
result:= true;

break;
end;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

procedure Antiban;
begin
case Random(2300) of
0..1: begin; HoverSkill('cooking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
2..3: begin; HoverSkill('firemaking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
4: begin; HoverSkill('random', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
5..7: RandomRClick;
8..10: PickUpMouse;
11..13: RandomMovement;
14..16: BoredHuman;
17: ExamineInv;
18..22: SleepAndMoveMouse(Random(5000));

end;
end;
Procedure FreeTheDtms;
begin
FreeDTM(Lobster);
end;
Procedure Bank;
var X, Y, P: Integer;
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
x := MSCX;
y := MSCY;
if not LoggedIn or FindNormalRandoms then
Exit;
Antiban;
// 5859188
//if FindObjTPA(X,Y, 2572631,5 ,1 ,20 ,20, 600, ['Open']) then
//if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
if FindShantayChest then
Mouse(X, Y, 3, 3, False);
WaitOption('Open', 500);

if PinScreen then
InPin(Players[CurrentPlayer].Pin);

if Bankscreen then
Wait(RandomRange(800, 1500));
if InvFull then DepositAll;
WithDraw(0,0,0);
Closebank;



end;

Procedure Startup;
begin

if not LoggedIn then
LoginPlayer;
If loggedIn then
debugln('Starting up');
MakeCompass('N');
GameTab(Tab_Inv);
SetAngle(SRL_ANGLE_HIGH);
end;
Procedure Mainloop;
Begin
If LoggedIn then
debugln('Performing the mainloop');
Startup;
Bank;
Cook;
end;

begin
ClearDebug;
DeclarePlayers;
Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
SetUpSRL;
repeat //Does the same thing as up above
MainLoop;
until(AllPlayersInactive);
end.

remco1337

2012-06-05 09:06:25

Script isnt repeating now and still can't find fire :S

edit : can you test it once please?

putonajonny

2012-06-05 09:10:58

From: remco1337
Script isnt repeating now and still can't find fire :S

edit : can you test it once please?


Can I borrow your account to do it? PM me…

remco1337

2012-06-05 09:13:35

Send it's just my lil skiller ofr money ;d <3 im using shrimps so that why I // the lobster dtm

remco1337

2012-06-05 09:17:13

current script : program ShantayCooker;
{$DEFINE SMART}
{$i srl\srl.simba}
var
Lobster:integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
end;
function BankScreenEx: boolean; //New
begin
result:= BankScreen or PinScreen;
end;
Procedure SetDTMs;
begin
Lobster := DTMFromString('mlwAAAHicY2dgYHjKzMDwAYi/AvErIL4PxDeB+B4QezMyMNgDsQMQhwNxIBB7ALErEPPx8jIkW8oBTWBiqPdUZ0i0kGPw0hYHY1yAFYgZ8WAoAABSkwwb');

end;
function ClickFire: Boolean;
var x, y :Integer;
begin
//if FindObjTPA(x, y, 6272239,20 ,5 , 15 ,60 ,450 ['Walk']) then
if FindObjTPA(X, Y, 2722521, 14 ,7, 15 , 40 , 450,['fire']) then
begin
GetMousePos(X, Y);
Mouse(x, y, 5 , 5, False);
WaitOption('Fire', 500);
end;
end;
Procedure Cook;
var x, y :integer;

begin
If FindDTM(Lobster, x ,y, MBX1, MBY1, MBX2, MBY2) then
begin
MouseItem(RandomRange(1,27),mouse_Left);
wait(1250);
ClickFire;
end;
end;
function FindShantayChest: boolean; //ty erik
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
result:=false;
if not LoggedIn then Exit;
if BankScreenEx then
begin
result:=true;
Exit;
end;
FindNormalRandoms;

tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.12);

if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
begin
ATPA:= TPAtoATPAEx(tpa, 25, 25);
for a:=0 to high(atpa) do
begin
MP:= MiddleTPA(atpa[a]);
Mouse(mp.x, mp.y, 4, 4, mouse_move);
if WaitUpText('Open', 500) then
begin
ClickMouse2(mouse_left);
if WaitFunc(@DidRedClick, 50, 1000) then
begin
writeln('Clicked Bank chest');
if WaitFunc(@BankScreenEx, 100, 5000) then
begin
writeln('BankScreen found');
result:= true;

break;
end;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

procedure Antiban;
begin
case Random(2300) of
0..1: begin; HoverSkill('cooking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
2..3: begin; HoverSkill('firemaking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
4: begin; HoverSkill('random', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); end;
5..7: RandomRClick;
8..10: PickUpMouse;
11..13: RandomMovement;
14..16: BoredHuman;
17: ExamineInv;
18..22: SleepAndMoveMouse(Random(5000));

end;
end;
Procedure FreeTheDtms;
begin
FreeDTM(Lobster);
end;
Procedure Bank;
var X, Y, P: Integer;
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
x := MSCX;
y := MSCY;
if not LoggedIn or FindNormalRandoms then
Exit;
Antiban;
// 5859188
//if FindObjTPA(X,Y, 2572631,5 ,1 ,20 ,20, 600, ['Open']) then
//if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
if FindShantayChest then
Mouse(X, Y, 3, 3, False);
WaitOption('Open', 500);

if PinScreen then
InPin(Players[CurrentPlayer].Pin);

if Bankscreen then
Wait(RandomRange(800, 1500));
if InvFull then DepositAll;
WithDraw(0,0,0);
Closebank;



end;

Procedure Startup;
begin

if not LoggedIn then
LoginPlayer;
If loggedIn then
debugln('Starting up');
MakeCompass('N');
GameTab(Tab_Inv);
SetAngle(SRL_ANGLE_HIGH);
end;
Procedure Mainloop;
Begin
repeat
If LoggedIn then
debugln('Performing the mainloop');
Startup;
Bank;
Cook;
until not LoggedIn
end;

begin
ClearDebug;
DeclarePlayers;
Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
SetUpSRL;
repeat
MainLoop;
until(AllPlayersInactive)
end.

P1ng

2012-06-05 09:21:31

- You have the procedure SetDTMs but then never call it in your script, if you are writing it without the use of the DTMs that's fine but in that case that bit of code as well as FreeTheDTMs is superfluous.

- Have a read of the CTS and ACA tutorials posted in here which should help you out with understanding the FindObjTPA parameters better.

- This is a function shared with my by another user on this forum for finding object like fires/npcs/fountains or almost anything else really..
function FindFountain(x, y: Integer): Boolean;

var
CTS, I: Integer;
MyTPA: TPointArray;
ATPA: array of TPointArray;

begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.21, 0.56); //Use ACA to find these
FindColorsSpiralTolerance(MSCX, MSCY, MyTPA, ColourGoesHere, MSX1, MSY1, MSX2, MSY2, ToleranceGoesHere); //Use ACA to find the colour and tolerance
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(MyTPA, 30, 30);

for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 0, 0);
if (WaitUpText('ountain',800)) then //Change UpText here to what you need
begin
Result := True;
GetMousePos(x, y);
Break;
end else
WriteLn('Fountain was not found'); //Failsafe line, maybe 'Fire was not found'?
end;
end;

That is quite an effective method if you use ACA appropriately and plug the appropriate colours, tolerances etc into that function and then try using that with
  Mouse(x, y, 5 , 5, False);
WaitOption('Fire', 500);
That might make finding the fire a bit more effective.

remco1337

2012-06-05 09:26:49

Mmhm didnt expected this to be this hard :S

P1ng

2012-06-05 09:34:00

I tested with some tuna I had laying around and it seems that the problem (so far) lies within the script's inability to find the colour you have used, I'd recommend that other function I posted with the help of ACA as that will make the colour-finding significantly more accurate which is where the script seems to be breaking down.

As a side note, for any if then statements I'd recommend putting
if Condition then
begin
DoThis;
end else
WriteLn('Why it didn''t do this');

it makes finding where/why the script didn't do what you asked it to much easier to locate.

remco1337

2012-06-05 09:35:08

Soz guys I think it's to tough to do it :S

remco1337

2012-06-05 09:56:02

I will stop working on this script until i am better in scripting now i will only make eazy scripts

P1ng

2012-06-05 10:01:25

Just hit the tutorial section really hard and test each function/procedure as you go. If you get really stuck post in the help section and almost everyone here is more than willing to help to the best of their ability

remco1337

2012-06-05 11:46:47

Now i got problem with my paint :


P1ng

2012-06-05 12:05:01

Add this line to the beginning of your on-screen progress report procedure -
SMART_ClearCanvas;