SRL Archive - OSR Help

DTM help!


BigRedJapan

2012-05-31 22:35:44

Procedure FindLantern;

Var
X, Y, LanternDTM, 1:Integer;
SlotBox:Tbox;

Begin
LanternDTM := DTMFromString('mrAAAAHic42BgYHBmYmBwAmIvIPYGYg8gtgJiCyj9HKjmBhDfA+JXQPwRil8C8UMgdopZAiSZ4FhaSoqBmUsKzv/FgB8wEsAwAACuKwwe');

Begin
FindNormalRandoms;
SlotBox:=InvBox(1);
If FindDTM(LanternDtm, X, Y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(1 ,2);
ChooseOption('Use');
End;
End;
End;

kk! really need someone to tell me what im doing wrong!

x[Warrior]x3500

2012-05-31 22:41:03

try this:

Procedure FindLantern;
Var
X, Y, LanternDTM:Integer;
SlotBox:Tbox;
Begin
FindNormalRandoms;
LanternDTM := DTMFromString('mrAAAAHic42BgYHBmYmBwAmIvIPYGYg8gtgJiCyj9HKjmBhDfA+JXQPwRil8C8UMgdopZAiSZ4FhaSoqBmUsKzv/FgB8wEsAwAACuKwwe');

If FindDTM(LanternDtm, X, Y, MIX1, MIY1, MIX2, MIY2) Then
Begin
writeln('found DTM');
Mouse(x,y,3,3,mouse_right);
wait(200+random(200));
ChooseOption('Use');
End else
writeln('did not find DTM');
freeDTM(LanternDTM);
End;

wat does it say in the debug

BigRedJapan

2012-05-31 22:45:50

[Error] (166:20): Identifier expected at line 165
[Hint] (166:2): Variable '1' never used at line 165
Compiled successfully in 1123 ms.

x[Warrior]x3500

2012-05-31 22:50:01

lol like a few secs after i posted that, i found that error
i already edited the code above. use that code

riwu

2012-05-31 22:52:00

SlotBox:=InvBox(1);
So ur lantern is in the first inventory slot?
Then why not just use InvMouse(1,2)?
then maybe do a waituptext check to be safe.

BigRedJapan

2012-05-31 22:59:15

Thanks to Warrior it works!

But for some reason after it uses the lamp it stops the script!

Heres the code that follows!
Procedure FindLantern;
Var
X, Y, LanternDTM:Integer;
SlotBox:Tbox;
Begin
FindNormalRandoms;
LanternDTM := DTMFromString('mrAAAAHic42BgYHBmYmBwAmIvIPYGYg8gtgJiCyj9HKjmBhDfA+JXQPwRil8C8UMgdopZAiSZ4FhaSoqBmUsKzv/FgB8wEsAwAACuKwwe');

If FindDTM(LanternDtm, X, Y, MIX1, MIY1, MIX2, MIY2) Then
Begin
writeln('found DTM');
Mouse(x,y,3,3,mouse_right);
wait(200+random(200));
ChooseOption('Use');
End else
writeln('did not find DTM');
freeDTM(LanternDTM);
End;

Procedure UseonLight;

Var
gX, gY: Integer;

Begin
Wait(1000);
if FindColorSpiralTolerance(gX, gY, 8871996, 113, 3, 340, 89, 25)Then
Begin
WriteLn('Found Light');
Wait(500);
MMouse(gX,gY,5,5);
wait(RandomRange(1000,2000));
ClickMouse2(False);
Wait(RandomRange(1000,1500));
WaitOption('se Sap', 500);
end;
end;

CephaXz

2012-05-31 23:00:41

If debug doesn't say Found Light, that means it couldn't find the color you're using.

BigRedJapan

2012-05-31 23:01:35

its so hard to get a color on these things!

CephaXz

2012-05-31 23:02:38

Use TPA, and color finding using ACA with CTS2.

x[Warrior]x3500

2012-05-31 23:03:46

1. i want to assume you are, but are your calling useOnLight(); right after FindLantern(); in your main loop.

2. in the debug (after you run it) do you see "Found Light"


edit: lol so slow at typing. i type a message, and little do i know, 4 messages already were made since i started typing.

edit2: here is a link to the most recent ACA: http://villavu.com/forum/showpost.php?p=1001517&postcount=49

BigRedJapan

2012-05-31 23:08:49

Compiled successfully in 1092 ms.
SRL Compiled in 16 msec
Found Light
Successfully executed.

thats what i get!
but it its to slow at right clicking on them!

x[Warrior]x3500

2012-05-31 23:10:03

From: Rules of Joe
Compiled successfully in 1092 ms.
SRL Compiled in 16 msec
Found Light
Successfully executed.

thats what i get!
but it its to slow at right clicking on them!



wait(RandomRange(1000,2000));
ClickMouse2(False);
Wait(RandomRange(1000,1500));


well duh its slow :P ur waiting 1-2 seconds before and after your click

lilcmp1

2012-05-31 23:11:56

Your code also include setupsrl; correct? Without it your mouse speed will be slow :P

CephaXz

2012-05-31 23:12:42

Can be shorten and make it faster.

    WriteLn('Found Light');
Mouse(gX, gY, 5, 5, mouse_Right);
WaitOption('se Sap', 2000);

BigRedJapan

2012-05-31 23:18:02

From: CephaXz
Can be shorten and make it faster.

    WriteLn('Found Light');
Mouse(gX, gY, 5, 5, mouse_Right);
WaitOption('se Sap', 2000);


Thanks that did help!

but the problem was in the Box that it was looking for the Light in! was to small!
and how can i make it so that if it fails to repeat it self@

CephaXz

2012-05-31 23:22:11

You're finding the light on the main screen? If so then use

FindColorSpiralTolerance(gX, gY, 8871996, MSX1, MSY1, MSX2, MSY2, 25)

MS stands for Main Screen.

Post a picture of the light here, I'll see what could be done with a finding function.
EDIT: Maybe some other time lol, gonna sleep now.

riwu

2012-05-31 23:23:17

From: Rules of Joe
Thanks that did help!

but the problem was in the Box that it was looking for the Light in! was to small!
and how can i make it so that if it fails to repeat it self@

well then make the box bigger to ensure the light is within the box?
for repeating, either use a repeat/while loop:
while not FindDTM(blabla) do wait(100);
or
WaitFindDTM(blabla);

BigRedJapan

2012-05-31 23:37:24

The light creature is not a DTM so im fucked and cant not make it into a DTM!

riwu

2012-05-31 23:43:42

are u talking about those floating blue thing in the tear of guthix cavern? Can u post a pic of it?

BigRedJapan

2012-05-31 23:56:48


Script is taking me a While Cuz its a quest Script! and its my First Script With Simba!

Syntax

2012-06-01 10:57:50

Did you get it to work?

CephaXz

2012-06-01 12:03:23

I believe DTM can be used on anything. But in your case its not that efficient to use it here.

Is that blue thing in your screen the light that you wanted to use your lantern on?

BigRedJapan

2012-06-03 18:46:50

Yes