SRL Archive - OSR Help

Coordinates Command ?


exo89

2013-05-11 13:27:14

hey guys, was stuck trying to edit a script and was having issues with obtaining a coordinates command.

So basically what I want to do is something along the lines of the following:


//If Coordinates(xx,yy) return false Then
//go to coordinates(xx,yy)

simple command but was having trouble finding the command. Any insight is greatly appreciated :)

rj

2013-05-11 14:29:14

What do you mean coordinates? Like SPS?

exo89

2013-05-11 19:03:33

From: Officer Barbrady
What do you mean coordinates? Like SPS?


Ok, so if I wanted to edit my fight caves script after the update because it was getting stuck at the very beginning after clicking on the cave. I would need to add an IF statement to detect if it was stuck at the very beginning after clicking the cave entrance.

something like:
//If location(false) Then
//walktocenter

What command would I use to detect if it was at a certain location?

Sorry if I'm explaining this terribly.

x[Warrior]x3500

2013-05-11 19:38:34

to start off: we do not use injection here, only color. saying that, standard injection methods (like tile based walking) are not used here.

with that said, the closest thing to tile based walking that we do have here is called SPS. look up tutorials for that, it might be able to help you. You can also detect things on the screen/minimap to determine your general location.

maikel233

2013-05-11 19:44:06

From: exo89
Ok, so if I wanted to edit my fight caves script after the update because it was getting stuck at the very beginning after clicking on the cave. I would need to add an IF statement to detect if it was stuck at the very beginning after clicking the cave entrance.

something like:
//If location(false) Then
//walktocenter

What command would I use to detect if it was at a certain location?

Sorry if I'm explaining this terribly.


Example i'll use this in my script: (CHECKS THE LOCATION)

if pointInBox(OurPos, IntToBox(0000, 0000, 0000, 0000)) then
Result := 'FightCave';

if pointInBox(OurPos, IntToBox(0000, 0000, 0000, 0000)) then
Result := 'ToMiddle';


procedure ToMiddle;
var
ToMiddleVar: TPointArray;
begin


if (CheckLocation = 'fightcave') then exit;

ToMiddleVar:=[Point(0000, 0000), Point(0000, 0000)];
SPS_WalkPath(ToMiddlevar) // walks to the cave
end;


and then your loop

To get your locations use SPS_Debug := true;

If u need help add me on skype: Maikel23350

samerdl

2013-05-11 19:57:52

What script are you using?.

You could add a simple function to your Cave entrance procedure.
After you find Cave and click it, you add:


clickmouse2(mouse_left); // this is supposed to be your click for entering the cave.
if DidClick(True,500) then // you can change the 500 to any time you want
begin // so if a red click passes, it will wait till your character reaches center.
wait(randomrange(6000,10000); // you could try changing the wait time.
clicktocontinue; // of course you need this. No need to explain.
Rest of the script.

SPS doesn't work too well in cave, i made 4 different custom maps, and they all just barely worked, waste of time and energy to invest into it.

edit:
Another thing you can do is


if GetColor(641,11) = 0 then
begin
MouseBox(654,145,658,151,1);
wait(randomrange(5000,10000);
This will detect the blackness outside cave boundaries and get you south. All taken from my script. Small things but they are very effective.

You could also use RadialWalkAutoColor, works kinda of.