Thread: Stopping a spesific event outsid the Event Container?

Results 1 to 8 of 8
  1. #1  
    Registered Member Akeid's Avatar
    Join Date
    May 2009
    Posts
    911
    Thanks given
    22
    Thanks received
    15
    Rep Power
    37
    hey, well im trying to stop an event using the xxx.stop(); inside the container of the event. The problem is it wont let me call it outside the container method, for example when the walking packet is sent, it will stop a specific event.

    Example:
    Code:
    	public void CraftHideX(final Client c, final int Hide, final int AmountToDo, final int LevelNeeded, final int ItemGained, final int DeletedHide, final int DeletedHideAmount, final int DeletedThread, final int DeletedThreadAmount, final int EXPGained){
    		EventManager.getSingleton().addEvent(new Event() {		
    			public void execute(EventContainer a) {
    		if(c.HideID == Hide){
    		if(c.playerLevel[12] >= LevelNeeded){
    		if (c.cAmountMade == AmountToDo){
    				a.stop();
    			/** c.sendMessage("Stoped, Ammount Made is " +c.cAmountMade );
    				c.cAmountMade = 0;
    				c.sendMessage("Reset, Ammount Made is " +c.cAmountMade );
    			**/
    			}
    					//for(int X = 0; X < AmountToDo; X++){
    		c.cAmountMade++;
    		if((c.getItems().playerHasItem(DeletedHide, DeletedHideAmount)) && c.getItems().playerHasItem(DeletedThread, DeletedThreadAmount)){
    			c.cAmountMade++;
    			c.startAnimation(1249);
    			c.getItems().deleteItem(DeletedHide, c.getItems().getItemSlot(DeletedHide), DeletedHideAmount);
    			c.getItems().deleteItem(DeletedThread, c.getItems().getItemSlot(DeletedThread), DeletedThreadAmount);
    			c.getItems().addItem(ItemGained,1);
    			c.getPA().addSkillXP(EXPGained, 12);
    			c.sendMessage("You craft the "+c.getItems().getItemName(DeletedHide)+" into "+c.getItems().getItemName(ItemGained));
    		} else {
    			c.cAmountMade = 0;
    			c.sendMessage("You need "+DeletedHideAmount+" "+c.getItems().getItemName(DeletedHide)+" and "+DeletedThreadAmount+" threads to make a "+c.getItems().getItemName(ItemGained));}
    			
    		} else if(c.playerLevel[12] < LevelNeeded) {
    			c.sendMessage("You need a Crafting level of "+LevelNeeded+" to make a "+c.getItems().getItemName(ItemGained)); 
    			c.getPA().removeAllWindows();
    			c.cAmountMade = 0;
    			}
    		}
    			}
    		}, 1600);
    	}
    The highlighted red part stops that specific event, from the event container.
    I want to stop the event, eg.. crafting, when the walking packet is sent,
    but it wont let me call stop in another class.

    My wood cutting doesn't use events, and it has a reset method. I can call it in any external class file. Any suggestions on how i can solve my crafting problem?

    Thanks and rep guys!

    lol please guys help
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Sep 2009
    Posts
    3,245
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    Bump need this also my fishing emote never stops calling
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Jun 2008
    Age
    27
    Posts
    2,312
    Thanks given
    485
    Thanks received
    231
    Rep Power
    0
    World.getWorld().submit(new Event(1000) {
    if (iWantToFish = true) {
    //LALALLALLA FISH STUFF HERE
    } else {
    this.stop();
    }
    );

    and in walking packet

    c.iWantToFish = false;
    Reply With Quote  
     

  4. #4  
    Registered Member Akeid's Avatar
    Join Date
    May 2009
    Posts
    911
    Thanks given
    22
    Thanks received
    15
    Rep Power
    37
    Thats not a real way of doing it
    Reply With Quote  
     

  5. #5  
    Registered Member Akeid's Avatar
    Join Date
    May 2009
    Posts
    911
    Thanks given
    22
    Thanks received
    15
    Rep Power
    37
    24hr bump !
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Sep 2009
    Posts
    3,245
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    Additional bump ;3
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    May 2008
    Posts
    2,327
    Thanks given
    55
    Thanks received
    67
    Rep Power
    0
    Quote Originally Posted by akeid View Post
    Thats not a real way of doing it
    are you retarded? ofcourse thats how u do it


    eventstuff {
    container(event) {
    if (isBusy) { event.stop(); return }
    dostuff();
    }, 9000;
    };

    case 98: isbusy = true;
    Reply With Quote  
     

  8. #8  
    Registered Member Akeid's Avatar
    Join Date
    May 2009
    Posts
    911
    Thanks given
    22
    Thanks received
    15
    Rep Power
    37
    lol i know, i mean call it outsdie the container. Not if walking.
    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

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