Bumpty bump!
What is wrong with this? ;
Code:if (packet.id() == ID_USEITEM) {$.echo(">! Sent a useitem packet."); var time = packet.time var SlotObject = event.SlotObject var Location = event.Location var objectId = SlotObject.objectId var slotId = SlotObject.slotId var objectType = SlotObject.objectType var Locationx = Location.x var Locationy = Location.y $.echo("# time : "+time); $.echo("# objectId : "+objectId); $.echo("# slotId : "+slotId); $.echo("# objectType : "+objectType); $.echo("# Locationx : "+Locationx); $.echo("# Locationy : "+Locationy); }
Last edited by Alde.; 12-29-2013 at 06:16 PM.
Alde is Alde is
Bumpty bump!
Alde is Alde is
why are you trying to get the SlotObject and Location from event and not from packet?
Code:var SlotObject = event.SlotObject var Location = event.Location
Last edited by infern000; 12-29-2013 at 11:08 AM.
@Both guys ahead ; I have already tried using x.packet, and it didnt worked either.
Alde is Alde is
Im not trying to demotivate you, or to be mean, but you should really study on the concept of classes and instances of classes. The variable "event" has no property "Location".
You just need to grasp that Location and Slotobject are classes. Not instances.
Class is like a type for a variable. Int, String etc.
You have to look at the UseItem packet at script_help.txt. It will specify the properties (variables) of the packet and their class.
Last edited by Alde.; 12-29-2013 at 06:14 PM.
Alde is Alde is
Due to a recent DMCA takedown attempt we had to remove Faintmako brain. Please do not paid attention to what he say or do.
Alde. (12-30-2013)
This link is very useful too, I like the easily understandable examples. Lesson: Classes and Objects (The Java™ Tutorials > Learning the Java Language)
Alde. (12-30-2013)