SRL Archive - OSR Utility Scripts

[OSR] Get current in game coordinates location using TRSWalker


Gimpy666

2022-11-26 02:25:45

Uses SRL-Development (July 19 2022) and Simba rev 1400

Simple script that will run indefinitely and write your current X, Y coordinates to the console every second. This will help with developing scripts and teach the basics of getting your location in Old School RuneScape.

Threw this together quickly as some of the information in https://villavu.com/forum/showthread.php?t=131377 is out of date.

GitHub: https://github.com/Gimpy666/GetLocation

{
Script: GetLocation
Version: 1.00
Author: Gimpy666
Date: 2022-11-26

Language: Pascal
IDE: Simba rev 1400

Project GitHub: https://github.com/Gimpy666/GetLocation
SRL Forums: https://villavu.com/forum/showthread.php?t=177801

Dependencies: SRL-Development // July 19 2022
https://github.com/ollydev/SRL-Development

Bot Type: Colour

Purpose: Old School Runescape colour bot. Intended for script
developing purposes. This script will write to the console
every second returning your current X, Y coorindates using
TRSWalker.

Requirements: Use the official Jagex Old School Runescape client.

Script will run indefinently.
Additional
Informtation: SRL Documentation - Walker
https://villavu.github.io/SRL-Development/walker.html
}

// Program name
program GetLocation;

// [DEFINE INCLUDES]
// SRL_USE_REMOTEINPUT - for interacting with Jagex Old School Runescape client
{$DEFINE SRL_USE_REMOTEINPUT}

// SRL-Development - for TRSWalker functions
{$I SRL/OSR.simba}

// [DEFINE TYPES]
type
// Name of record
TBot = record
// Creating a TRSWalker object
Walker : TRSWalker;
end;

// [DEFINE VARIABLES]
var
// Create the TRSWalker bot
Bot: TBot;

// [DEFINE PROCEDURES]
procedure TBot.Init;
begin
// Select the base layer map to use in order to reference your current
// position. Bitmaps available in Simba/Includes/SRL/osr/walker/maps
Walker.Setup('world');
end;

// [DEFINE THE MAIN CODE / STARTING POINT]
begin
// Call procedure Bot.Init() to initialize one time commands for preparing
// the script to run
Bot.Init();
// Infinite loop
while True do
begin
// Write the current position to the console
WriteLn(Bot.Walker.GetMyPos());
// Wait 1 second
Wait(1000, 1050);
// Loop will repeat
end;
// End of the script
end.