SRL Archive - Help

Drink a prayer potion


Justin

2011-12-10 22:54:15

Hey
What would be the best way for a script to drink a prayer potion dose (4),(3),(2),(1) in any order.

If you could also provide me with an example that would be awesome

Thanks

[XoL]

2011-12-10 23:03:13

FindObjCustom(x, y, ['rink'], [(put colors here)], 10);
Mouse(x, y, 5, 5, true);

Justin

2011-12-11 01:12:31

Doesn't seem to work… Just idles

RISK

2011-12-11 01:24:30

Make a DTM of the potion and do this:
procedure Example;
var
DTM_Name, X, Y : Integer;
begin
DTM_Name := DTMFromString('');

if FindDTM(DTM_Name, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
FreeDTM(DTM_Name);
MMouse(X, Y, 2, 2);
end;

FreeDTM(DTM_Name);
end;

YoHoJo

2011-12-11 01:33:43

I'd also make a DTM.
Make it based on a (1) Dose potion, and make the parent point very low on the item (but still on the potion blue color itself) that way one dtm will work for all 4 doses.
Video Tutorial I made about DTMs here:
http://www.youtube.com/watch?v=SlS4q9MiFX4
Picture/Text tutorial here:
http://villavu.com/forum/showthread.php?t=564

YoHoJo

2011-12-11 01:34:24

From: ~Justin
Doesn't seem to work… Just idles


Findobj should work just fine assuming you picked good colors and add enough tolerance do it. Show us your findobj line please if you will.

Justin

2011-12-11 01:36:06

From: RISK
Make a DTM of the potion and do this:
procedure Example;
var
DTM_Name, X, Y : Integer;
begin
DTM_Name := DTMFromString('');

if FindDTM(DTM_Name, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
FreeDTM(DTM_Name);
MMouse(X, Y, 2, 2);
end;

FreeDTM(DTM_Name);
end;



Still unable to get it to work :S



procedure DrinkPrayerPotion;
var
DTM_Name, X, Y : Integer;


begin
PrayerPot := DTMFromString('78DA632C656160E86164400696FB7BC1344C9' +
'4B112A8A617558DC5DE1E54357540357DA86ACCB7B5A1AA69C2B44BA' +
'B3F0B554D2B504D17AA9A80EE725435A5986A2AB72EC65483E666060' +
'626143500D6A61024');

if FindDTM(PrayerPot, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(X, Y, 2, 2, true);
end;

FreeDTM(PrayerPot);
end;

YoHoJo

2011-12-11 01:41:06

If that is not working, then you made your DTM incorrectly.

Parent point should be where you want to click the object, and have a tolerance of about 30-50.
All of the other points you make should be along the black outline of the item and all be the same color, and have 0 tolerance.

Justin

2011-12-11 02:09:50

This is doing my head in..


Procedure CheckPrayer;
Var
xi, yi: integer;
begin
if(GetPrayerPoints < 503) then
begin
WriteLn('We are low in prayer... drinking a potion!');
FindObj(x,y,'rink',7971378,20)
Mouse(x, y, 3, 3, true);
end
end;

mouse just hovers above the gameclient

RISK

2011-12-11 03:05:06

Add another ";" at the end of that second 'end'.

Failure

2011-12-11 03:31:45

From: ~Justin
This is doing my head in..


Procedure CheckPrayer;
Var
xi, yi: integer;
begin
if(GetPrayerPoints < 503) then
begin
WriteLn('We are low in prayer... drinking a potion!');
FindObj(x,y,'rink',7971378,20)
Mouse(x, y, 3, 3, true);
end
end;

mouse just hovers above the gameclient


You're sure you targeted Runescape?

Justin

2011-12-11 03:44:32

From: Failure
You're sure you targeted Runescape?


Im using SMART

From: RISK
Add another ";" at the end of that second 'end'.


Okay ill give that a shot