RolePlay Learning System.

Page 1 of 3 123 LastLast
Results 1 to 25 of 62
  1. #1
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    RolePlay Learning System.


    EDIT
    I cleaned the code a bit, and deleted a looper.
    should still work x] Also notice some errors which have been fixed.


    I was bored.. and i remembered how dirty mango's learn code was.

    So i decided to re-code it!

    Open up VirtualUser.cs

    First, ctrl + f private Thread workoutDosLooper;
    add this under
    PHP Code:
    private Thread learnLooper
    Second, ctrl + f workout
    add this code under the workout command
    PHP Code:
                                            #region :learn  
                        
    case "learn":
                            {
                                
    int ifLearning;
                                
    using (DatabaseClient dbClient Eucalypt.dbManager.GetClient())
                                {
                                    
    ifLearning dbClient.getInt("SELECT learning FROM users WHERE name = '" _Username "'");
                                }
                                if (
    ifLearning == && learningLooper == null)
                                {
                                    if (
    _roomID == 201)
                                    {
                                        if ((
    roomUser.== && roomUser.== 4) || (roomUser.== && roomUser.== 6) || (roomUser.== && roomUser.== 8) || (roomUser.== && roomUser.== 10) || (roomUser.== && roomUser.== 4) || (roomUser.== && roomUser.== 6) || (roomUser.== && roomUser.== 8) || (roomUser.== && roomUser.== 10) || (roomUser.== 12 && roomUser.== 4) || (roomUser.== 12 && roomUser.== 6) || (roomUser.== 12 && roomUser.== 8) || (roomUser.== 12 && roomUser.== 10))
                                        {
                                            
    Room.sendSaying(roomUser"*Starts to learn*");
                                            
    ThreadStart learnStarter = new ThreadStart(learn);
                                            
    learnLooper = new Thread(learnStarter);
                                            
    learnLooper.Priority ThreadPriority.Lowest;
                                            
    learnLooper.Start();
                                            
    using (DatabaseClient dbClient Eucalypt.dbManager.GetClient())
                                            {
                                                
    dbClient.runQuery("UPDATE users SET learning = '1' WHERE name = '" _Username "'");
                                            }
                                        }
                                    }
                                }
                                break;
                            }
                        
    #endregion 
    Third, now ctrl + f private void workOutDos()
    Now add this private void under it
    PHP Code:
             private void learn()
            {
                
    int iCount 0;
                try
                {
                    while (
    true)
                    {
                        
    int learning;
                        
    using (DatabaseClient dbClient Eucalypt.dbManager.GetClient())
                        {
                            
    learning dbClient.getInt("SELECT learning FROM users WHERE name = '" _Username "'");
                            if (
    learning == 0)
                            {
                                
    sendData("BK" "You must wait 1 minute before learning again.");
                                
    learnLooper null;
                                
    learnLooper.Abort();
                            }
                            if (
    _roomID == 177 && (roomUser.== 12 && roomUser.== 5) || (roomUser.== 12 && roomUser.== 7) || (roomUser.== 12 && roomUser.== 9) || (roomUser.== 12 && roomUser.== 11) || (roomUser.== && roomUser.== 5) || (roomUser.== && roomUser.== 9) || (roomUser.== && roomUser.== 7) || (roomUser.== && roomUser.== 5))
                            {
                                
    int myIntel;
                                
    int myTime;
                                
    //refreshAppearance(false, false, true);
                                
    myIntel dbClient.getInt("SELECT intel FROM users WHERE name = '" _Username "'");
                                if (
    myIntel 14)
                                {
                                    
    sendData("BK" "Sorry, your intelligence level cannot pass 15.");
                                    
    learnLooper null;
                                    
    learnLooper.Abort();
                                }
                                
    int schoolTime myIntel 10;
                                
    myTime dbClient.getInt("SELECT time_learn FROM users WHERE name = '" _Username "'");
                                
    iCount myTime;
                                
    Room.sendWhisper(roomUser_Username"(Learning: " iCount "/" schoolTime " Minutes)");
                                
    iCount++;
                                
    dbClient.runQuery("UPDATE users SET time_learn = '" iCount "' WHERE name = '" _Username "'");
                                if (
    iCount schoolTime)
                                {
                                    
    Room.sendSaying(roomUser"*feels smarter*");
                                    
    dbClient.runQuery("UPDATE users SET time_learn = '0', intel = intel + '1' WHERE name = '" _Username "'");
                                    
    iCount 0;
                                }
                            }
                            else
                            {
                                
    dbClient.runQuery("UPDATE users SET learning = '0' WHERE name = '" _Username "'");
                                
    Room.sendSaying(roomUser"*stops learning*");
                                
    learnLooper null;
                                
    learnLooper.Abort();
                            }
                            
    Thread.Sleep(60000);
                        }
                    }
                }
                catch
                {
                    
    Thread.CurrentThread.Abort();
                    
    learnLooper null;
                }
            } 
    Now here is the part im bad at.
    You have to Add 3 Columns to the User Table.
    PHP Code:
    intel (INT)= 
    PHP Code:
    learning (INT) = 11 
    PHP Code:
    time_learn (INT) = 11 
    Sorry about the SQL part

    But it would be nice if you thanked Meh <3

    Bai!


    P.S If there is a error in my coding, please notify me!


    Edit
    I Implemented a JailBreak Void.

    If you Intelligence is at level 14, You can Instantly JailBreak.
    And the cops arent notified.

    PHP Code:
            private void jailBreak()
            {
                
    int iCount 0;
                try
                {
                    while (
    true)
                    {
                        
    using (DatabaseClient dbClient Eucalypt.dbManager.GetClient())
                        {
                            
    int Intel;
                            
    Intel dbClient.getInt("SELECT intel FROM users WHERE name = '" _Username "'");
                            {
                                if (
    Intel == 14)
                                {
                                    
    Room.sendSaying(roomUser"*successfully breaks down the jail wall freeing everyone inside*");
                                    
    dbClient.runQuery("UPDATE users SET time_jail = '0', arrested = '0'");
                                    
    jailBreakLooper null;
                                    
    jailBreakLooper.Abort();
                                }
                                else
                                {
                                    if (
    _roomID != 150 || roomUser.!= 11 || roomUser.!= 4)
                                    {
                                        
    Room.sendSaying(roomUser"*stops breaking down the wall*");
                                        
    jailBreakLooper null;
                                        
    jailBreakLooper.Abort();
                                    }
                                    if (
    iCount == 60)
                                    {
                                        
    Room.sendSaying(roomUser"*needs three more minutes to succesfully knock down this wall*");
                                    }

                                    if (
    iCount == 120)
                                    {
                                        
    Room.sendSaying(roomUser"*needs two more minutes to succesfully knock down this wall*");
                                    }

                                    if (
    iCount == 180)
                                    {
                                        
    Room.sendSaying(roomUser"*needs one more minute to succesfully knock down this wall*");
                                    }

                                    
    iCount++;

                                    if (
    iCount 180)
                                    {
                                        
    Room.sendSaying(roomUser"*successfully breaks down the jail wall freeing everyone inside*");
                                        
    dbClient.runQuery("UPDATE users SET time_jail = '0', arrested = '0'");
                                        
    jailBreakLooper null;
                                        
    jailBreakLooper.Abort();
                                    }
                                    
    Thread.Sleep(1000);
                                }
                            }
                        }
                    }
                    }
                catch
                {
                    
    Thread.CurrentThread.Abort();
                    
    jailBreakLooper null;
                }
            } 
    Pressing thanks would be nice!
    Last edited by Makarov; 12-08-10 at 07:17 PM.


  2. #2
    Account Upgraded | Title Enabled! Grant is offline
    MemberRank
    Sep 2009 Join Date
    Scotland, UK.Location
    728Posts

    Re: RolePlay Learning System.

    Nice Release. :)

  3. #3
    Enthusiast CroRuption is offline
    MemberRank
    Jul 2010 Join Date
    33Posts

    Re: RolePlay Learning System.

    AMAZING, Love this release.

  4. #4
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: RolePlay Learning System.

    I just got why one of them is a DosLooper
    the Dos= VIP(Private School)

  5. #5
    Account Upgraded | Title Enabled! PunkLessons is offline
    MemberRank
    Jan 2008 Join Date
    Close to you!Location
    586Posts

    Re: RolePlay Learning System.

    Very helpful, keep it up!

  6. #6
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: RolePlay Learning System.

    Quote Originally Posted by PunkLessons View Post
    Very helpful, keep it up!
    From a big coder, that means alot ^_^

  7. #7
    Don't buff my pylon! Admiral-Speedy is offline
    MemberRank
    Jun 2008 Join Date
    CanadaLocation
    1,292Posts

    Re: RolePlay Learning System.

    This is great, nice release.

  8. #8
    Account Upgraded | Title Enabled! Xavi. is offline
    MemberRank
    Jul 2010 Join Date
    At Home.phpLocation
    708Posts

    Re: RolePlay Learning System.

    Nice but, you shud make it so it effects something, like workout affects str which helps raise ur hit

    Xavi.

  9. #9
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: RolePlay Learning System.

    im planning on releasing, the higher your intel the faster you can jail break.

  10. #10
    Account Upgraded | Title Enabled! Xavi. is offline
    MemberRank
    Jul 2010 Join Date
    At Home.phpLocation
    708Posts

    Re: RolePlay Learning System.

    Ah nice! Try make it influence a few more things,
    I like wer this project is going btw,
    if you need any help, im willing

    Xavi.

  11. #11
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: RolePlay Learning System.

    Add me me@hubbainn.co.cc

    [msn]

  12. #12
    Proficient Member mango2735 is offline
    MemberRank
    Jun 2010 Join Date
    176Posts

    Re: RolePlay Learning System.

    Love it like mine but more understanding

  13. #13
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: RolePlay Learning System.

    Quote Originally Posted by mango2735 View Post
    Love it like mine but more understanding
    Thanks for the inspiration x]

  14. #14
    Proficient Member mango2735 is offline
    MemberRank
    Jun 2010 Join Date
    176Posts

    Re: RolePlay Learning System.

    Welcome mate,

  15. #15
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: RolePlay Learning System.

    Edit
    I Implemented a JailBreak Void.

    If you Intelligence is at level 14, You can Instantly JailBreak.
    And the cops arent notified.

  16. #16
    Alpha Member Zak© is offline
    MemberRank
    Oct 2007 Join Date
    2,693Posts

    Re: RolePlay Learning System.

    Nice Cobe You Should Do it Like BJorks One Like When You Pick Book up then you Can Learn but this Nice to

  17. #17
    Account Upgraded | Title Enabled! Xavi. is offline
    MemberRank
    Jul 2010 Join Date
    At Home.phpLocation
    708Posts

    Re: RolePlay Learning System.

    That would be hard, and link to Bjorks?

  18. #18
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: RolePlay Learning System.

    Quote Originally Posted by Zak View Post
    Nice Cobe You Should Do it Like BJorks One Like When You Pick Book up then you Can Learn but this Nice to
    Here
    Learn checks if you have a book.
    PHP Code:
                        #region :learn  
                        
    case "learn":
                            {
                                
    int ifLearning;
                                
    int book;
                                
    using (DatabaseClient dbClient Eucalypt.dbManager.GetClient())
                                {
                                    
    ifLearning dbClient.getInt("SELECT learning FROM users WHERE name = '" _Username "'");
                                }
                                {
                                    
    book dbClient.getInt("SELECT book FROM users WHERE name = '" _Username "'");
                                }
                                if (
    ifLearning == && learnDosLooper == null && learningLooper == null && book == 1)
                                {
                                    if (
    _roomID == 200)
                                    {
                                        if ((
    roomUser.== 12 && roomUser.== 5) || (roomUser.== 12 && roomUser.== 7) || (roomUser.== 12 && roomUser.== 9) || (roomUser.== 12 && roomUser.== 11) || (roomUser.== && roomUser.== 5) || (roomUser.== && roomUser.== 9) || (roomUser.== && roomUser.== 7) || (roomUser.== && roomUser.== 5))
                                        {
                                            if (
    _Rank 2)
                                            {
                                                
    sendData("Sorry, but this a private school.");
                                            }
                                            else
                                            {
                                                
    Room.sendSaying(roomUser"*Starts to learn*");
                                                
    ThreadStart learnStarter = new ThreadStart(learn);
                                                
    learnLooper = new Thread(learnStarter);
                                                
    learnLooper.Priority ThreadPriority.Lowest;
                                                
    learnLooper.Start();
                                                
    using (DatabaseClient dbClient Eucalypt.dbManager.GetClient())
                                                {
                                                    
    dbClient.runQuery("UPDATE users SET working_out = '1' WHERE name = '" _Username "'");
                                                }
                                            }
                                        }
                                    }
                                }
                                    if (
    _roomID == 201)
                                    {
                                        if ((
    roomUser.== && roomUser.== 4) || (roomUser.== && roomUser.== 6) || (roomUser.== && roomUser.== 8) || (roomUser.== && roomUser.== 10) || (roomUser.== && roomUser.== 4) || (roomUser.== && roomUser.== 6) || (roomUser.== && roomUser.== 8) || (roomUser.== && roomUser.== 10) || (roomUser.== 12 && roomUser.== 4) || (roomUser.== 12 && roomUser.== 6) || (roomUser.== 12 && roomUser.== 8) || (roomUser.== 12 && roomUser.== 10))
                                        {
                                            
    Room.sendSaying(roomUser"*Starts to learn*");
                                            
    ThreadStart learnStarter = new ThreadStart(learn);
                                            
    learnLooper = new Thread(learnStarter);
                                            
    learnLooper.Priority ThreadPriority.Lowest;
                                            
    learnLooper.Start();
                                            
    using (DatabaseClient dbClient Eucalypt.dbManager.GetClient())
                                            {
                                                
    dbClient.runQuery("UPDATE users SET learning = '1' WHERE name = '" _Username "'");
                                            }
                                        }
                                    }
                                break;
                            }
                        
    #endregion 
    And the Book Command.
    PHP Code:
    #region :book
                        
    case "book":
                            {
                              
    using (DatabaseClient dbClient Eucalypt.dbManager.GetClient())
                               {
                                        
    dbClient.runQuery("UPDATE users SET book = '1' WHERE name = '" _Username "'");
                                        
    Room.sendSaying(roomUser"*Grabs a text book*"); 
                               }
                                
                                break;
                            }
                        
    #endregion 

  19. #19
    Account Upgraded | Title Enabled! Xavi. is offline
    MemberRank
    Jul 2010 Join Date
    At Home.phpLocation
    708Posts

    Re: RolePlay Learning System.

    What happens if u aint got a book? and is book actually in hand?

  20. #20
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: RolePlay Learning System.

    Quote Originally Posted by Xavi. View Post
    What happens if u aint got a book? and is book actually in hand?
    No Book = No Learn
    Book = Imaginary

  21. #21
    Account Upgraded | Title Enabled! Xavi. is offline
    MemberRank
    Jul 2010 Join Date
    At Home.phpLocation
    708Posts

    Re: RolePlay Learning System.

    The Book... Is... Imaginary !?!?!?!?



    (Off Topic: Uploaded That Image To Photobukcet Just For This Post
    xD)

    Xavi.

  22. #22
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: RolePlay Learning System.

    @ Xavi.

    Lol
    Anything else you guys would like to see added?

  23. #23
    Account Upgraded | Title Enabled! Sledmore is offline
    MemberRank
    Jun 2009 Join Date
    1,133Posts

    Re: RolePlay Learning System.

    I lol'ed at the two timer voids, i released one of theses in Manags thread also, why not make the cords from MYSQL or.. make it so you have to be near a shelf ;']

  24. #24
    Otaku Sojobo is offline
    MemberRank
    Nov 2006 Join Date
    ScotlandLocation
    1,279Posts

    Re: RolePlay Learning System.

    Fuck me it took you like 100 lines of code to do something I achieve with like 10 LOL

  25. #25
    Account Upgraded | Title Enabled! Sledmore is offline
    MemberRank
    Jun 2009 Join Date
    1,133Posts

    Re: RolePlay Learning System.

    Quote Originally Posted by Sojobo View Post
    Fuck me it took you like 100 lines of code to do something I achieve with like 10 LOL
    LOL AARON! Stop being harsh xD!



Page 1 of 3 123 LastLast

Advertisement