Results 1 to 15 of 15
  1. #1
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy

    Thumbs up [Solved] [Realm Relay] I'm bad at coding and I should feel bad

    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

  2. #2
    Threadstarter
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Bumpty bump!
    Alde is Alde is

  3. #3
    Notsomeone's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    155
    Reputation
    10
    Thanks
    24
    My Mood
    Inspired
    Quote Originally Posted by ZBORNOX View Post
    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);		
    		
    		}

    Why don't you tell us whats wrong? Errors usually come with error logs.

  4. #4
    infern000's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    294
    Reputation
    10
    Thanks
    74
    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.

  5. #5
    Notsomeone's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    155
    Reputation
    10
    Thanks
    24
    My Mood
    Inspired
    Quote Originally Posted by infern000 View Post
    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
    True. ZBORNOX, you make good scripts but please use $.echo and try/catch blocks to debug before asking here.

  6. #6
    Threadstarter
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    @Both guys ahead ; I have already tried using x.packet, and it didnt worked either.
    Alde is Alde is

  7. #7
    Threadstarter
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Quote Originally Posted by Notsomeone View Post
    Why don't you tell us whats wrong? Errors usually come with error logs.
    Alde is Alde is

  8. #8
    Notsomeone's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    155
    Reputation
    10
    Thanks
    24
    My Mood
    Inspired
    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".

  9. #9
    Threadstarter
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Quote Originally Posted by Notsomeone View Post
    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".
    :'(

    Then who has?




    Also, thanks ; I didnt knew what their name was (I tried looking away before coming here). Classes!
    Last edited by Alde.; 12-29-2013 at 05:37 PM.
    Alde is Alde is

  10. #10
    Notsomeone's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    155
    Reputation
    10
    Thanks
    24
    My Mood
    Inspired
    You just need to grasp that Location and Slotobject are classes. Not instances.

  11. #11
    Threadstarter
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Quote Originally Posted by Notsomeone View Post
    You just need to grasp that Location and Slotobject are classes. Not instances.
    Can you please teach me quickly (if it can be done) how to grap the data from the classes?
    Alde is Alde is

  12. #12
    Notsomeone's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    155
    Reputation
    10
    Thanks
    24
    My Mood
    Inspired
    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.

  13. #13
    Threadstarter
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Quote Originally Posted by Notsomeone View Post
    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.

    Finaly some light at the end of the tunnel!


    Its
    Code:
    var SlotObject = packet.slotObject;
    NOT

    Code:
    var SlotObject = packet.SlotObject;
    Thanks a lot Notsomeone for teaching me instead of doing it for me!


    Solved! /aww
    Last edited by Alde.; 12-29-2013 at 06:14 PM.
    Alde is Alde is

  14. #14
    JustAnoobROTMG's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    1,916
    Reputation
    185
    Thanks
    18,230
    Due to a recent DMCA takedown attempt we had to remove Faintmako brain. Please do not paid attention to what he say or do.


  15. The Following User Says Thank You to JustAnoobROTMG For This Useful Post:

    Alde. (12-30-2013)

  16. #15
    Notsomeone's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    155
    Reputation
    10
    Thanks
    24
    My Mood
    Inspired
    This link is very useful too, I like the easily understandable examples. Lesson: Classes and Objects (The Java™ Tutorials > Learning the Java Language)

  17. The Following User Says Thank You to Notsomeone For This Useful Post:

    Alde. (12-30-2013)

Similar Threads

  1. what is the code and the right hotkey (space) for SJ
    By floris12345! in forum Visual Basic Programming
    Replies: 4
    Last Post: 01-20-2008, 01:37 PM
  2. Trade m60 retail code and new gun code
    By xxkillerxx1 in forum Trade Accounts/Keys/Items
    Replies: 9
    Last Post: 10-23-2007, 03:18 PM
  3. [TRADE]reteil code and promo code
    By uhahehh in forum Trade Accounts/Keys/Items
    Replies: 0
    Last Post: 10-02-2007, 05:33 AM
  4. 3 m60 codes and 1 awm
    By smithy in forum Trade Accounts/Keys/Items
    Replies: 11
    Last Post: 09-23-2007, 02:33 PM
  5. SWIM CODE and GUN CODE, DOESN'T WORK ??
    By h4x0r m3mb3r in forum WarRock - International Hacks
    Replies: 4
    Last Post: 07-26-2007, 01:57 AM