Thread: Insanityx 317Pi Base Trivia bot help

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Insanityx 317Pi Base Trivia bot help 
    Registered Member

    Join Date
    Oct 2016
    Posts
    137
    Thanks given
    70
    Thanks received
    38
    Rep Power
    105
    SO I get these errors, and yes I have imported it in the commands and server


    Code:
    src\server\model\players\TriviaBot.java:58: error: '}' expected
    {"<shad=255>[Trivia] Which NPC sells magic gear"Zaff"},
                                                    ^
    src\server\model\players\TriviaBot.java:58: error: unclosed string literal
    {"<shad=255>[Trivia] Which NPC sells magic gear"Zaff"},
                                                        ^
    src\server\model\players\TriviaBot.java:59: error: not a statement
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
     ^
    src\server\model\players\TriviaBot.java:59: error: ';' expected
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
                                                               ^
    src\server\model\players\TriviaBot.java:59: error: illegal start of type
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
                                                                         ^
    src\server\model\players\TriviaBot.java:59: error: ';' expected
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
                                                                          ^
    6 errors
    Press any key to continue . . .
    Thanks in Advanced



    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Registered Thanker
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    1,859
    Thanks given
    14,198
    Thanks received
    295
    Rep Power
    5000
    post the whole code block pls. seems like you're missing a lot of syntaxes
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #3  
    Registered Member

    Join Date
    Oct 2016
    Posts
    137
    Thanks given
    70
    Thanks received
    38
    Rep Power
    105
    Code:
    src\server\model\players\TriviaBot.java:58: error: '}' expected
    {"<shad=255>[Trivia] Which NPC sells magic gear"Zaff"},
                                                    ^
    src\server\model\players\TriviaBot.java:58: error: unclosed string literal
    {"<shad=255>[Trivia] Which NPC sells magic gear"Zaff"},
                                                        ^
    src\server\model\players\TriviaBot.java:59: error: not a statement
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
     ^
    src\server\model\players\TriviaBot.java:59: error: ';' expected
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
                                                               ^
    src\server\model\players\TriviaBot.java:59: error: illegal start of type
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
                                                                         ^
    src\server\model\players\TriviaBot.java:59: error: ';' expected
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
                                                                          ^
    6 errors
    Press any key to continue . . .
    Probably gonna be something so simple... Ive been at this server files for 3 days now. close my eyes and I see ******* code....
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Registered Thanker
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    1,859
    Thanks given
    14,198
    Thanks received
    295
    Rep Power
    5000
    Quote Originally Posted by Jrage View Post
    Code:
    src\server\model\players\TriviaBot.java:58: error: '}' expected
    {"<shad=255>[Trivia] Which NPC sells magic gear"Zaff"},
                                                    ^
    src\server\model\players\TriviaBot.java:58: error: unclosed string literal
    {"<shad=255>[Trivia] Which NPC sells magic gear"Zaff"},
                                                        ^
    src\server\model\players\TriviaBot.java:59: error: not a statement
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
     ^
    src\server\model\players\TriviaBot.java:59: error: ';' expected
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
                                                               ^
    src\server\model\players\TriviaBot.java:59: error: illegal start of type
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
                                                                         ^
    src\server\model\players\TriviaBot.java:59: error: ';' expected
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
                                                                          ^
    6 errors
    Press any key to continue . . .
    Probably gonna be something so simple... Ive been at this server files for 3 days now. close my eyes and I see ******* code....
    post triviabot.java

    also you're missing a comma and quotes here
    Code:
    {"<shad=255>[Trivia] Which NPC sells magic gear", "Zaff"},
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. Thankful user:


  8. #5  
    Registered Member RainDropzZ's Avatar
    Join Date
    Oct 2010
    Posts
    136
    Thanks given
    9
    Thanks received
    26
    Rep Power
    45
    Just compare these two here:

    {"<shad=255>[Trivia] Which NPC sells magic gear"Zaff"},

    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},


    You forgot a simple "," between the question string and the answer string.

    Code:
    {"<shad=255>[Trivia] Which NPC sells magic gear", Zaff"},

    Edit:
    My dude Mr.Classic was faster
    Spoiler for Verified!:
    Reply With Quote  
     

  9. Thankful user:


  10. #6  
    Registered Member

    Join Date
    Oct 2016
    Posts
    137
    Thanks given
    70
    Thanks received
    38
    Rep Power
    105
    You are a godsend my fellow much thanks. Told you it'd be simple, i couldnt even copy paste trivia bot. I think its break time.
    Reply With Quote  
     

  11. Thankful user:


  12. #7  
    Registered Thanker
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    1,859
    Thanks given
    14,198
    Thanks received
    295
    Rep Power
    5000
    Quote Originally Posted by RainDropzZ View Post
    Just compare these two here:

    {"<shad=255>[Trivia] Which NPC sells magic gear"Zaff"},

    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},


    You forgot a simple "," between the question string and the answer string.

    Code:
    {"<shad=255>[Trivia] Which NPC sells magic gear", Zaff"},

    Edit:
    My dude Mr.Classic was faster
    Faster than the speed of light

    You're right
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  13. #8  
    Registered Member

    Join Date
    Oct 2016
    Posts
    137
    Thanks given
    70
    Thanks received
    38
    Rep Power
    105
    Code:
    package server.model.minigames;
    
    import server.event.Event;
    import server.event.EventContainer;
    import server.event.EventManager;
    import server.model.players.Player;
    import server.model.players.PlayerHandler;
    import server.util.Misc;
    import server.model.players.Client;
    
    public class TriviaBot {
    
    
    public static void startup() {
    EventManager.getSingleton().addEvent(new Event() {
    @Override
    public void execute(EventContainer e) {
    if (getPlayerCount() > 0) {
    askQuestion();
    }
    }
    }, 900000);
    }
    public static void attemptAnswer(Player p, String attempt) {
    if (!currentQuestion.equals("") && attempt.replaceAll("_", " ").equalsIgnoreCase(currentAnswer)) {
    currentQuestion = "";
    p.pkPoints++;
    sendServerMessage("<shad=255>Well done! "+p.playerName + " has quessed the question correctly and earned 1 Trivia Point!");
    }
    }
    public static boolean acceptingQuestion() {
    return !currentQuestion.equals("");
    }
    public static void askQuestion() {
    final int random = Misc.random(TRIVIA_DATA.length - 1);
    
    currentQuestion = TRIVIA_DATA[random][0];
    currentAnswer = TRIVIA_DATA[random][1];
    
    sendServerMessage(currentQuestion);
    }
    private static int getPlayerCount() {
    int players = 0;
    for (Player p : PlayerHandler.players) {
    if (p != null)
    players++;
    }
    return players;
    }
    private static void sendServerMessage(String message) {
    for (Player p : PlayerHandler.players) {
    if (p != null) {
    ((Client)p).sendMessage(message);
    }
    }
    }
    private static final String[][] TRIVIA_DATA = {
    {"<shad=255>[Trivia] What is the highest combat level in the game?", "126"},
    {"<shad=255>[Trivia] What is the highest leveled NPC in the game?", "Corporal Beast"},
    {"<shad=255>[Trivia] Who created the server originally?", "InsidiaX"},
    {"<shad=255>[Trivia] Which NPC sells magic gear"Zaff"},
    {"<shad=255>[Trivia] What is the highest rank in the game?", "Owner"},
    };
    private static String currentQuestion;
    private static String currentAnswer;
    }
    Reply With Quote  
     

  14. Thankful user:


  15. #9  
    Registered Thanker
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    1,859
    Thanks given
    14,198
    Thanks received
    295
    Rep Power
    5000
    Quote Originally Posted by Jrage View Post
    You are a godsend my fellow much thanks. Told you it'd be simple, i couldnt even copy paste trivia bot. I think its break time.
    just copy pasta my friend
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  16. #10  
    Registered Member

    Join Date
    Oct 2016
    Posts
    137
    Thanks given
    70
    Thanks received
    38
    Rep Power
    105
    New errors, Im stuck and so tired, gonna post them, head to bed, wake up, try to fix, if I cant I'll look here. lol

    Code:
    src\server\model\players\packets\Commands.java:14: error: cannot find symbol
    import server.model.players.TriviaBot;
                               ^
      symbol:   class TriviaBot
      location: package server.model.players
    src\server\Server.java:20: error: cannot find symbol
    import server.model.players.TriviaBot;
                               ^
      symbol:   class TriviaBot
      location: package server.model.players
    src\server\model\players\packets\Commands.java:143: error: cannot find symbol
    if(TriviaBot.acceptingQuestion()){
       ^
      symbol:   variable TriviaBot
      location: class Commands
    src\server\model\players\packets\Commands.java:144: error: cannot find symbol
    TriviaBot.attemptAnswer(c, triviaAnswer);
    ^
      symbol:   variable TriviaBot
      location: class Commands
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    4 errors
    Press any key to continue . . .
    Reply With Quote  
     

  17. Thankful user:


Page 1 of 2 12 LastLast

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. Trivia bot help (commands)
    By azzacustoms in forum Help
    Replies: 7
    Last Post: 10-14-2015, 08:03 AM
  2. [677+] Trivia Bot Help
    By Guru. in forum Help
    Replies: 11
    Last Post: 05-10-2014, 05:03 AM
  3. Trivia bot help.
    By always in forum Help
    Replies: 23
    Last Post: 12-22-2012, 04:11 AM
  4. trivia bot help
    By getsuga121 in forum Help
    Replies: 4
    Last Post: 08-14-2012, 04:29 AM
  5. trivia bot help
    By getsuga121 in forum Help
    Replies: 2
    Last Post: 08-14-2012, 12:42 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •