Thread: py accessing the cycle event manager - FIXED

Results 1 to 6 of 6
  1. #1 py accessing the cycle event manager - FIXED 
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    I need to be able to add events in python to the CycleEventManager for game content and skills however I am a little lost on how I could do this in Python...

    Code:
    Server.getCycleEventManager().addEvent(new CycleEvent() {
    	@Override
    	public void execute(CycleEventContainer container) {
    
    	}
    	@Override
    	public void stop() {
    			
    	}
    }, 1);
    I was thinking create a helper function but even that I became lost on... Any ideas would be great.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Oct 2010
    Posts
    168
    Thanks given
    4
    Thanks received
    4
    Rep Power
    1
    What is the CycleEventContainer supposed to do, and what are you trying to add?

    Sorry, I don't fully understand your problem.
    Reply With Quote  
     

  3. #3  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by EmulousGuru View Post
    What is the CycleEventContainer supposed to do, and what are you trying to add?

    Sorry, I don't fully understand your problem.
    If you don't understand what the CycleEventContainer is supposed to do then you should not be posting.

    I have done some googling and came up with

    Code:
    	if command == "test":
    		class CycleEvent:
    			def execute(container):
    				player.sendMessage("test")
    				return
    			def stop():
    				return
    		server.getCycleEventManager().addEvent(CycleEvent(), 1)
    however that comes back with addEvent(): 1st arg can't be coerced to server.cycleevent.CycleEvent
    Reply With Quote  
     

  4. #4  
    Registered Member
    Mister Maggot's Avatar
    Join Date
    Dec 2008
    Posts
    7,227
    Thanks given
    3,283
    Thanks received
    2,875
    Rep Power
    5000
    There's literally no need for this....
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Oct 2010
    Posts
    168
    Thanks given
    4
    Thanks received
    4
    Rep Power
    1
    I know what the EventManager is, but I only work with Emulous servers, and have never come across a 'cycleEventManager'
    Reply With Quote  
     

  6. #6  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by Mister Maggot View Post
    There's literally no need for this....
    I like to have game content programmed in using the scripting engine allowing it to be changed dynamically. I have found a way to do this, however I am not sure where the extra arguments come from but it is working as intended.

    Code:
    import server.cycleevent.CycleEvent as cycleevent
    class test(cycleevent):
        def execute(a, b):
            player.sendMessage("testing 123")
            b.stop()
            return
        def stop(a):
            return	
    server.getCycleEventManager().addEvent(test(), 1)
    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. Cycle Based Event Manager
    By Mister Maggot in forum Snippets
    Replies: 23
    Last Post: 11-29-2010, 08:25 PM
  2. Replies: 6
    Last Post: 12-29-2009, 02:36 PM
  3. Event manager help - Making it work?
    By Akeid in forum Help
    Replies: 0
    Last Post: 12-21-2009, 04:53 AM
  4. [any] scripting engine
    By xiphias_ in forum Downloads
    Replies: 2
    Last Post: 09-21-2008, 09:23 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
  •