ForcaNL Posted December 2, 2015 Share Posted December 2, 2015 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. Quote Link to comment Share on other sites More sharing options...
Extreme Scripts Posted December 2, 2015 Share Posted December 2, 2015 (edited) No it means that the parameters for the method are wrong, if you look at the API it asks for: 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 Edited December 2, 2015 by Extreme Scripts Quote Link to comment Share on other sites More sharing options...
Explv Posted December 2, 2015 Share Posted December 2, 2015 What Extreme posted is correct, here is the proper syntax: Grounditem item = getGroundItems().closest("Wine"); if(item != null){ getMagic().castSpellOnEntity(Spells.NormalSpells.TELEKINETIC_GRAB, item); } Quote Link to comment Share on other sites More sharing options...
ForcaNL Posted December 2, 2015 Author Share Posted December 2, 2015 Thanks so much man! I got it to work Quote Link to comment Share on other sites More sharing options...