[GH-ISSUE #274] Make ::commands open a quest interface instead of just a single message #8488

Closed
opened 2026-06-01 12:20:54 +00:00 by Dark98 · 2 comments
Owner

Originally created by @dginovker on GitHub (Dec 12, 2019).
Original GitHub issue: https://github.com/2006-Scape/2006Scape/issues/274

You can look at how ::highscores (search project for "highscores") does this for an easy template

Originally created by @dginovker on GitHub (Dec 12, 2019). Original GitHub issue: https://github.com/2006-Scape/2006Scape/issues/274 You can look at how `::highscores` (search project for `"highscores"`) does this for an easy template
Dark98 added the Difficulty: Easy label 2026-06-01 12:20:54 +00:00
Author
Owner

@Gptaqbc commented on GitHub (Dec 12, 2019):

Oh yeah that would be cool! It'd be useful as we'll be able to add a lot of information i.e shop commands.

<!-- gh-comment-id:565077818 --> @Gptaqbc commented on GitHub (Dec 12, 2019): Oh yeah that would be cool! It'd be useful as we'll be able to add a lot of information i.e shop commands.
Author
Owner

@Gptaqbc commented on GitHub (Dec 12, 2019):

This is how ::highscores works:

case "highscores":

  1. Save players informations (Not needed in the actual context)
  2. Create var Highscores with the needed information (This can be replaced by strings to display the information needed)

HighscoresHandler hs = new HighscoresHandler();
String[] highscores = new String[]{
"Top 5 Total Level:",
hs.getRank(player, 0, "level"),
...
"",
"Top 5 Wealthiest Players:",
hs.getRank(player, 0, "gold"),
...
"",
"Top 5 Highest Total Damage:",
hs.getRank(player, 0, "damage"),
...
};

  1. Clears old lines that were inserted last time sendFrame126 was used:

for (int i = 8144; i < 8195; i++) player.getPacketSender().sendFrame126("", i);

  1. Specify lineNumber (Really have no idea why the number is 8147)

int lineNumber = 8147;

  1. Add the string arrays from step 2 to the Frame126

for (String line : highscores){
System.out.println(line + " - " + lineNumber);
player.getPacketSender().sendFrame126(line, lineNumber++);
}

  1. Display the interface in the player's client

player.getPacketSender().showInterface(8134);

Code need to be added in: Commands.java

<!-- gh-comment-id:565135040 --> @Gptaqbc commented on GitHub (Dec 12, 2019): This is how ::highscores works: case "highscores": 1. Save players informations (Not needed in the actual context) 2. Create var Highscores with the needed information (This can be replaced by strings to display the information needed) > HighscoresHandler hs = new HighscoresHandler(); String[] highscores = new String[]{ "Top 5 Total Level:", hs.getRank(player, 0, "level"), ... "", "Top 5 Wealthiest Players:", hs.getRank(player, 0, "gold"), ... "", "Top 5 Highest Total Damage:", hs.getRank(player, 0, "damage"), ... }; 3. Clears old lines that were inserted last time sendFrame126 was used: > for (int i = 8144; i < 8195; i++) player.getPacketSender().**sendFrame126("", i)**; 4. Specify lineNumber (Really have no idea why the number is 8147) > int lineNumber = 8147; 5. Add the string arrays from step 2 to the Frame126 > for (String line : highscores){ System.out.println(line + " - " + lineNumber); player.getPacketSender().sendFrame126(line, lineNumber++); } 6. Display the interface in the player's client > player.getPacketSender().showInterface(8134); Code need to be added in: Commands.java
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 2006-Scape/2006Scape#8488