Log in

View Full Version : Drink a prayer potion



Justin
12-11-2011, 03:54 AM
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]
12-11-2011, 04:03 AM
FindObjCustom(x, y, ['rink'], [(put colors here)], 10);
Mouse(x, y, 5, 5, true);

Justin
12-11-2011, 06:12 AM
Doesn't seem to work... Just idles

RISK
12-11-2011, 06:24 AM
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
12-11-2011, 06:33 AM
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
12-11-2011, 06:34 AM
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
12-11-2011, 06:36 AM
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('78DA632C656160E86164400696FB7BC1344 C9' +
'4B112A8A617558DC5DE1E54357540357DA86ACCB7B5A1AA69 C2B44BA' +
'B3F0B554D2B504D17AA9A80EE725435A5986A2AB72EC65483 E666060' +
'626143500D6A61024');

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

FreeDTM(PrayerPot);
end;

YoHoJo
12-11-2011, 06:41 AM
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
12-11-2011, 07:09 AM
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
12-11-2011, 08:05 AM
Add another ";" at the end of that second 'end'.

Failure
12-11-2011, 08:31 AM
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
12-11-2011, 08:44 AM
You're sure you targeted Runescape?

Im using SMART


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

Okay ill give that a shot