Jump to content

Tele grabbing


ForcaNL

Recommended Posts

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. :)

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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