SRL Archive - Help

Includes not working properly


rj

2012-12-31 11:21:13

I am making my own include for soulsplit and Flight wrote me one that worked great , which looked like:
{$include SoulSplit/Combat/HpBar.simba}   //An example of correctly including a .simba file

Const
SS_IX1 = 558;
SS_IY1 = 205;
SS_IX2 = 738;
SS_IY2 = 462;
SS_WSX1 = 0;
SS_WSY1 = 0;
SS_WSX2 = 761;
SS_WSY2 = 501;
SS_MSX1 = 4;
SS_MSY1 = 4;
SS_MSX2 = 520;
SS_MSY2 = 338;
SS_MMX = 627;
SS_MMY = 268;
SS_MMX2 = 842;
SS_MMY2 = 426;

Var
Cook_Shark, Cook_RockTail, Cook_Manta,
Raw_Shark, Raw_RockTail, Raw_Manta: Integer;

Procedure SI_SetDTMs;
begin
Cook_Shark := DTMFromString('mlwAAAHicY2dgYPjBxMDwCYjfA/FnIP4NxAzMDAz/gDQXEAsDMR8QswMxKxDzALEAEGcFWTPUpocwLO8sZJhek8bQkBHGMLshk2HP7AYGTqARuDAjHgwFAE19EGU=');
Cook_RockTail := DTMFromString('mggAAAHicY2NgYDjPxMBwEYivAvE1ID4NxCeAmAuIhYGYF4jZoHwBINYTYWDoystnmFfXwBBoy8lgrcPA4G7KycAJNAsbZsSBIQAAra8KSw==');
Cook_Manta := DTMFromString('mlwAAAHicY2dgYFjGxMAwB4gXA/EaKF4CxPOBmBuI2YCYGYg5gVgAikHiecG2DDXxbgzp/lYM/rY6DOFOBgxZQdYMLaleDJxAc3FhRjwYCgCpqQvs');

Raw_Shark := DTMFromString('mrAAAAHic42BgYDjLxMBwGoiPA/ExID4FxJeB+AIQXwPip4wMDG+A+C0QPwfih0D8CIhfQsVm9PYwFGRkMOSlpTHUlpSAaRC/va6WYVpPNwMn0A58mJEAhgEAVzIZUA==');
Raw_RockTail := DTMFromString('mlwAAAHicY2dgYPjJxMDwA4j/QTGI/xmKXzEyMDwC4qdA/BKIPwHxOyhbT0Wewd5UhUFDXpDBO86bYfWJNQxa8lIMhfH2DJxAc3FhRjwYCgAdQxN4');
Raw_Manta := DTMFromString('mQwAAAHicY2ZgYDjLxMBwFYhPA7EOEBsAsSkQZxcvYPAPLmVIzpjMIAJUB8OMSBgIADjtB0A=');
end;

Procedure FreeSI;
begin
FreeDTM(Cook_Shark);
FreeDTM(Cook_RockTail);
FreeDTM(Cook_Manta);
FreeDTM(Raw_Shark);
FreeDTM(Raw_RockTail);
FreeDTM(Raw_Manta);
end;

Procedure SetupSoulInclude;
begin
AddOnTerminate('FreeSI');
SI_SetDTMs;
Writeln('SoulInclude setup');
end;

Worked perfectly when i did this script to test it:
Program Test;
{$i srl/srl.simba}
{$i SoulSplit/SoulInclude.Simba}
Procedure ClickManta;
var
x,y: integer;
begin
if FindDTM(Raw_Manta, x, y, SS_IX1, SS_IY1, SS_IX2, SS_IY2) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(150, 250));
ClickMouse2(mouse_left);
end else
Writeln('DTM not found!');
end;

Begin
MouseSpeed := 15;
SetupSoulInclude;
ClickManta;
end.




But now I want to define the DTM's in separate simba files to that one file isn't so clustered for future projects, So I made this soul include look like this:
{$include SoulSplit/Combat/HpBar.simba}
{$include SoulSplit/Skills/Fishing.simba} //An example of correctly including a .simba file

Const
SS_IX1 = 558;
SS_IY1 = 205;
SS_IX2 = 738;
SS_IY2 = 462;
SS_WSX1 = 0;
SS_WSY1 = 0;
SS_WSX2 = 761;
SS_WSY2 = 501;
SS_MSX1 = 4;
SS_MSY1 = 4;
SS_MSX2 = 520;
SS_MSY2 = 338;
SS_MMX = 627;
SS_MMY = 268;
SS_MMX2 = 842;
SS_MMY2 = 426;

begin
end.

The Second like calls the fishing file which is:
Var
Cook_Shark, Cook_RockTail, Cook_Manta,
Raw_Shark, Raw_RockTail, Raw_Manta: Integer;

Procedure SI_SetDTMs;
begin
Cook_Shark := DTMFromString('mlwAAAHicY2dgYPjBxMDwCYjfA/FnIP4NxAzMDAz/gDQXEAsDMR8QswMxKxDzALEAEGcFWTPUpocwLO8sZJhek8bQkBHGMLshk2HP7AYGTqARuDAjHgwFAE19EGU=');
Cook_RockTail := DTMFromString('mggAAAHicY2NgYDjPxMBwEYivAvE1ID4NxCeAmAuIhYGYF4jZoHwBINYTYWDoystnmFfXwBBoy8lgrcPA4G7KycAJNAsbZsSBIQAAra8KSw==');
Cook_Manta := DTMFromString('mlwAAAHicY2dgYFjGxMAwB4gXA/EaKF4CxPOBmBuI2YCYGYg5gVgAikHiecG2DDXxbgzp/lYM/rY6DOFOBgxZQdYMLaleDJxAc3FhRjwYCgCpqQvs');

Raw_Shark := DTMFromString('mrAAAAHic42BgYDjLxMBwGoiPA/ExID4FxJeB+AIQXwPip4wMDG+A+C0QPwfih0D8CIhfQsVm9PYwFGRkMOSlpTHUlpSAaRC/va6WYVpPNwMn0A58mJEAhgEAVzIZUA==');
Raw_RockTail := DTMFromString('mlwAAAHicY2dgYPjJxMDwA4j/QTGI/xmKXzEyMDwC4qdA/BKIPwHxOyhbT0Wewd5UhUFDXpDBO86bYfWJNQxa8lIMhfH2DJxAc3FhRjwYCgAdQxN4');
Raw_Manta := DTMFromString('mQwAAAHicY2ZgYDjLxMBwFYhPA7EOEBsAsSkQZxcvYPAPLmVIzpjMIAJUB8OMSBgIADjtB0A=');
end;

Procedure FreeSI;
begin
FreeDTM(Cook_Shark);
FreeDTM(Cook_RockTail);
FreeDTM(Cook_Manta);
FreeDTM(Raw_Shark);
FreeDTM(Raw_RockTail);
FreeDTM(Raw_Manta);
end;

Procedure SetupSoulInclude;
begin
AddOnTerminate('FreeSI');
SI_SetDTMs;
Writeln('SoulInclude setup');
end;
The mouse does not move or anything not sure what I am doing wrong.

The Killer

2012-12-31 12:08:26

SetupSrl; ?
also, what happens? litterally nothing? or is stuff being debugged?

rj

2012-12-31 12:14:12

From: The Killer
SetupSrl; ?
also, what happens? litterally nothing? or is stuff being debugged?


Litterally nothing

rj

2012-12-31 13:32:51

Just need to know how to call other files lol

masterBB

2012-12-31 13:34:35

Don't add:


begin
end.

the . is the end of the script.

rj

2012-12-31 13:36:32

From: masterBB
Don't add:


begin
end.

the . is the end of the script.


nvm got it thanks!


Going to start writing mah soulsplit include now

masterBB

2012-12-31 13:39:28

Basically what including does is pasting the file you include inside your script. Since there can only be one main loop, the begin..end. loop only can be added once. When it is called in an include, it will just stop interpreting the script there. And thus, never reaching your code you have below the include.

rj

2012-12-31 13:43:32

From: masterBB
Basically what including does is pasting the file you include inside your script. Since there can only be one main loop, the begin..end. loop only can be added once. When it is called in an include, it will just stop interpreting the script there. And thus, never reaching your code you have below the include.


nvm got it now having a different problem sec going to attempt to figure it out

Flight

2012-12-31 13:49:48

From: masterBB
Don't add:


begin
end.

the . is the end of the script.


Yes exactly. rjj95, this is the reason why I removed them from each and every one of your included files. "Being" and "End." are for the script itself, these are not needed in any included file.

rj

2012-12-31 13:56:24

From: Flight
Yes exactly. rjj95, this is the reason why I removed them from each and every one of your included files. "Being" and "End." are for the script itself, these are not needed in any included file.


I got the fishing include to work correctly but whenever i want it to click a cooked piece of food it does not work.. Example:

I have the code to try to click the cooked manta
Program Test;
{$i srl/srl.simba}
{$include SoulSplit/SoulInclude.simba}
Procedure ClickManta;
var
x,y: integer;
begin
if FindDTM(Cook_Manta, x, y, SS_IX1, SS_IY1, SS_IX2, SS_IY2) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(150, 250));
ClickMouse2(mouse_left);
end else
Writeln('DTM not found!');
end;

Begin
MouseSpeed := 15;
SetupSoulInclude;
ClickManta;
end.

When I run it, it always clicks a raw shark, Even if I put Cook_shark or Cook_RockTail it ALWAYS clicks the raw shark.

At the top of my soul include i include the fishing and cooking includes:

{$include SoulSplit/Combat/HpBar.simba}
{$include SoulSplit/Skills/Cooking.simba}
{$include SoulSplit/Skills/Fishing.simba}

But it seems to only be able to click raw food, selecting any cooked food it clicks the raw shark

Dynamite

2012-12-31 14:01:54

From: rjj95
I got the fishing include to work correctly but whenever i want it to click a cooked piece of food it does not work.. Example:

I have the code to try to click the cooked manta
Program Test;
{$i srl/srl.simba}
{$include SoulSplit/SoulInclude.simba}
Procedure ClickManta;
var
x,y: integer;
begin
if FindDTM(Cook_Manta, x, y, SS_IX1, SS_IY1, SS_IX2, SS_IY2) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(150, 250));
ClickMouse2(mouse_left);
end else
Writeln('DTM not found!');
end;

Begin
MouseSpeed := 15;
SetupSoulInclude;
ClickManta;
end.

When I run it, it always clicks a raw shark, Even if I put Cook_shark or Cook_RockTail it ALWAYS clicks the raw shark.

At the top of my soul include i include the fishing and cooking includes:

{$include SoulSplit/Combat/HpBar.simba}
{$include SoulSplit/Skills/Cooking.simba}
{$include SoulSplit/Skills/Fishing.simba}

But it seems to only be able to click raw food, selecting any cooked food it clicks the raw shark


Your DTM's are probably wrong then.

-Boom

rj

2012-12-31 14:02:41

From: Dynamite
Your DTM's are probably wrong then.

-Boom


They are not, if they are wrong it would not be clicking on the raw shark. I clicked showed matching DTM's and it showed only the cooked food so I did those correctly

Brandon

2012-12-31 14:16:55

From: rjj95
They are not, if they are wrong it would not be clicking on the raw shark. I clicked showed matching DTM's and it showed only the cooked food so I did those correctly


In your script add ActivateClient and don't forget to select the target. I don't see anything wrong with the include..

Try doing FindDTMs instead and iterate the PointArray for a list of all DTM's found to be matching.

rj

2012-12-31 14:17:33

From: Brandon
In your script add ActivateClient and don't forget to select the target. I don't see anything wrong with the include..

Try doing FindDTMs instead and iterate the PointArray for a list of all DTM's found to be matching.


EDIT i added activate cleint and it did not produce different results