View Full Version : Custom achievment diary
Sam23
June 30th, 2011, 11:19
okay... first
Create this class in model:
Name: AchievementDiary.java
put this in it:
package com.rs2hd.model;
public class AchievementDiary {
public static void strings(Player p) {
p.getActionSender().sendString("<img=1><col=66ff00>Server name", 259, 0);
p.getActionSender().sendString("<col=0066cc>Stats:", 259, 1);
p.getActionSender().sendString("<col=ffffff>Name: " + p.getUsername() + ".", 259, 2);
checkDonator(p);
checkRights(p);
p.getActionSender().sendString("<col=ffffff>Legacy Points: " + p.legacyPoints + ".", 259, 5);
p.getActionSender().sendString("<col=0066cc>Teleports: ", 259, 6);//
p.getActionSender().sendString(" ", 259, 7);
p.getActionSender().sendString("<img=1><col=66ff00>Server name<img = 1>", 259, 8);
p.getActionSender().sendString("<col=6699cc><b>Info:</b>", 259, 10);//Info
p.getActionSender().sendString("<col=ffffff>Owner: <img=1><col = cc0000>Shadow Fita", 259, 11);
p.getActionSender().sendString("<col=ffffff>Co-Owner: <img=1><col = cc0000>Sam", 259, 12);
p.getActionSender().sendString("<col=cc0000>Never Ask For Staff!", 259, 13);
p.getActionSender().sendString("<col=6699cc>Bosses: ", 259, 14);
p.getActionSender().sendString("<col=ffffff>Godwars", 259, 15);
p.getActionSender().sendString("<col=ffffff>Corp", 259, 16);
p.getActionSender().sendString("<col=ffffff>Tormented Demon", 259, 17);
p.getActionSender().sendString("<col=6699cc>Training:", 259, 18);// Train commands
p.getActionSender().sendString("<col=ffffff>Crabs", 259, 19);
p.getActionSender().sendString("<col=ffffff>Yaks", 259, 20);
p.getActionSender().sendString("<col=ffffff>Slayer Tower", 259, 21);
p.getActionSender().sendString("<col=6699cc><b>Pvp Sets:</b>", 259, 22);// pk sets..
p.getActionSender().sendString("<col=ffffff>Pure: <col=00cc00>50m", 259, 23);
p.getActionSender().sendString("<col=ffffff>Zerker:<col=00cc00> 60m", 259, 24);
p.getActionSender().sendString("<col=ffffff>Main: <col=00cc00>70m", 259, 25);
p.getActionSender().sendString("<col=6699cc>Pvp:", 259, 26);
p.getActionSender().sendString("<col=ffffff>Clan Wars", 259, 27);
p.getActionSender().sendString("<col=ffffff>Mage Bank", 259, 28);
p.getActionSender().sendString("<col=ffffff>Pk Room", 259, 29);
p.getActionSender().sendString("<col=ffffff><img=1>Legacy-X Points Shop<img=1>", 259, 30);// coming soon text
}
public static void checkRights(Player p) {
if(p.getRights() == 0) {
p.getActionSender().sendString("<col=ffffff>Rank: Player", 259, 4);
}else if(p.getRights() == 1) {
p.getActionSender().sendString("<col=ffffff>Rank: <img=0>Mod", 259, 4);
}else if(p.getRights() == 2) {
p.getActionSender().sendString("<col=ffffff>Rank: <img=1>Admin", 259, 4);
}
}
public static void checkDonator(Player p) {
if(p.donator == 1) {
p.getActionSender().sendString("<col=ffffff>Donator: <col=00cc00>[$]Yes.", 259, 3);
} else if(p.donator == 0 ) {
p.getActionSender().sendString("<col=ffffff>Donator: No.", 259, 3);
}
}
}
Okay now goto ActionButtonPacketHandler.java
Search Case 259:
If it'a not there add this:
case 259:
//Achievement Diary buttons.
if(buttonId == 15) {
player.sm("You teleport to Godwars.");
player.getTele().telePlayer(player, 2871, 5318, 2, 2);
}
if(buttonId == 16) {
player.sm("You teleport to Corp.");
player.getTele().telePlayer(player, 2966, 4383, 0, 2);
}
if(buttonId == 17) {
player.sm("You teleport to Tormented Demon.");
player.getTele().telePlayer(player, 2571, 5736, 0, 2);
}
if(buttonId == 19) {
player.sm("You teleport to Rock Crabs.");
player.getTele().telePlayer(player, 2710, 3710, 0, 2);
}
if(buttonId == 20) {
player.sm("You teleport to Yaks.");
player.getTele().telePlayer(player, 2310, 3782, 0, 2);
}
if(buttonId == 21) {
player.sm("You teleport to Slayer Tower");
player.getTele().telePlayer(player, 3429, 3538, 0, 0);
}
if(buttonId == 23) {//pure 50m
if(player.getInventory().contains(995, 50000000)) {
player.getActionSender().pureSet(player);
} else {
player.sm("You need 50m+ to buy this set!");
}
}
if(buttonId == 24) {//zerker 60m
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 60000000)) {
} else {
player.sm("You need 60m+ to buy this set!");
}
}
if(buttonId == 25) {//main 70m
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 70000000)) {
} else {
player.sm("You need 70m+ to buy this set!");
}
}
if(buttonId == 27) {
player.sm("You teleport to Clan Wars.");
player.getTele().telePlayer(player, 2812, 5511, 0, 2);
}
if(buttonId == 28) {
player.sm("You teleport to Mage Bank.");
player.getTele().telePlayer(player, 2539, 4716, 0, 0);
}
if(buttonId == 29) {
player.sm("You teleport to Pk Room.");
player.getTele().telePlayer(player, 3041, 3953, 0, 0);
}
if(buttonId == 30) {
player.sm("You open the Legacy-X point shop!");
GameEngine.shopHandler.openshop(player, 24);
}
ActionSender.java:
public static void pureSet(Player p) {
p.getInventory().addItem(1725, 0);
p.getInventory().addItem(3105, 0);
p.getInventory().addItem(2497, 0);
p.getInventory().addItem(1115, 0);
p.getInventory().addItem(7458, 0);
p.getInventory().addItem(3844, 0);
p.getInventory().addItem(4398, 0);
p.getInventory().addItem(662, 0);
p.getInventory().addItem(9185, 0);
p.getInventory().addItem(9144, 100);
p.getInventory().addItem(861, 0);
p.getInventory().addItem(892, 100);
p.getInventory().addItem(1215, 0);
p.getInventory().addItem(7947, 100);
p.getInventory().deleteItem(995, 50000000);
p.sm("You recieve your pure set!");
}
public static void zerkerSet() {
}
public static void mainSet() {
}
And Search: Starter, then add this above it:
AchievementDiary.strings(player);
I Never finished it :/
Enjoy
own4g3
June 30th, 2011, 11:22
just make a void in actionsender instead of making a new class...
Sam23
June 30th, 2011, 11:23
No i wanted to do it this way.
own4g3
June 30th, 2011, 11:24
lolk
As you wish....
Sam23
June 30th, 2011, 13:50
Okay ;D
Lukedawesome
June 30th, 2011, 16:47
What is this I don't even.
LETS MAKE A NEW CLASS FOR EVERYTHING!!! YAY!!
Sam23
June 30th, 2011, 16:57
fuck you luke. bellend.
OwnsterChief
June 30th, 2011, 17:31
okay... first
Create this class in model:
Name: AchievementDiary.java
put this in it:
package com.rs2hd.model;
public class AchievementDiary {
public static void strings(Player p) {
p.getActionSender().sendString("<img=1><col=66ff00>Server name", 259, 0);
p.getActionSender().sendString("<col=0066cc>Stats:", 259, 1);
p.getActionSender().sendString("<col=ffffff>Name: " + p.getUsername() + ".", 259, 2);
checkDonator(p);
checkRights(p);
p.getActionSender().sendString("<col=ffffff>Legacy Points: " + p.legacyPoints + ".", 259, 5);
p.getActionSender().sendString("<col=0066cc>Teleports: ", 259, 6);//
p.getActionSender().sendString(" ", 259, 7);
p.getActionSender().sendString("<img=1><col=66ff00>Server name<img = 1>", 259, 8);
p.getActionSender().sendString("<col=6699cc><b>Info:</b>", 259, 10);//Info
p.getActionSender().sendString("<col=ffffff>Owner: <img=1><col = cc0000>Shadow Fita", 259, 11);
p.getActionSender().sendString("<col=ffffff>Co-Owner: <img=1><col = cc0000>Sam", 259, 12);
p.getActionSender().sendString("<col=cc0000>Never Ask For Staff!", 259, 13);
p.getActionSender().sendString("<col=6699cc>Bosses: ", 259, 14);
p.getActionSender().sendString("<col=ffffff>Godwars", 259, 15);
p.getActionSender().sendString("<col=ffffff>Corp", 259, 16);
p.getActionSender().sendString("<col=ffffff>Tormented Demon", 259, 17);
p.getActionSender().sendString("<col=6699cc>Training:", 259, 18);// Train commands
p.getActionSender().sendString("<col=ffffff>Crabs", 259, 19);
p.getActionSender().sendString("<col=ffffff>Yaks", 259, 20);
p.getActionSender().sendString("<col=ffffff>Slayer Tower", 259, 21);
p.getActionSender().sendString("<col=6699cc><b>Pvp Sets:</b>", 259, 22);// pk sets..
p.getActionSender().sendString("<col=ffffff>Pure: <col=00cc00>50m", 259, 23);
p.getActionSender().sendString("<col=ffffff>Zerker:<col=00cc00> 60m", 259, 24);
p.getActionSender().sendString("<col=ffffff>Main: <col=00cc00>70m", 259, 25);
p.getActionSender().sendString("<col=6699cc>Pvp:", 259, 26);
p.getActionSender().sendString("<col=ffffff>Clan Wars", 259, 27);
p.getActionSender().sendString("<col=ffffff>Mage Bank", 259, 28);
p.getActionSender().sendString("<col=ffffff>Pk Room", 259, 29);
p.getActionSender().sendString("<col=ffffff><img=1>Legacy-X Points Shop<img=1>", 259, 30);// coming soon text
}
public static void checkRights(Player p) {
if(p.getRights() == 0) {
p.getActionSender().sendString("<col=ffffff>Rank: Player", 259, 4);
}else if(p.getRights() == 1) {
p.getActionSender().sendString("<col=ffffff>Rank: <img=0>Mod", 259, 4);
}else if(p.getRights() == 2) {
p.getActionSender().sendString("<col=ffffff>Rank: <img=1>Admin", 259, 4);
}
}
public static void checkDonator(Player p) {
if(p.donator == 1) {
p.getActionSender().sendString("<col=ffffff>Donator: <col=00cc00>[$]Yes.", 259, 3);
} else if(p.donator == 0 ) {
p.getActionSender().sendString("<col=ffffff>Donator: No.", 259, 3);
}
}
}
Okay now goto ActionButtonPacketHandler.java
Search Case 259:
If it'a not there add this:
case 259:
//Achievement Diary buttons.
if(buttonId == 15) {
player.sm("You teleport to Godwars.");
player.getTele().telePlayer(player, 2871, 5318, 2, 2);
}
if(buttonId == 16) {
player.sm("You teleport to Corp.");
player.getTele().telePlayer(player, 2966, 4383, 0, 2);
}
if(buttonId == 17) {
player.sm("You teleport to Tormented Demon.");
player.getTele().telePlayer(player, 2571, 5736, 0, 2);
}
if(buttonId == 19) {
player.sm("You teleport to Rock Crabs.");
player.getTele().telePlayer(player, 2710, 3710, 0, 2);
}
if(buttonId == 20) {
player.sm("You teleport to Yaks.");
player.getTele().telePlayer(player, 2310, 3782, 0, 2);
}
if(buttonId == 21) {
player.sm("You teleport to Slayer Tower");
player.getTele().telePlayer(player, 3429, 3538, 0, 0);
}
if(buttonId == 23) {//pure 50m
if(player.getInventory().contains(995, 50000000)) {
player.getActionSender().pureSet(player);
} else {
player.sm("You need 50m+ to buy this set!");
}
}
if(buttonId == 24) {//zerker 60m
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 60000000)) {
} else {
player.sm("You need 60m+ to buy this set!");
}
}
if(buttonId == 25) {//main 70m
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 70000000)) {
} else {
player.sm("You need 70m+ to buy this set!");
}
}
if(buttonId == 27) {
player.sm("You teleport to Clan Wars.");
player.getTele().telePlayer(player, 2812, 5511, 0, 2);
}
if(buttonId == 28) {
player.sm("You teleport to Mage Bank.");
player.getTele().telePlayer(player, 2539, 4716, 0, 0);
}
if(buttonId == 29) {
player.sm("You teleport to Pk Room.");
player.getTele().telePlayer(player, 3041, 3953, 0, 0);
}
if(buttonId == 30) {
player.sm("You open the Legacy-X point shop!");
GameEngine.shopHandler.openshop(player, 24);
}
ActionSender.java:
public static void pureSet(Player p) {
p.getInventory().addItem(1725, 0);
p.getInventory().addItem(3105, 0);
p.getInventory().addItem(2497, 0);
p.getInventory().addItem(1115, 0);
p.getInventory().addItem(7458, 0);
p.getInventory().addItem(3844, 0);
p.getInventory().addItem(4398, 0);
p.getInventory().addItem(662, 0);
p.getInventory().addItem(9185, 0);
p.getInventory().addItem(9144, 100);
p.getInventory().addItem(861, 0);
p.getInventory().addItem(892, 100);
p.getInventory().addItem(1215, 0);
p.getInventory().addItem(7947, 100);
p.getInventory().deleteItem(995, 50000000);
p.sm("You recieve your pure set!");
}
public static void zerkerSet() {
}
public static void mainSet() {
}
And Search: Starter, then add this above it:
AchievementDiary.strings(player);
I Never finished it :/
Enjoy
:mad::mad::mad::mad:
ermm ok, I really dont like that you made this, now all the VERY NOOBIES Servers will now have this.
Sam23
June 30th, 2011, 17:38
Well its about time that some one stopped leeching TkoScape.
apache ah64
June 30th, 2011, 17:56
Nice RIP from TkoScape ;) btw got costum donator crown done on donator int and quest tab changed to green, yellow, red with own quests into it...
champ
June 30th, 2011, 17:57
y not make a separate class for each string then?? :p
Cart
June 30th, 2011, 17:58
:mad::mad::mad::mad:
ermm ok, I really dont like that you made this, now all the VERY NOOBIES Servers will now have this.
Would never use this, at least I wouldn't lol.
OwnsterChief
June 30th, 2011, 19:28
Would never use this, at least I wouldn't lol.
I had to guess all the string myself and then this noobie comes along, just annoyying.
champ
June 30th, 2011, 19:36
guess all the strings??....phew...l2makeworkeasier
for(int i = 0; i < 31; i++) {
player.getActionSender().sendString("<col=ffffff>"+i, (interfaceid),i);
}
Josh
June 30th, 2011, 19:39
I thought you made a real achievement diary, with tasks and shit. Guess my hopes are to high for this community.
own4g3
June 30th, 2011, 19:41
I thought you made a real achievement diary, with tasks and shit. Guess my hopes are to high for this community.
The title says CUSTOM achievment dairy.
champ
June 30th, 2011, 19:42
so custom can mean custom tasks /fp
this is just achievement diaries tab...nothing else is related to achievements diary
own4g3
June 30th, 2011, 19:43
so custom can mean custom tasks /fp
this is just achievement diaries tab...nothing else is related to achievements diary
Ye or custom teles?
champ
June 30th, 2011, 19:44
custom teles...uuh lemme think how that is related to achievement diaries......nvm it isnt
own4g3
June 30th, 2011, 19:46
custom teles...uuh lemme think how that is related to achievement diaries......nvm it isnt
It can be in anyway!
It's CUSTOM dairy
champ
June 30th, 2011, 19:47
so i put same things in inventory tab and it becomes custom inventory? kewl
Divine-X
June 30th, 2011, 20:02
This isn't even a tutorial -.-
+ It should've been common sense on how to do this go on the server click the diary get the Chatbox Interface from the CMD go to ActionSender.java make a void add the void to login and your done. You just did something way stupider then me. ;-;
Who creates a new class for something your not even going to use alot?
Stacx
June 30th, 2011, 20:07
allright, people stop bitching about making new classes. if i was todo achievement diary i'd obviously make a new class for it, everybody has their style. also, @ OP, l2name methods lol "strings".
@ divine, you're an idiot, stop talking about classes since you have no idea why to use one.
class AchievementDiary {
interface Achievement {
Divine-X
June 30th, 2011, 20:16
allright, people stop bitching about making new classes. if i was todo achievement diary i'd obviously make a new class for it, everybody has their style. also, @ OP, l2name methods lol "strings".
@ divine, you're an idiot, stop talking about classes since you have no idea why to use one.
I actually do have an idea on why and how to use classes. It's much easier and smarter to just go to ActionSender.java and then make a void and then add it to login instead of making a class. And guess what "stacx" Not everyone cares about Java I actually don't give 2 shits about RSPS matter of fact I don't give a flying fuck about Java itself. I prefer cracking programs instead. And before you make another post towards me you should think do I really give a shit about Java?
P.S. Welcome to my Ignore List. :)
Sam23
June 30th, 2011, 20:16
Apache, i didnt rip it from tko so shush.
Stacx
June 30th, 2011, 20:24
I actually do have an idea on why and how to use classes. It's much easier and smarter to just go to ActionSender.java and then make a void and then add it to login instead of making a class. And guess what "stacx" Not everyone cares about Java I actually don't give 2 shits about RSPS matter of fact I don't give a flying fuck about Java itself. I prefer cracking programs instead. And before you make another post towards me you should think do I really give a shit about Java?
P.S. Welcome to my Ignore List. :)
And I have my doubts over that. Why would you have spent two weeks of your life to a runescape private server forum if you don't give a flying fuck about the subject?
Who creates a new class for something your not even going to use alot?
Your point is invalid, that's not why I would create a new class just to use it alot.
Sam23
June 30th, 2011, 20:26
The whole reason i created a new class, is because i was at the time going to handle everything in it etc, so i thought it saves taking up all the space in other classes, so divine, either learn how to create, and use a class in another file or gtfo trolling.
Divine-X
June 30th, 2011, 20:30
The whole reason i created a new class, is because i was at the time going to handle everything in it etc, so i thought it saves taking up all the space in other classes, so divine, either learn how to create, and use a class in another file or gtfo trolling.
It's amazing how I done that for my ClueScroll thing I got trolled & flamed. Even for the same reason like you I don't want to see clustered up shit.
@Stacx that's total time online all together smart ass. ;-; So ever since June 2010 to June 2011 I've been on for a total of 2weeks & 3days.
Sam23
June 30th, 2011, 20:32
Well at the end of the day, it doesnt matter weather or not its in its own class, it still works doesnt it? now gtfo.
Lukedawesome
June 30th, 2011, 20:35
Well at the end of the day, it doesnt matter weather or not its in its own class, it still works doesnt it? now gtfo.
Stacx is gonna tear your ass up for that.
Sam23
June 30th, 2011, 20:36
go away trolling ffs!
Stacx
June 30th, 2011, 20:40
It's amazing how I done that for my ClueScroll thing I got trolled & flamed. Even for the same reason like you I don't want to see clustered up shit.
@Stacx that's total time online all together smart ass. ;-; So ever since June 2010 to June 2011 I've been on for a total of 2weeks & 3days.
No shit it's the total time all togheter? Where did I claim it was not? And again, that was not my point, but why would you spend 2 weeks and 3 days on a rsps forum if you don't give a fuck about the subject. Also, the problem that your Clue scroll thing had was not the class, but the way you called it a "handler".
Divine-X
June 30th, 2011, 20:41
Well at the end of the day, it doesnt matter weather or not its in its own class, it still works doesnt it? now gtfo.
My comp. My Internet.
@OT: Good job. For your ActionButtonPacketHandler do the switch statement so instead of doing if (buttonId == 18) { or w/e just do.
case 18:
player.sm("You teleport to Godwars.");
player.getTele().telePlayer(player, 2871, 5318, 2, 2);
break;
Also if you don't want to use the switch statement use
else if instead of repeating if if if if if if if over and over again.
Sam23
June 30th, 2011, 20:43
Divine, i have no if if if if if shit for one, two, buttonId == ? does the same as case ?: so stfu and go away.
Divine-X
June 30th, 2011, 20:45
Divine, i have no if if if if if shit for one, two, buttonId == ? does the same as case ?: so stfu and go away.
Using a switch statement or using else if is better then if if if if if.
Edit: Shouldn't say better but easier.
Olook if if if if if shit. ;-;
case 259:
//Achievement Diary buttons.
if(buttonId == 15) {
player.sm("You teleport to Godwars.");
player.getTele().telePlayer(player, 2871, 5318, 2, 2);
}
if(buttonId == 16) {
player.sm("You teleport to Corp.");
player.getTele().telePlayer(player, 2966, 4383, 0, 2);
}
if(buttonId == 17) {
player.sm("You teleport to Tormented Demon.");
player.getTele().telePlayer(player, 2571, 5736, 0, 2);
}
if(buttonId == 19) {
player.sm("You teleport to Rock Crabs.");
player.getTele().telePlayer(player, 2710, 3710, 0, 2);
}
if(buttonId == 20) {
player.sm("You teleport to Yaks.");
player.getTele().telePlayer(player, 2310, 3782, 0, 2);
}
if(buttonId == 21) {
player.sm("You teleport to Slayer Tower");
player.getTele().telePlayer(player, 3429, 3538, 0, 0);
}
if(buttonId == 23) {//pure 50m
if(player.getInventory().contains(995, 50000000)) {
player.getActionSender().pureSet(player);
} else {
player.sm("You need 50m+ to buy this set!");
}
}
if(buttonId == 24) {//zerker 60m
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 60000000)) {
} else {
player.sm("You need 60m+ to buy this set!");
}
}
if(buttonId == 25) {//main 70m
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 70000000)) {
} else {
player.sm("You need 70m+ to buy this set!");
}
}
if(buttonId == 27) {
player.sm("You teleport to Clan Wars.");
player.getTele().telePlayer(player, 2812, 5511, 0, 2);
}
if(buttonId == 28) {
player.sm("You teleport to Mage Bank.");
player.getTele().telePlayer(player, 2539, 4716, 0, 0);
}
if(buttonId == 29) {
player.sm("You teleport to Pk Room.");
player.getTele().telePlayer(player, 3041, 3953, 0, 0);
}
if(buttonId == 30) {
player.sm("You open the Legacy-X point shop!");
GameEngine.shopHandler.openshop(player, 24);
}
case 259:
//Achievement Diary buttons.
if(buttonId == 15) {
player.sm("You teleport to Godwars.");
player.getTele().telePlayer(player, 2871, 5318, 2, 2);
} else if(buttonId == 16) {
player.sm("You teleport to Corp.");
player.getTele().telePlayer(player, 2966, 4383, 0, 2);
} else if(buttonId == 17) {
player.sm("You teleport to Tormented Demon.");
player.getTele().telePlayer(player, 2571, 5736, 0, 2);
} else if(buttonId == 19) {
player.sm("You teleport to Rock Crabs.");
player.getTele().telePlayer(player, 2710, 3710, 0, 2);
} else if(buttonId == 20) {
player.sm("You teleport to Yaks.");
player.getTele().telePlayer(player, 2310, 3782, 0, 2);
} else if(buttonId == 21) {
player.sm("You teleport to Slayer Tower");
player.getTele().telePlayer(player, 3429, 3538, 0, 0);
} else if(buttonId == 23) {//pure 50m
if(player.getInventory().contains(995, 50000000)) {
player.getActionSender().pureSet(player);
} else {
player.sm("You need 50m+ to buy this set!");
}
} else if(buttonId == 24) {//zerker 60m
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 60000000)) {
} else {
player.sm("You need 60m+ to buy this set!");
}
} else if(buttonId == 25) {//main 70m
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 70000000)) {
} else {
player.sm("You need 70m+ to buy this set!");
}
} else if(buttonId == 27) {
player.sm("You teleport to Clan Wars.");
player.getTele().telePlayer(player, 2812, 5511, 0, 2);
} else if(buttonId == 28) {
player.sm("You teleport to Mage Bank.");
player.getTele().telePlayer(player, 2539, 4716, 0, 0);
} else if(buttonId == 29) {
player.sm("You teleport to Pk Room.");
player.getTele().telePlayer(player, 3041, 3953, 0, 0);
} else if(buttonId == 30) {
player.sm("You open the Legacy-X point shop!");
GameEngine.shopHandler.openshop(player, 24);
}
case 259:
switch(buttonId){
//Achievement Diary buttons.
case 15:
player.sm("You teleport to Godwars.");
player.getTele().telePlayer(player, 2871, 5318, 2, 2);
break;
case 16:
player.sm("You teleport to Corp.");
player.getTele().telePlayer(player, 2966, 4383, 0, 2);
break;
case 17:
player.sm("You teleport to Tormented Demon.");
player.getTele().telePlayer(player, 2571, 5736, 0, 2);
break;
case 19:
player.sm("You teleport to Rock Crabs.");
player.getTele().telePlayer(player, 2710, 3710, 0, 2);
break;
case 20:
player.sm("You teleport to Yaks.");
player.getTele().telePlayer(player, 2310, 3782, 0, 2);
break;
case 21:
player.sm("You teleport to Slayer Tower");
player.getTele().telePlayer(player, 3429, 3538, 0, 0);
break;
case 23:
if(player.getInventory().contains(995, 50000000)) {
player.getActionSender().pureSet(player);
} else {
player.sm("You need 50m+ to buy this set!");
}
break:
case 24:
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 60000000)) {
} else {
player.sm("You need 60m+ to buy this set!");
}
break;
case 25:
player.sm("This is being added, please wait..");
if(player.getInventory().contains(995, 70000000)) {
} else {
player.sm("You need 70m+ to buy this set!");
}
break;
case 27:
player.sm("You teleport to Clan Wars.");
player.getTele().telePlayer(player, 2812, 5511, 0, 2);
break;
case 28:
player.sm("You teleport to Mage Bank.");
player.getTele().telePlayer(player, 2539, 4716, 0, 0);
break;
case 29:
player.sm("You teleport to Pk Room.");
player.getTele().telePlayer(player, 3041, 3953, 0, 0);
break;
case 30:
player.sm("You open the Legacy-X point shop!");
GameEngine.shopHandler.openshop(player, 24);
break;
I could be right I could be wrong.
Sam23
June 30th, 2011, 20:45
but i havnt used if if if if , i used it 2-3 times.
Sam23
June 30th, 2011, 20:46
here:
if(p.getRights() == 0) {
p.getActionSender().sendString("<col=ffffff>Rank: Player", 259, 4);
}else if(p.getRights() == 1) {
p.getActionSender().sendString("<col=ffffff>Rank: <img=0>Mod", 259, 4);
}else if(p.getRights() == 2) {
p.getActionSender().sendString("<col=ffffff>Rank: <img=1>Admin", 259, 4);
}
}
public static void checkDonator(Player p) {
if(p.donator == 1) {
p.getActionSender().sendString("<col=ffffff>Donator: <col=00cc00>[$]Yes.", 259, 3);
} else if(p.donator == 0 ) {
p.getActionSender().sendString("<col=ffffff>Donator: No.", 259, 3);
}
}
and i used else if on it so waii.
Sam23
June 30th, 2011, 20:59
Ahh well i like the way i did it, it still works efficiently..
Josh
June 30th, 2011, 21:15
Ahh well i like the way i did it, it still works efficiently..
No a switch is better...
Sam23
June 30th, 2011, 21:19
i like the way i did it go away.
Divine-X
June 30th, 2011, 21:42
i like the way i did it go away.
^^^^^^^^^^
Lol
Josh
June 30th, 2011, 21:46
Liking the way you did it != the best way to do it.
Sam23
June 30th, 2011, 22:56
Josh at the end of the day, does it work? yes, does it matter imo? no.
davidpaceway
June 30th, 2011, 23:14
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!! Why must you release this :(
Sam23
July 1st, 2011, 00:21
Cause people are leeching tko scape cause they cant do it them selfs :L
Nouish
July 1st, 2011, 00:44
What is this I don't even.
LETS MAKE A NEW CLASS FOR EVERYTHING!!! YAY!!
.. and?
Sam23
July 1st, 2011, 00:44
See he agrees :D ^^
MrConner
July 1st, 2011, 01:07
public static void checkRights(Player p) {
if(p.getRights() == 0) {
p.getActionSender().sendString("<col=ffffff>Rank: Player", 259, 4);
}else if(p.getRights() == 1) {
p.getActionSender().sendString("<col=ffffff>Rank: <img=0>Mod", 259, 4);
}else if(p.getRights() == 2) {
p.getActionSender().sendString("<col=ffffff>Rank: <img=1>Admin", 259, 4);
}
}
public static void checkDonator(Player p) {
if(p.donator == 1) {
p.getActionSender().sendString("<col=ffffff>Donator: <col=00cc00>[$]Yes.", 259, 3);
} else if(p.donator == 0 ) {
p.getActionSender().sendString("<col=ffffff>Donator: No.", 259, 3);
}
}
Should be switch/case, along with lots of other stuff. Otherwise, nice job, just stop being so procedural
@Sam23: You should be organizing more things with interfaces or abstract classes, as well as using packages to their best advantage, so you aren't creating an entire class for every new thing. Use inheritance where it can be used. He's right in every way.
The Only Cj
July 1st, 2011, 09:26
Nice RIP from TkoScape ;) btw got costum donator crown done on donator int and quest tab changed to green, yellow, red with own quests into it...
And your telling us becuase...?
SiniSoul
July 1st, 2011, 09:29
.. and?
I am also seeing this flaw in Lukes argument...
Sonicforce41
July 1st, 2011, 15:38
Thanks for this. Converting it to 614. (Dementhium)
Sam23
July 1st, 2011, 15:47
Aha np :D
David
July 1st, 2011, 16:43
No a switch is better...
Java-wise there's barely a different between if/else and switch/cases.
Sam23
July 1st, 2011, 17:26
Thankyou david.
MrConner
July 2nd, 2011, 18:35
Java-wise there's barely a different between if/else and switch/cases.
Erm....
Only the registered members can see the link.
There's actually quite a few that make quite a difference, but that's okay. If you're one of those people who doesn't care about code quality and flow, then yes, you'll be the kind of guy that prefers this:
if (x == 5864)
do();
else if (x == 528)
do();
else if (x == 234)
do();
else if (x == 444)
do();
else
do();
Over this:
switch (x)
{
case 5864:
case 528:
case 234:
case 444:
default:
do();
}
Clearly, there's quite a difference. If you want more examples, do ask.
David
July 2nd, 2011, 18:47
Erm....
Only the registered members can see the link.
There's actually quite a few that make quite a difference, but that's okay. If you're one of those people who doesn't care about code quality and flow, then yes, you'll be the kind of guy that prefers this:
if (x == 5864)
do();
else if (x == 528)
do();
else if (x == 234)
do();
else if (x == 444)
do();
else
do();
Over this:
switch (x)
{
case 5864:
case 528:
case 234:
case 444:
default:
do();
}
Clearly, there's quite a difference. If you want more examples, do ask.
Or this
if(x == 5864 || x == 528 || x == 234 || x == 444)
{
do();
}
And by the way, your example is a failure, since it ALWAYS performs the action, so there's no need for the x's.
Divine-X
July 2nd, 2011, 19:00
Or this
if(x == 5864 || x == 528 || x == 234 || x == 444)
{
do();
}
And by the way, your example is a failure, since it ALWAYS performs the action, so there's no need for the x's.
What about mine :c?
Cereal Guy
July 3rd, 2011, 03:04
inb4thethreadgetsofftopicbecuaseofthemajortrollism .
nuff said.
OT: Naice ;p but just make a void in actionsender. :l
MrConner
July 3rd, 2011, 04:13
Or this
if(x == 5864 || x == 528 || x == 234 || x == 444)
{
do();
}
And by the way, your example is a failure, since it ALWAYS performs the action, so there's no need for the x's.
I'm aware of that, it was simply an example. Go ahead and make it so different methods are used, I don't really care.
Overall, it's more or less a Java programming standards thing. People that only respect quality code organization and flow (i.e. most intelligent programmers) will hate on you for not using them each in their own proper situations, and with good reason. Switch/case was made for a reason, so you may as well respect that Sun added it into Java and use it appropriately.
So it's really just choice and habit, but it's generally a better idea to go with switch/case when the if/else statements start to clog and make code much longer than need be.
MrConner
July 3rd, 2011, 04:14
inb4thethreadgetsofftopicbecuaseofthemajortrollism .
nuff said.
OT: Naice ;p but just make a void in actionsender. :l
Why would you do that, exactly?
Hope
July 3rd, 2011, 18:52
Well its about time that some one stopped leeching TkoScape.
This doesn't stop leeching it? You just gave them the direct answer.
OwnsterChief
July 3rd, 2011, 23:44
This doesn't stop leeching it? You just gave them the direct answer.
Sam23 your such a dumass man.
MrConner
July 4th, 2011, 02:45
Sam23 your such a dumass man.
Tell the community something it doesn't know.
RS2009
July 4th, 2011, 02:56
Get over it, muppets.
Divine-X
July 5th, 2011, 16:47
Why would you do that, exactly?
Making a void in ActionSender is much simpler :i
public void Diary() {
p.getActionSender().sendString("<img=1><col=66ff00>Server name", 259, 0);
p.getActionSender().sendString("<col=0066cc>Stats:", 259, 1);
p.getActionSender().sendString("<col=ffffff>Name: " + p.getUsername() + ".", 259, 2);
checkDonator(p);
checkRights(p);
p.getActionSender().sendString("<col=ffffff>Legacy Points: " + p.legacyPoints + ".", 259, 5);
p.getActionSender().sendString("<col=0066cc>Teleports: ", 259, 6);//
p.getActionSender().sendString(" ", 259, 7);
p.getActionSender().sendString("<img=1><col=66ff00>Server name<img = 1>", 259, 8);
p.getActionSender().sendString("<col=6699cc><b>Info:</b>", 259, 10);//Info
p.getActionSender().sendString("<col=ffffff>Owner: <img=1><col = cc0000>Shadow Fita", 259, 11);
p.getActionSender().sendString("<col=ffffff>Co-Owner: <img=1><col = cc0000>Sam", 259, 12);
p.getActionSender().sendString("<col=cc0000>Never Ask For Staff!", 259, 13);
p.getActionSender().sendString("<col=6699cc>Bosses: ", 259, 14);
p.getActionSender().sendString("<col=ffffff>Godwars", 259, 15);
p.getActionSender().sendString("<col=ffffff>Corp", 259, 16);
p.getActionSender().sendString("<col=ffffff>Tormented Demon", 259, 17);
p.getActionSender().sendString("<col=6699cc>Training:", 259, 18);// Train commands
p.getActionSender().sendString("<col=ffffff>Crabs", 259, 19);
p.getActionSender().sendString("<col=ffffff>Yaks", 259, 20);
p.getActionSender().sendString("<col=ffffff>Slayer Tower", 259, 21);
p.getActionSender().sendString("<col=6699cc><b>Pvp Sets:</b>", 259, 22);// pk sets..
p.getActionSender().sendString("<col=ffffff>Pure: <col=00cc00>50m", 259, 23);
p.getActionSender().sendString("<col=ffffff>Zerker:<col=00cc00> 60m", 259, 24);
p.getActionSender().sendString("<col=ffffff>Main: <col=00cc00>70m", 259, 25);
p.getActionSender().sendString("<col=6699cc>Pvp:", 259, 26);
p.getActionSender().sendString("<col=ffffff>Clan Wars", 259, 27);
p.getActionSender().sendString("<col=ffffff>Mage Bank", 259, 28);
p.getActionSender().sendString("<col=ffffff>Pk Room", 259, 29);
p.getActionSender().sendString("<col=ffffff><img=1>Legacy-X Points Shop<img=1>", 259, 30);// coming soon text
}
That's his thing didn't bother changing P to player ;-; then when your done adding the void go to the login stuff and add Diary(); Save & compile.
I'm curious about the red part. ;-; Did you actually write the stuff? Or did you download a server, made a class, C&P? ;-;
RS2009
July 5th, 2011, 17:04
No ask shadow fita, we made a server called legacy x, well... started, but then we figured it was allready a server, then couldnt be assed ccontinuing project lol.
MrConner
July 6th, 2011, 02:41
Making a void in ActionSender is much simpler :i
public void Diary() {
p.getActionSender().sendString("<img=1><col=66ff00>Server name", 259, 0);
p.getActionSender().sendString("<col=0066cc>Stats:", 259, 1);
p.getActionSender().sendString("<col=ffffff>Name: " + p.getUsername() + ".", 259, 2);
checkDonator(p);
checkRights(p);
p.getActionSender().sendString("<col=ffffff>Legacy Points: " + p.legacyPoints + ".", 259, 5);
p.getActionSender().sendString("<col=0066cc>Teleports: ", 259, 6);//
p.getActionSender().sendString(" ", 259, 7);
p.getActionSender().sendString("<img=1><col=66ff00>Server name<img = 1>", 259, 8);
p.getActionSender().sendString("<col=6699cc><b>Info:</b>", 259, 10);//Info
p.getActionSender().sendString("<col=ffffff>Owner: <img=1><col = cc0000>Shadow Fita", 259, 11);
p.getActionSender().sendString("<col=ffffff>Co-Owner: <img=1><col = cc0000>Sam", 259, 12);
p.getActionSender().sendString("<col=cc0000>Never Ask For Staff!", 259, 13);
p.getActionSender().sendString("<col=6699cc>Bosses: ", 259, 14);
p.getActionSender().sendString("<col=ffffff>Godwars", 259, 15);
p.getActionSender().sendString("<col=ffffff>Corp", 259, 16);
p.getActionSender().sendString("<col=ffffff>Tormented Demon", 259, 17);
p.getActionSender().sendString("<col=6699cc>Training:", 259, 18);// Train commands
p.getActionSender().sendString("<col=ffffff>Crabs", 259, 19);
p.getActionSender().sendString("<col=ffffff>Yaks", 259, 20);
p.getActionSender().sendString("<col=ffffff>Slayer Tower", 259, 21);
p.getActionSender().sendString("<col=6699cc><b>Pvp Sets:</b>", 259, 22);// pk sets..
p.getActionSender().sendString("<col=ffffff>Pure: <col=00cc00>50m", 259, 23);
p.getActionSender().sendString("<col=ffffff>Zerker:<col=00cc00> 60m", 259, 24);
p.getActionSender().sendString("<col=ffffff>Main: <col=00cc00>70m", 259, 25);
p.getActionSender().sendString("<col=6699cc>Pvp:", 259, 26);
p.getActionSender().sendString("<col=ffffff>Clan Wars", 259, 27);
p.getActionSender().sendString("<col=ffffff>Mage Bank", 259, 28);
p.getActionSender().sendString("<col=ffffff>Pk Room", 259, 29);
p.getActionSender().sendString("<col=ffffff><img=1>Legacy-X Points Shop<img=1>", 259, 30);// coming soon text
}
That's his thing didn't bother changing P to player ;-; then when your done adding the void go to the login stuff and add Diary(); Save & compile.
I'm curious about the red part. ;-; Did you actually write the stuff? Or did you download a server, made a class, C&P? ;-;
1. You're using C# conventions....omfg....
2. I don't really see how an entire Achievement Diary impl has good enough relevance to the class. You're doing something entirely because it's easier?
Divine-X
July 12th, 2011, 23:30
1. You're using C# conventions....omfg....
2. I don't really see how an entire Achievement Diary impl has good enough relevance to the class. You're doing something entirely because it's easier?
Noob I didn't bother fixing anything because I didn't want to type that all out and + I said that's his not mine.
Also I made the void in the ActionSender because it's much simpler then making a new class. -.-
Read first before posting fucking twat. .-.
Powered by vBulletin® Version 4.1.9 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.