Jump to content

Tele grabbing


Recommended Posts

Posted

Hey guys,

I'm trying to get into scripting a bit so I tried to make myself a little Wine grabber, but I'm really confused about how Telegrabbing works out. Now I am a newbie so I figured I kind of just hack my way through it a scrape some parts together so that eventually I get a hang of how things really work, as my earlier attempts of just following java guides didn't get me that far.

 

I found this little curse script and I thought with some small edits I would be able to get it to Telegrab.

 

Old version:

     if(getTabs().getOpen() != null && getTabs().getOpen().equals(Tab.MAGIC)) {
       getMagic().castSpellOnEntity(Spells.NormalSpells.CURSE, skeleton);
    } else {
       getTabs().open(Tab.MAGIC);
    }
 
Edited version:
     if(getTabs().getOpen() != null && getTabs().getOpen().equals(Tab.MAGIC)) {
       getMagic().castSpellOnEntity(Spells.NormalSpells.TELEKINETIC_GRAB, 245);
    } else {
       getTabs().open(Tab.MAGIC);
    }

 

Now at first eclipse gave me some "import this stuff" kind of errors so I did all of that and in the end it leaves me with this error:

The method castSpellOnEntity(Magicspell, Entity) in the type Magic is not applicable for the arguments (Spells.NormalSpells, int)

 

Does this mean tele grabbing has a different way of calling it than using castSpellOnEntity?

 

Cheers,

 

ForcaNL

 

PS: Yes I am aware of the fact that there are wine grabbers out there, I figured this would just be a nice simple project to get my head around the whole concept. :)

Posted (edited)

No it means that the parameters for the method are wrong, if you look at the API it asks for: 

 

0edac6172d563fe626b6e5c751642d83.png

 

So something to the effect of:

Grounditem item = getGroundItems().closest("Wine");
if(item != null){
    //do magic spell book opening
    getMagic().castSpellOnEntity(TeleGrab, item);
}

Please note that is not the actual calls for the methods, this is just from my head so don't copy n paste use code assist to correct it happy.png

Edited by Extreme Scripts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...