Skip 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.

Cast telegrab on an item?

Featured Replies

Hey so I am new to scripting, have general knowledge in Java not too experienced.

 

Was looking to check if some item exists on the floor and then telegrab it if it does, I just cant figure out how to use a spell on a ground item.

 

Sorry for noob.

 

:(

Looking at the API, Since GroundItem implements Entity, you should be able to call Magic#castSpellOnEntity:

GroundItem item = getGroundItems().closest("Egg");
MagicSpell spellToCast = NormalSpells.TELEGRAB;
if (item != null && getMagic().canCast(spellToCast)
	if (getMagic().castSpellOnEntity(spellToCast, item)) log("Yay!");

Hopefully that works, wrote in reply box so i've not tested it... let me know if something isn't right! (:

Apa

Edited by Apaec

getMagic().castSpellOnEntity(NormalSpells.TELEGRAB, item)

 

  • Author
21 hours ago, Apaec said:

Looking at the API, Since GroundItem implements Entity, you should be able to call Magic#castSpellOnEntity:


GroundItem item = getGroundItems().closest("Egg");
MagicSpell spellToCast = NormalSpells.TELEGRAB;
if (item != null && getMagic().canCast(spellToCast)
	if (getMagic().castSpellOnEntity(spellToCast, item)) log("Yay!");

Hopefully that works, wrote in reply box so i've not tested it... let me know if something isn't right! (:

Apa

Works a charm! thanks a lot!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.