Thread: [Ruse] Command help

Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1 [Ruse] Command help 
    Registered Member
    Join Date
    Feb 2018
    Posts
    20
    Thanks given
    1
    Thanks received
    1
    Rep Power
    0
    Hey guys, I'm trying to work on something and I need a little bit of help.

    Code:
    if (command[0].equalsIgnoreCase("wildy2") & player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640)) {
    			player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    			} else {
    			TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    			}
    That's the command I have, but everytime I do another teleport like ::home it teleports me to this area, which isn't what I want, I want it to teleport me to this area if I'm not wearing or have any of the listed items in my invent.

    I would also like some help on an easier less code way of listing the items.

    All help is appreciated, thanks!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Apr 2018
    Posts
    62
    Thanks given
    9
    Thanks received
    0
    Rep Power
    38
    Quote Originally Posted by OmegaX View Post
    Hey guys, I'm trying to work on something and I need a little bit of help.

    Code:
    if (command[0].equalsIgnoreCase("wildy2") & player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640)) {
    			player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    			} else {
    			TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    			}
    That's the command I have, but everytime I do another teleport like ::home it teleports me to this area, which isn't what I want, I want it to teleport me to this area if I'm not wearing or have any of the listed items in my invent.

    I would also like some help on an easier less code way of listing the items.

    All help is appreciated, thanks!
    if (command[0].equalsIgnoreCase("wildy2") & player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640)) {
    player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    } else {
    TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    }
    edit the coords (3104,5537) tele to the wildy and get the coords from ::mypos :os ::coords
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2018
    Posts
    20
    Thanks given
    1
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by leeg146xx View Post
    if (command[0].equalsIgnoreCase("wildy2") & player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640)) {
    player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    } else {
    TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    }
    edit the coords (3104,5537) tele to the wildy and get the coords from ::mypos :os ::coords

    You're legit making no sense... I know the coords where I want the teleport to take me, but I do it and it takes me to the area, but then if I do another command, for example ::home it will take me to the following command's location!!
    Reply With Quote  
     

  4. #4  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by OmegaX View Post
    You're legit making no sense... I know the coords where I want the teleport to take me, but I do it and it takes me to the area, but then if I do another command, for example ::home it will take me to the following command's location!!
    Code:
    if (command[0].equalsIgnoreCase("wildy2")) {
    if(player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640)) {
    			player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    			} else {
    			TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    			}
    }


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  5. #5  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by OmegaX View Post
    Hey guys, I'm trying to work on something and I need a little bit of help.

    Code:
    if (command[0].equalsIgnoreCase("wildy2") && (player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640))) {
    			player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    return;//this
    			} else {
    			TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    return;//this
    			}
    That's the command I have, but everytime I do another teleport like ::home it teleports me to this area, which isn't what I want, I want it to teleport me to this area if I'm not wearing or have any of the listed items in my invent.

    I would also like some help on an easier less code way of listing the items.

    All help is appreciated, thanks!
    Pointed out the reasons why your code didn't compile in red. Added two suggestive points with the comment of //this at the end of them.


    Quote Originally Posted by leeg146xx View Post
    if (command[0].equalsIgnoreCase("wildy2") & player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640)) {
    player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    } else {
    TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    }
    edit the coords (3104,5537) tele to the wildy and get the coords from ::mypos :os ::coords
    Yeah.. No nigga. The code was flawed and failed to compile.

    Quote Originally Posted by arch337 View Post
    Code:
    if (command[0].equalsIgnoreCase("wildy2")) {
    if(player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640)) {
    			player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!");
    			} else {
    			TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType());
    			}
    }
    It'll function, however as I brought up in the first post, should return the code, especially considering how these commands seem to have been written - would save the JVM a bunch of processing time as it won't have to then go through all the remainder of sentences.
    Attached image
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Feb 2018
    Posts
    20
    Thanks given
    1
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Kris View Post
    Pointed out the reasons why your code didn't compile in red. Added two suggestive points with the comment of //this at the end of them.



    Yeah.. No nigga. The code was flawed and failed to compile.


    It'll function, however as I brought up in the first post, should return the code, especially considering how these commands seem to have been written - would save the JVM a bunch of processing time as it won't have to then go through all the remainder of sentences.
    Hey man, this doesn't work for me, throws me a few errors, are you able to teamviewer me and have a look for me?
    Reply With Quote  
     

  7. #7  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    Well none of that should give errors. If you're getting errors, then you put it in the wrong place or you're missing a bracket somewhere
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Feb 2018
    Posts
    20
    Thanks given
    1
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Goody View Post
    Well none of that should give errors. If you're getting errors, then you put it in the wrong place or you're missing a bracket somewhere
    http://prntscr.com/jtvhzr
    Reply With Quote  
     

  9. #9  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    Quote Originally Posted by OmegaX View Post
    If you hover over the error then it tells you what the error is or you can open up the problems log to see what it says. I can't even see your whole command so i don't know if somethings missing. But based off of that since the error is coming from below the command that you added, then I would probably guess that you're missing a bracket. But since I can't see the entire thing and you didn't post what the error was I can't tell
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Feb 2018
    Posts
    20
    Thanks given
    1
    Thanks received
    1
    Rep Power
    0
    http://prntscr.com/jtvhzr
    That's the error in the line below, I have no idea... ahahaha
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [Ruse] Need help with commands
    By SinfulPS in forum Help
    Replies: 6
    Last Post: 01-12-2017, 05:13 PM
  2. [Ruse] Commands help
    By Hell Kid in forum Help
    Replies: 14
    Last Post: 01-11-2016, 06:07 AM
  3. Replies: 52
    Last Post: 04-19-2009, 04:48 PM
  4. item commaND HELP
    By `Lubricant in forum Tutorials
    Replies: 6
    Last Post: 08-03-2008, 09:11 PM
  5. basic command help(short tut)
    By Sub in forum Tutorials
    Replies: 2
    Last Post: 11-07-2007, 08:38 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •