Whats the most effecient way of finding an npc and clicking on them? I couldn't find any functions in the Srl manual specificly for it, and findobject doesn't work well.. Any ideas?
Whats the most effecient way of finding an npc and clicking on them? I couldn't find any functions in the Srl manual specificly for it, and findobject doesn't work well.. Any ideas?
I've often run into the same problem.
My advice: Make your own. Then you'll know exactly how it works, and you'll be able to fix it should anything stop working
Interested in C# and Electrical Engineering? This might interest you.
Use the one By Jason, its in utilities i think, but if not, i could send you a copy later, this comp doesnt have scar, and the one that does is using LAME right now, but try to find the one by jason, it works pretty well for me
SCAR Code:procedure NPCFinderTol(NPCColor, NPCColor2, Tol: Integer; Name: String); //Procedure by Jason2gs. Heavily modded by Smartzkid.
var
Tries, Resets, fx, fy, cx, cy:integer;
begin
repeat
if(FindColorSpiralTolerance(fx, fy, NPCColor, MSX1, MSY1, MSX2, MSY2, Tol))then
if(FindColorCircleTolerance(cx,cy,NPCColor2,100,fx,fy,tol))then
MMouse(fx, fy, 1, 1);
Tries := Tries + 1;
if(Tries >= 5)then
begin
KeyDown(37);
Wait(700 + Random(700));
KeyUp(37);
Tries := 0;
Resets := Resets + 1;
end;
wait(20+random(500));
until(IsUpText(Name)) or (Resets>10)
if(Resets>10)then
begin
result:=false;
end else
begin
Mouse(x, y, 0, 0, False);
result:=ChooseOption(x, y, 'Talk');
end;
end;
Try that.
If you want it to do something other than talk to the npc, change the third line up from 'Talk' to whatever you want it to do
Interested in C# and Electrical Engineering? This might interest you.
thats one thing that everyone will have trouble with including me and thats the main reason why my script hasnt been updated for a while
why, what's so bad about it?
Thick As Blood
Well, jason's proc works all the time for me,, unless it chooses the keeper and someone else is standing on them and it trades that person, so i made a bitmap of the trade option, a few letters, and used that instead of choosoption but other than that, it works great...
I remade his, so it has failsafes, will search for 2 of the NPC's colors (more accurate), and so it won't stop your whole script if the NPC cannot be found (example: you die, your script doesn't realize it. Jason's procedure will just continue to search for the color)
Interested in C# and Electrical Engineering? This might interest you.
lol SmartzKid, why arent you a SRL Member yet?
You know so much about scripting you could easily get in.
Anyway, finding NPCs aye...
Well I would use a FindObject function, look through in object.scar to find one that suites ur needs.
Then I would add failsafes with GetMousePos and IsUpText.
Ill throw something together for you tonight cause right now im at school and the computers dont have SCAR![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)