SRL Archive - OSR Help

Soulsplit auto attack


darker2k

2013-06-22 16:08:32

None

darker2k

2013-06-22 17:24:14

None

Nebula

2013-06-22 17:28:56

DTMs aren't reliable for clicking monsters, because the monster is constantly moving.

1) you only waited ONE hour for a reply
2)how is that trolling
3)that doesn't make this the worst forum ever
4)go away

darker2k

2013-06-22 17:35:51

None

Chris

2013-06-22 17:41:52

ACA + ATPA's = magic

Ian

2013-06-22 17:46:37

From: darker2k
Thanks for nothing Trolls -.- worst forum ever :f:


You keep using that word, I'm not sure it means what you think it means.

Now that that's out of the way, I have a suggestion for your code. Format it properly, this makes it easier for everyone to read, thus making us less likely to help. So currently you have

procedure FindCorp;
var
corp, x, y:integer;
Begin
corp := DTMFromString('mggAAAHicY2NgYFjDyMDQBMS3gbgXiHcDcQcQcwDxNqC8IpCWAOLXDBBcmhnG4OVszhAb7MIwsTmHoSA1iMHDwZQBF2DEgSEAAGeADQw=');

If FindDTM(corp, x, y, MSX1, MSY1, MSX2, MSY2) Then
Begin
Mmouse(x, y, 5, 5);
Mouse(x, y, 0, 0, False);
ChooseOption('Attac');
FreeDTM(corp);
end;
end;
Formatted properly, it would be

procedure FindCorp;
var
corp, x, y:Integer;
begin
corp := DTMFromString('mggAAAHicY2NgYFjDyMDQBMS3gbgXiHcDcQcQcwDxNqC8IpCWAOLXDBBcmhnG4OVszhAb7MIwsTmHoSA1iMHDwZQBF2DEgSEAAGeADQw=');

if FindDTM(corp, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x, y, 5, 5);
Mouse(x, y, 0, 0, False);
ChooseOption('Attac');
FreeDTM(corp);
end;
end;

Now that it's easier to read, I will make suggestions about the procedure itself.

If you make corp into a global variable and call it at the beginning of your script and free it at the end, then you will only have to call it once. This also allows you to use your DTM freeing procedure with AddOnTerminate, which will prevent it from being left unfreed if the script stops for any reason. Also your procedure loads the DTM, but if it can't find the DTM on the screen it will exit the procedure without freeing it.

I notice that you use MMouse, and then after use Mouse. As it is, your procedure will move the mouse to the DTM, then move it to the DTM again and click. Instead of Mouse, click using
ClickMouse2(False);

Also, your procedure does not do anything if it can't find the DTM. I suggest using
end else

Example of how to use end else:

begin
if FindDTM(DTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x, y, 5, 5);
ClickMouse2(False);
ChooseOption('Attac');
WriteLn('We found the DTM and clicked it!');
end else
begin
WriteLn('We could not find the DTM, rotating compass');
MakeCompass('rand'); //Not sure if this works on SS, I have never played it.
end;
end;

darker2k

2013-06-22 17:48:18

None

Ian

2013-06-22 17:51:37

From: darker2k
Could you please tell me what ''ATPA'' is plz? i Know ACA is a color picker tool but never heard of ATPA :)


ATPA means Array of TPoint Array. There's a tut here that explains them, I found it useful :)

You may want to read his earlier TPA tut first though, it's here

Chris

2013-06-22 17:55:06

Another thing:
    ChooseOption('Attac');

I dont think that procedure will also work on SS, but I've never played it so it might aswell surprise me.
Are you using the modern or oldskool cache?

darker2k

2013-06-22 18:00:38

None

darker2k

2013-06-22 18:02:57

None

Ian

2013-06-22 18:12:30

From: darker2k
[ATTACH=CONFIG]21776[/ ATTACH]


Sorry I meant ClickMouse2(False);

Chris

2013-06-22 18:18:43

[ATTACH=CONFIG]21777[/ATTACH]
That's me at corp. : /
Please tell me what settings you're using and what corp you're at, because I'm bored and in a good mood :)