Well, I'm trying to modify a script, so it remains at the same spot, and if it accidently moves, it should move back to that spot, how would one go about coding that?
Well, I'm trying to modify a script, so it remains at the same spot, and if it accidently moves, it should move back to that spot, how would one go about coding that?
Well, first and foremost you'll want to make a function that can identify the spot, and whether you are in it / close to it. That can usually be done with a DTM, and you can then define whether you are in the safespot by distance to the main point.
After that, you'll want to make another procedure that moves you to the safespot if you aren't in it.
Then you'll want to call these functions in your fighting loop, such as
if not InSafeSpot then Relocate;
if HP_Percent < 100 then if not InSafeSpot then Relocate
that should be about enough
-RM
Can you show us picture if minimap and identify the safespot?
Basically you should make a ddtm (read tutorial about them) with thr main point being the safespot. Would be a bit hard, but fun, to make it. If the spot is literally one tile it's kind of hard to click exactly specifically one tile but still possible.
As for knowing when to recalibrate (when to walk to it) I'd assume you don't get hit at it, so I would have a check for HP bar above your head, if it's there you're not in spot and need to click the ddtm.
i used a dtm and used rotated dtm to walk to safe spot
The white outline is the places he should aim to be in.
And the blue on the minimap is the place he sometimes ends. It has nothing to do with the script walking off or anything. But sometimes when he attack one of the ogres, and it's blocked or something, he will run to the back of the cage.
Oh I see. Hmm maybe solve that when searching for ogres fund the closest one to players first that way they are always in range.
As for detecting when to move back, move up to the bad spot on purpose and see if anything in the minimap exists only when you're up there. Then script can sear for it, if found, move down.
Or other way around look for something on minimap when you're in proper spot and not visible when you move up. Then search for lack of it, and move down if not found.
Well, when he's behind the ogres, he can see another building on his minimap, that could be the trigger for "being stuck"
And getting to the right spot could be clicking between the 2 white lines on minimap (The part where you enter, it looks unique on the minpmap) Then he'd be somewhat In position I guess..
Since the other 2 mod+ guys posting here didn't catch it I'll go ahead and move you thread to the correct section. For future reference please post for help in the Scripting help section.![]()
"Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."
http://villavu.com/forum/showthread.php?t=68112
this is exactly what you need to solve your problem.
You kinda have to figure it out as you go, there isn't a tutorial for it yet. this is the code I use when creating an objectDTM:
Simba Code:program objectdtmer;
{$DEFINE SMART}
{$DEFINE PAINT}
{$i srl/srl.scar}
{$i SRL\SRL\MISC\Paintsmart.scar}
{$i ObjectDTM\ObjDTMInclude.simba}
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'asdf';
Players[0].Pass := 'asdf';
Players[0].Nick := 'asdf';
Players[0].Pin := '';
Players[0].Active := true;
end;
procedure paintupobjects; //paints on smart objects on minimap
begin
ObjectDebug(1);
end;
begin
smart_server := 1;
smart_members := false;
smart_signed := true;
smart_superDetail := false;
clearDebug();
setupSRL();
DeclarePlayers;
if not LoggedIn then LogInPlayer;
wait(1000);
ObjDTM_Setup;
MakeCompass('n');
paintupobjects;
wait(1000);
GenerateObjDTM([MM_TREE, MM_TREE, MM_TREE], 630, 121, True, True);
end.
Also if you use his Lumbridge walker file, along with reading his very accurate and helpful documentation within the include itself, you should be able to figure it out.
There are currently 1 users browsing this thread. (0 members and 1 guests)