SRL Archive - OSR Help

Won't do anything (Wielding item with DTM)


iimhere

2012-01-05 09:44:15

Im trying to learn scripting and am trying to get the script to equip hatchet using DTM, it won't do anything and will give Successfully executed.

Code

program Chopper;
{$i SRL\SRL.scar}
var
x,y, Hatchet:integer;
begin
ClearDebug;
SetupSRL;
Hatchet:= DTMFromString('mbQAAAHicY2VgYLBiYmBwBmIHILYDYgsgfgsUvwHFd4H4AxDnBwowFIcIMMQ68zKE2fMw+FpwM2ADjFgwGAAAmHwJNw==');
if FindDTM(Hatchet,x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 4, 4, False);
ChooseOption ('ield');
Writeln ('Found Hatchet in inventory, wielding it');
end;
FreeDTM(Hatchet)
end.

Jhangir

2012-01-05 10:00:57

First of all I suggest you go the beginner tutorial section and learn from there. Your script doesent even star the right way and you dont even have a main loop. You need to learn to crawl before you walk.

Kyle Undefined

2012-01-05 11:18:37

From: Jhangir
First of all I suggest you go the beginner tutorial section and learn from there. Your script doesent even star the right way and you dont even have a main loop. You need to learn to crawl before you walk.


His script is fine, what are you talking about?

I would suggest making sure the DTM is correct.

cause

2012-01-05 13:10:19

Jhangir what are you on about?
@iimhere, did you use the DTM editor to make the DTM? Make sure you select a center point first off, and that your edge points are all black points around the outline. Also, did you change your DTM tolerance? I change my to 50, however 20 or 30 works as well I hear.
You can check if your DTM works by clicking on:

"Show Matching DTMs"