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
    17
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    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
    17
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    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  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,345
    Thanks given
    145
    Thanks received
    183
    Rep Power
    209
    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  
    

    Kris's Avatar
    Join Date
    Jun 2016
    Age
    20
    Posts
    3,273
    Thanks given
    498
    Thanks received
    1,803
    Rep Power
    1887
    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.

    [Only registered and activated users can see links. ]
    Discord: Kris#1337
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Feb 2018
    Posts
    17
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    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  
    omw 2 steal yo gurl

    Goody's Avatar
    Join Date
    Aug 2016
    Posts
    427
    Thanks given
    73
    Thanks received
    64
    Rep Power
    148
    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
    Best excuse for scamming i've gotten yet



    Ruse Services [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Feb 2018
    Posts
    17
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    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
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  9. #9  
    omw 2 steal yo gurl

    Goody's Avatar
    Join Date
    Aug 2016
    Posts
    427
    Thanks given
    73
    Thanks received
    64
    Rep Power
    148
    Quote Originally Posted by OmegaX View Post
    [Only registered and activated users can see links. ]
    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
    Best excuse for scamming i've gotten yet



    Ruse Services [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Feb 2018
    Posts
    17
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    [Only registered and activated users can see links. ]
    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)

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
  •