Thread: [Vencillio] Cycle Gfx Command

Results 1 to 6 of 6
  1. #1 [Vencillio] Cycle Gfx Command 
    Donator

    Join Date
    Feb 2017
    Posts
    16
    Thanks given
    4
    Thanks received
    7
    Rep Power
    13
    Not sure if anyone has any use for this, but i used this to find black chincompas projectile gfx id, i figure maybe someone else could use it
    Code:
                case "cyclegfx":
                final int gfx1;
                final int gfx2;
                String usageMessageGFX = "::cyclegfx # - #";
                if (parser.hasNext()) {
                gfx1 = Integer.parseInt(parser.nextString());
                if (parser.hasNext()) {
                gfx2 = Integer.parseInt(parser.nextString());
                } else {
                player.send(new SendMessage(usageMessageGFX));
                return false;
                }
                } else {
                player.send(new SendMessage(usageMessageGFX));
                return false;
                }
                player.send(new SendMessage("Cycling GFX"));
                TaskQueue.queue(new Task(2) {
    	    int gfx = gfx1;
    	    public void execute() {
    	    player.getUpdateFlags().sendGraphic(new Graphic(gfx));
    	    player.send(new SendMessage("GFX " + gfx));
    	    if(gfx == gfx2) stop();
    	    gfx++;
    	    }
                public void onStop() {
                }});
                return true;
    Attached image
    Attached image
    Honestly i just wanted to be one of the greats
    Reply With Quote  
     

  2. #2  
    Respected Member


    George's Avatar
    Join Date
    Mar 2009
    Posts
    7,099
    Thanks given
    2,226
    Thanks received
    3,146
    Rep Power
    5000
    Wtf you broke my compiler, pls tell me where the error is from ???
    Code:
                case "cyclegfx":
                    final int gfx1;
                	final int gfx2;
                	String usageMessageGFX = "::cyclegfx # - #";
                	if (parser.hasNext()) {
               		gfx1 = Integer.parseInt(parser.nextString());
                	if (parser.hasNext()) {
                		gfx2 = Integer.parseInt(parser.nextString());
                	} else {
                		player.send(new SendMessage(usageMessageGFX));
                		return false;
                	}
                	} else {
                		player.send(new SendMessage(usageMessageGFX));
                		return false;
                	}
                	player.send(new SendMessage("Cycling GFX"));
                	TaskQueue.queue(new Task(2) {
    	    		int gfx = gfx1;
    	    		public void execute() {
    	    			player.getUpdateFlags().sendGraphic(new Graphic(gfx));
    	    			player.send(new SendMessage("GFX " + gfx));
    	    			if(gfx == gfx2) 
    					stop();
    	    				gfx++;
    	    			}
                		public void onStop() {
                	});
                	return true;
    Code you provided is wrong on so many levels rofl
    Attached image

    Spoiler for Spoilers!:
    Attached image
    Attached image
    Attached image
    Attached image
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    This is exactly why you should always use braces consistently.

    Code:
                case "cyclegfx":
                    final int gfx1;
    
    
                    final int gfx2;
    
    
                    final String incorrextSyntax = "The correct syntax is ::cyclegfx # #";
    
    
                    if (parser.hasNext()) {
                        gfx1 = Integer.parseInt(parser.nextString());
                    } else {
                        player.send(new SendMessage(incorrectSyntax));
                        return false;
                    }
                    if (parser.hasNext()) {
                        gfx2 = Integer.parseInt(parser.nextString());
                    } else {
                        player.send(new SendMessage(incorrectSyntax));
                        return false;
                    }
                    player.send(new SendMessage("Cycling GFX"));
                    TaskQueue.queue(new Task(2) {
                        int gfx = gfx1;
    
    
                        public void execute() {
                            player.getUpdateFlags().sendGraphic(new Graphic(gfx));
                            player.send(new SendMessage("GFX " + gfx));
                            if (gfx == gfx2) {
                                stop();
                            }
                            gfx++;
                        }
                        public void onStop() {}
                    });
                    return true;
    Reply With Quote  
     

  5. #4  
    Donator

    Join Date
    Feb 2017
    Posts
    16
    Thanks given
    4
    Thanks received
    7
    Rep Power
    13
    Quote Originally Posted by Idiot Bird View Post
    Wtf you broke my compiler, pls tell me where the error is from ???
    Code:
                case "cyclegfx":
                    final int gfx1;
                	final int gfx2;
                	String usageMessageGFX = "::cyclegfx # - #";
                	if (parser.hasNext()) {
               		gfx1 = Integer.parseInt(parser.nextString());
                	if (parser.hasNext()) {
                		gfx2 = Integer.parseInt(parser.nextString());
                	} else {
                		player.send(new SendMessage(usageMessageGFX));
                		return false;
                	}
                	} else {
                		player.send(new SendMessage(usageMessageGFX));
                		return false;
                	}
                	player.send(new SendMessage("Cycling GFX"));
                	TaskQueue.queue(new Task(2) {
    	    		int gfx = gfx1;
    	    		public void execute() {
    	    			player.getUpdateFlags().sendGraphic(new Graphic(gfx));
    	    			player.send(new SendMessage("GFX " + gfx));
    	    			if(gfx == gfx2) 
    					stop();
    	    				gfx++;
    	    			}
                		public void onStop() {
                	});
                	return true;
    Code you provided is wrong on so many levels rofl

    Not sure how the code i provided is ''wrong on so many levels'' should work perfectly fine once its placed in OwnerCommand or DeveloperCommand.
    Attached image
    Attached image
    Honestly i just wanted to be one of the greats
    Reply With Quote  
     

  6. #5  
    Registered Member
    Jeekusama's Avatar
    Join Date
    Jan 2017
    Posts
    455
    Thanks given
    249
    Thanks received
    222
    Rep Power
    323
    Quote Originally Posted by Idiot Bird View Post
    Wtf you broke my compiler, pls tell me where the error is from ???
    Code:
                case "cyclegfx":
                    final int gfx1;
                	final int gfx2;
                	String usageMessageGFX = "::cyclegfx # - #";
                	if (parser.hasNext()) {
               		gfx1 = Integer.parseInt(parser.nextString());
                	if (parser.hasNext()) {
                		gfx2 = Integer.parseInt(parser.nextString());
                	} else {
                		player.send(new SendMessage(usageMessageGFX));
                		return false;
                	}
                	} else {
                		player.send(new SendMessage(usageMessageGFX));
                		return false;
                	}
                	player.send(new SendMessage("Cycling GFX"));
                	TaskQueue.queue(new Task(2) {
    	    		int gfx = gfx1;
    	    		public void execute() {
    	    			player.getUpdateFlags().sendGraphic(new Graphic(gfx));
    	    			player.send(new SendMessage("GFX " + gfx));
    	    			if(gfx == gfx2) 
    					stop();
    	    				gfx++;
    	    			}
                		public void onStop() {
                	});
                	return true;
    Code you provided is wrong on so many levels rofl
    So how about teaching him what's wrong with the code instead of pointing a finger and saying "You're wrong."

    People can learn off mistakes, but if the mistake isn't recognised and people just shout out 'WRONG', how are they ever going to learn? Reason the community is the way it is presently is due to people boasting about how good they are (which I'm not saying you're doing now) and just telling people there is a better way without actually explaining so..

    I'm not saying spoonfeed him either, all I am saying is maybe you should provide an explanation instead of shouting negativity. Maybe then the community will start to progress in the right direction.


    FYLS, I'll speak to you on Illerai about the code brother. Tell you why it's inefficient. May work, but it could be structured better for better procession.
    Attached image
    Attached image
    Reply With Quote  
     

  7. Thankful users:


  8. #6  
    Donator

    Join Date
    Feb 2017
    Posts
    16
    Thanks given
    4
    Thanks received
    7
    Rep Power
    13
    Quote Originally Posted by Jeekusama View Post
    So how about teaching him what's wrong with the code instead of pointing a finger and saying "You're wrong."

    People can learn off mistakes, but if the mistake isn't recognised and people just shout out 'WRONG', how are they ever going to learn? Reason the community is the way it is presently is due to people boasting about how good they are (which I'm not saying you're doing now) and just telling people there is a better way without actually explaining so..

    I'm not saying spoonfeed him either, all I am saying is maybe you should provide an explanation instead of shouting negativity. Maybe then the community will start to progress in the right direction.


    FYLS, I'll speak to you on Illerai about the code brother. Tell you why it's inefficient. May work, but it could be structured better for better procession.


    appreciate it, i don't work on vencillio anymore anyways so i'm not too worried about it.
    Attached image
    Attached image
    Honestly i just wanted to be one of the greats
    Reply With Quote  
     


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. [help] whith gfx command
    By guppycity in forum Help
    Replies: 2
    Last Post: 07-23-2009, 02:09 AM
  2. Replies: 7
    Last Post: 07-15-2009, 08:46 PM
  3. [508] animations and gfx commands
    By tor0en in forum Configuration
    Replies: 4
    Last Post: 09-05-2008, 10:39 AM
  4. 508 emote and GFX command
    By Hotyute in forum Configuration
    Replies: 6
    Last Post: 08-25-2008, 08:30 PM
  5. gfx command
    By Glabay in forum Tutorials
    Replies: 8
    Last Post: 07-15-2008, 04:10 PM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •