Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need help working out the timer for home tele

Featured Replies

When I home tele config 892 changes to what I'm assuming is some sort of game clock and I'm guessing its set up to either set that as what the clock currently is or what it needs to be before you can home tele again.

Does anyone know how to get a reference to what that clock currently would be?

I might be wrong but you could do something like:
If widget exists and contains message(int 1-20 minutes)

But another easy option could be to just store the time in memory from where you teleported and count down 20 mins?

  • Author
38 minutes ago, dubai said:

I might be wrong but you could do something like:
If widget exists and contains message(int 1-20 minutes)

But another easy option could be to just store the time in memory from where you teleported and count down 20 mins?

I've never messed with the chat as widgets, I'll look into that. I usually use the onMessage() for anything having to do with chat. 

But I don't want to rely on storing it and having a timer because I'd worry about it not functioning as intended if I need to stop the script and start it back up for whatever reason.

  • Author
15 minutes ago, Khaleesi said:

The time the last home teleport is saved in a config 892 if I remember correctly, so you can always check that config :)

Yeah, I got that much sorted out. I'm trying to figure out how to get whatever the current time is to compare it to the time that was set. I thought I found it but I can only figure out how to get my own system's time.

 

Here, taken from my quester :doge: 

	public int getSecondsLeftTeleportHome() {
		int lastTeleport = getConfigs().get(892);
		long lastTeleportSeconds = (long) lastTeleport * 60;
		Instant teleportExpireInstant = Instant.ofEpochSecond(lastTeleportSeconds).plus(Duration.ofMinutes(30));
		Duration remainingTime = Duration.between(Instant.now(), teleportExpireInstant);
		return (int) remainingTime.getSeconds();
	}

 

  • Author
6 hours ago, Czar said:

Here, taken from my quester :doge: 

	public int getSecondsLeftTeleportHome() {
		int lastTeleport = getConfigs().get(892);
		long lastTeleportSeconds = (long) lastTeleport * 60;
		Instant teleportExpireInstant = Instant.ofEpochSecond(lastTeleportSeconds).plus(Duration.ofMinutes(30));
		Duration remainingTime = Duration.between(Instant.now(), teleportExpireInstant);
		return (int) remainingTime.getSeconds();
	}

 

Awesome, that got me squared away. Also taught me about 'Instant' so thanks for that too!

13 hours ago, Czar said:

Here, taken from my quester :doge: 

	public int getSecondsLeftTeleportHome() {
		int lastTeleport = getConfigs().get(892);
		long lastTeleportSeconds = (long) lastTeleport * 60;
		Instant teleportExpireInstant = Instant.ofEpochSecond(lastTeleportSeconds).plus(Duration.ofMinutes(30));
		Duration remainingTime = Duration.between(Instant.now(), teleportExpireInstant);
		return (int) remainingTime.getSeconds();
	}

 

Nice spoon 😉 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.