Auto Save

Page 1 of 4 1234 LastLast
Results 1 to 15 of 54
  1. #1
    Account Inactive watzmename is offline
    InactiveRank
    Aug 2008 Join Date
    2,837Posts

    Auto Save


    RaGEZONE Recommends

    RaGEZONE Recommends

    ChannelServer
    PHP Code:
    public void saveAll() {
            for (
    MapleCharacter chr players.getAllCharacters()) {
                
    chr.saveToDB(truetrue);
            }
        } 
    Save this as AutoSave.js, and add to world.prop events list AutoSave
    PHP Code:
    var setupTask;

    function 
    init() {
        
    scheduleNew();
    }

    function 
    scheduleNew() {
        var 
    cal java.util.Calendar.getInstance();
        
    cal.set(java.util.Calendar.HOUR0);
        
    cal.set(java.util.Calendar.MINUTE10);
        
    cal.set(java.util.Calendar.SECOND0);
        var 
    nextTime cal.getTimeInMillis();
        while (
    nextTime <= java.lang.System.currentTimeMillis()) {
            
    nextTime += 1000 SECONDS;
        }
        
    setupTask em.scheduleAtTimestamp("start"nextTime);
    }

    function 
    cancelSchedule() {
        
    setupTask.cancel(true);
    }

    function 
    start() {
        
    scheduleNew();
        
    em.getChannelServer().saveAll();
        var 
    iter em.getInstances().iterator();
        while (
    iter.hasNext()) {
            var 
    eim iter.next();
        }


    To justify the auto save time...
    change the
    PHP Code:
        cal.set(java.util.Calendar.HOUR0);
         
    cal.set(java.util.Calendar.MINUTE10);
         
    cal.set(java.util.Calendar.SECOND0); 
    to the intervals you want.

    Change
    PHP Code:
    nextTime += 1000 SECONDS
    to the autosave interval

    Now find the number of seconds for your interval and replace 'SECONDS' with it.
    So if your doing 1 minute, it'll be 60. If your doing 10 minutes, then its 60 x 10, which is 600. 1 hour is 60 x 60, which is 3600, and so on
    Last edited by watzmename; 28-11-09 at 05:30 AM.


  2. #2
    Account Inactive CanadianMS is offline
    InactiveRank
    Jan 2009 Join Date
    U.SLocation
    42Posts

    Re: Auto Save

    Sorry Noob Question But Where Is The Top Part Saved And Where Do I Save AutoSave.js?

  3. #3
    Account Inactive MyEnterprises is offline
    InactiveRank
    Dec 2008 Join Date
    130Posts

    Re: Auto Save

    1000 * SECOND * MINUTE * HOUR;

    You should have just said 1000 * number of seconds

  4. #4
    Account Inactive watzmename is offline
    InactiveRank
    Aug 2008 Join Date
    2,837Posts

    Re: Auto Save

    Quote Originally Posted by MyEnterprises View Post
    1000 * SECOND * MINUTE * HOUR;

    You should have just said 1000 * number of seconds
    Eh, I'll just do that since it's less complicated.

    ---------- Post added at 11:31 PM ---------- Previous post was at 11:28 PM ----------

    Quote Originally Posted by CanadianMS View Post
    Sorry Noob Question But Where Is The Top Part Saved And Where Do I Save AutoSave.js?
    You put it under a function.

    AutoSave.js into the event folder

  5. #5
    Account Inactive CanadianMS is offline
    InactiveRank
    Jan 2009 Join Date
    U.SLocation
    42Posts

    Re: Auto Save

    You put it under a function.
    Sorry I'm Pretty Noobed...
    Fuction?

  6. #6
    Account Inactive watzmename is offline
    InactiveRank
    Aug 2008 Join Date
    2,837Posts

    Re: Auto Save

    Quote Originally Posted by CanadianMS View Post
    Sorry I'm Pretty Noobed...
    Fuction?
    Go to the bottom of ChannelServer.java
    find the last }
    add it above that.

  7. #7
    Account Inactive CanadianMS is offline
    InactiveRank
    Jan 2009 Join Date
    U.SLocation
    42Posts

    Re: Auto Save

    :D Most Helpful Person On These Forums!

  8. #8
    return null; mertjuh is offline
    True MemberRank
    Dec 2008 Join Date
    The NetherlandsLocation
    1,277Posts

    Re: Auto Save

    lol are u jking are u fcking gm on ijji? :O

  9. #9
    Hardcore Member JellyIsHawt is offline
    MemberRank
    Nov 2009 Join Date
    2009Location
    100Posts

    Re: Auto Save

    Quote Originally Posted by watzmename View Post
    ChannelServer
    PHP Code:
    public void saveAll() {
            for (
    MapleCharacter chr players.getAllCharacters()) {
                
    chr.saveToDB(truetrue);
            }
        } 
    Save this as AutoSave.js, and add to world.prop events list AutoSave
    PHP Code:
    var setupTask;

    function 
    init() {
        
    scheduleNew();
    }

    function 
    scheduleNew() {
        var 
    cal java.util.Calendar.getInstance();
        
    cal.set(java.util.Calendar.HOUR0);
        
    cal.set(java.util.Calendar.MINUTE10);
        
    cal.set(java.util.Calendar.SECOND0);
        var 
    nextTime cal.getTimeInMillis();
        while (
    nextTime <= java.lang.System.currentTimeMillis()) {
            
    nextTime += 1000 SECONDS;
        }
        
    setupTask em.scheduleAtTimestamp("start"nextTime);
    }

    function 
    cancelSchedule() {
        
    setupTask.cancel(true);
    }

    function 
    start() {
        
    scheduleNew();
        
    em.getChannelServer().saveAll();
        var 
    iter em.getInstances().iterator();
        while (
    iter.hasNext()) {
            var 
    eim iter.next();
        }


    To justify the auto save time...
    change the
    PHP Code:
        cal.set(java.util.Calendar.HOUR0);
         
    cal.set(java.util.Calendar.MINUTE10);
         
    cal.set(java.util.Calendar.SECOND0); 
    to the intervals you want.

    Change
    PHP Code:
    nextTime += 1000 SECONDS
    to the autosave interval

    Now find the number of seconds for your interval and replace 'SECONDS' with it.
    So if your doing 1 minute, it'll be 60. If your doing 10 minutes, then its 60 x 10, which is 600. 1 hour is 60 x 60, which is 3600, and so on
    Works and its good for servers that crash alot.
    Server Status:Not Ready

  10. #10
    I'm sexy and I know it :) Deagan ツ is offline
    True MemberRank
    Oct 2008 Join Date
    clubs ;\Location
    1,322Posts

    Re: Auto Save

    Auto saving by checking the person's level and rebirth = better, see my repack for more information.

  11. #11
    Account Upgraded | Title Enabled! Buya is offline
    True MemberRank
    Oct 2008 Join Date
    1,304Posts

    Re: Auto Save

    auto save is shit.

  12. #12
    Hardcore Member JellyIsHawt is offline
    MemberRank
    Nov 2009 Join Date
    2009Location
    100Posts

    Re: Auto Save

    Quote Originally Posted by buya View Post
    auto save is shit.
    then dont bother posting here -_- if think it is then why post.
    Server Status:Not Ready

  13. #13
    Account Inactive GoldenKevin is offline
    InactiveRank
    Oct 2008 Join Date
    117Posts

    Re: Auto Save

    auto save is shit.

  14. #14
    Account Inactive watzmename is offline
    InactiveRank
    Aug 2008 Join Date
    2,837Posts

    Re: Auto Save

    Quote Originally Posted by GoldenKevin View Post
    auto save is shit.
    Obviously, I personally find it useless, but I released this from the help threads about auto save

  15. #15
    Account Inactive MysticalSource is offline
    InactiveRank
    Sep 2009 Join Date
    118Posts

    Re: Auto Save

    Quote Originally Posted by GoldenKevin View Post
    auto save is shit.
    why is it shit doesit lah like shit when auto saving otherwise it would be usefull for all them servers that get alot of crashes to stop rollbacks??? anyways

    *Kinda off-topic*
    if this thread is old sorry for the bump.




Page 1 of 4 1234 LastLast

Advertisement