View Full Version : Need help with making a script pick up
Ok so the goal for my script is to right click caskets, specifically pick up the casket, and then open them in the inventory. Here is what I have so far..pretty bad but it's my first script :x
procedure FightGiants;
var
x, y:Integer;
begin
if FindColorSpiralTolerance(x, y, 873071, 1, 0, 733, 464, 1) then
begin
MoveMouse(x,y);
Wait(1000);
ClickMouse(x, y, mouse_Right);
Wait(1000);
end;
end;
begin
FightGiants;
repeat
FightGiants;
until(false);
end.
Please teach me how to make it pick up a specific item..I can't use color because rune weapons have the same colors. Thank you very much.
Use FindColorsSpiralTolerance to get the TPA of the obj color, then filter out the points within ur character box, and splitting them following by ensuring the length of TPAs is within a suitable range, and finally using MiddleTPA to get the centre point, and you can achieve surprising accuracy ;)
Read more about TPAs here:
http://villavu.com/forum/forumdisplay.php?f=97
This may be too tough for you at this point of time but that's one of the most reliable way, else you have to ignore picking out obj until you learn more about advanced methods.
cause
09-04-2012, 02:00 AM
If this is your first script, lookup FindObj or FindObjCustom, those should work for your needs. (Check SRL manual)
Here is what I have..I found something to add but it still won't choose the pickup casket option..I can't figure out what to do!!
program FGiants;
{$i srl/srl.simba}
procedure FightGiants;
var
x, y:Integer;
begin
if FindColorSpiralTolerance(x, y, 873071, 1, 0, 511, 337, 5) then
begin
MoveMouse(x,y);
Wait(1000);
ClickMouse(x, y, mouse_Right);
Wait(1000);
ChooseOption('ake Mon');
end;
end;
begin
FightGiants;
repeat
FightGiants;
until(false);
end.
Any advice? Please help :duh:
If this is your first script, lookup FindObj or FindObjCustom, those should work for your needs. (Check SRL manual)
Won't that just find the object? It won't right click and pick up. That's the trouble I'm having here. I can't get it to pickup specifically the casket..
Tried this:
program FGiants;
{$i srl/srl.simba}
procedure FightGiants;
var
x, y:Integer;
begin
if FindColorSpiralTolerance(x, y, 873071, 1, 0, 511, 337, 5) then
begin
MoveMouse(x,y);
Wait(1000);
ClickMouse(x, y, mouse_Right);
if WaitUptextMulti(['ake Mon', 'ake Rare', 'ake Cas'], 600) then
begin
ClickMouse(x, y, mouse_Left);
end;
end;
begin
FightGiants;
repeat
FightGiants;
until(false);
end.
Not working..any thoughts?
Guess after it finds the "ake Mon" it would have to move the mouse to that x, y and then I can have it left click that option. Anyone have any ideas?
If this is for PS, fonts are different so anything involving text won't work. Also why do you right click then check uptext?
Solar
09-05-2012, 08:32 AM
I'm pretty sure the WaitOptionMulti function moves the mouse and clicks the option too, so you don't need to use ClickMouse after.
When you run this, what is actually happening, where does the script not work?
Edit: Just realised you use WaitUptextMulti and not WaitOptionMulti. Maybe you should try it out and see if it helps.
As riwu said though, neither will work with a PS.
WaitOption and WaitUptext both won't work?
Roflme
09-05-2012, 05:29 PM
If for PS, you'll have to use different functions.
If for RS, I'd HIGHLY suggest using TPAs.
Oh, and don't use MoveMouse. Use MMouse/Mouse/etc.
WaitOption and WaitUptext both won't work?
If it's a Private Server yes. Fonts don't match up with the current fonts on present RS so the functions wouldn't work.
Which functions should I use instead then? It's for a PS you just said other functions..so don't use TPA for a PS?
CephaXz
09-05-2012, 10:44 PM
DTMs for your options. I think it should work.
Which functions should I use instead then? It's for a PS you just said other functions..so don't use TPA for a PS?
uhm, TPA will work perfectly for PS if you know how to use them. Just that you cant do uptext check (unless you create ur own fonts). You can still do a 'color check' on the uptext that appears though. (so that you won't be clicking walls/empty ground)
Here's what I've got so far..
program FGiants;
{$i srl/srl.simba}
var
x, y: Integer;
PickupCasket, x1, y1: Integer;
procedure RightClickCasket;
begin
PickupCasket := DTMFromString('mbQAAAHicY2VgYBBlZGC4BqRvAHEAkO0LxA uBeDaUXgrEc4H4/wQHhtgQd4b///9DaCCfH6gHHTNiwWAAAMeUDmg=');
if FindColorSpiralTolerance(x, y, 610410, 1, 0, 511, 337, 5) or
FindColorSpiralTolerance(x, y, 1208211, 1, 0, 511, 337, 5) or
FindColorSpiralTolerance(x, y, 1206669, 1, 0, 511, 337, 5) or
FindColorSpiralTolerance(x, y, 11313312, 1, 0, 511, 337, 5) then
begin
Wait(500)
MoveMouse(x, y);
Wait(1000);
ClickMouse(x, y, mouse_Right);
end;
end;
procedure LeftClickCasket;
begin
if FindDTM(PickupCasket, x1, y1, 1, 0, 511, 337) then
begin
MoveMouse(x1, y1);
Wait(400);
ClickMouse(x1, y1, mouse_Left);
end else
begin
MoveMouse(1, 0);
repeat
RightClickCasket;
LeftClickCasket;
until(false);
end;
FreeDTM(PickupCasket);
end;
begin
RightClickCasket;
repeat
RightClickCasket;
LeftClickCasket;
until(false);
end.
Works just needs fine tuning. Right now it currently isn't left clicking again but if it accidentally misses the casket it does reset itself. I'm probably making this way too hard on myself but I have school in the am so it'll have to wait until tomorrow.
CephaXz
09-06-2012, 12:50 AM
x, y, Casket, x1, y1, PickupCasket :Integer;
if FindDTM(Casket, x, y, 1, 0, 511, 337) then
Make line 8 this (see the colon?) -
x, y, Casket: Integer;
Also, TPAs will work find on an RSPS, but they are quite difficult for beginners to wrap their head around.
Try FindObj and then make a DTM/countcolor of the UpText and then a DTM for the option to pick it up.
I couldn't find anything on "FindObj" doesn't the font need to be the same to FindObj? Or is it not found by name?
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.