shadowmarkus
2011-12-25 16:11:07
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?
2011-12-25 16:11:07
2011-12-25 16:27:56
2011-12-25 16:31:33
From: Sir R. M8gic1an
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
2011-12-25 16:32:57
2011-12-25 16:36:21
From: Sir R. M8gic1an
post a pic ;)
-RM
2011-12-25 16:36:44
2011-12-25 16:38:37
From: YoHoJo
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.
2011-12-25 16:38:44
2011-12-25 16:43:36

2011-12-25 16:49:47
2011-12-25 16:57:07
From: YoHoJo
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.
2011-12-25 17:00:38
2011-12-25 17:01:10
From: BraK
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. ;)
2011-12-25 18:04:42
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.