XeloXoft - Everything is possible
Hello!
Before going any further, please register!
There is no E-Mail Validation so it only takes half a minute.
Thanks for your visit, and have fun Smile
//Xeloader
XeloXoft - Everything is possible
Hello!
Before going any further, please register!
There is no E-Mail Validation so it only takes half a minute.
Thanks for your visit, and have fun Smile
//Xeloader
XeloXoft - Everything is possible
Would you like to react to this message? Create an account in a few clicks or log in to continue.
XeloXoft - Everything is possible


 
PortalPortal  HomeHome  SearchSearch  Latest imagesLatest images  RegisterRegister  Log inLog in  

 

 [503+] Commands Tutorial~

Go down 
2 posters
AuthorMessage
xeloader
Creator & Owner
Creator & Owner
xeloader


Number of posts : 326
Age : 31
Programming Skill :
[503+] Commands Tutorial~ Left_bar_bleue25 / 10025 / 100[503+] Commands Tutorial~ Right_bar_bleue

Programming Languages : VB.net, Java [A little], HTML.
Registration date : 2008-07-08

[503+] Commands Tutorial~ Empty
PostSubject: [503+] Commands Tutorial~   [503+] Commands Tutorial~ Icon_minitimeTue Dec 30, 2008 11:19 pm

Hello everyone! Smile
Got some requests and questions about commands... So to help you all out, here's a "lesson" and "spoonfeeding" at the same time XD

Requirements:
- Notepad, or another texteditor.
- A Runescape 503+ server! For example, XeloXoft.
- A brain xD

Let's start!

1. Player Rights

- Open up Commands.java, in "[508] XeloXoft> Server > Src > Palidino76 > rs2 > io > packets > Commands.java"

- You will find something like this if you scroll down:

if (p.rights >= 0) {
/**User Commands**/

- Let's start with this part, p.rights >= 0. That little bit of code, makes so all the lines of code inside the "brackets" (You will get it in the next chapter) can be used by ordinairy accounts and higher.

Here's a table just to show you.

p.rights >= 0 = Ordinairy accounts and higher accounts.
p.rights == 0 = Only ordinairy accounts.
p.rights <= 1 = Moderator accounts and lower accounts.

Ints:
Admin = 2
Moderator = 1
Normal = 0
NOTE: Of course you can change the numbers to other rights, this was just to show you. If you didn't understand the table, just check the bolded symbols again. You will get it after a couple of minutes.


2. Brackets

The brackets -> "{" and "}" are really important in Java programming, in C++ and C# too. But this is java... Smile This is kinda tricky to explain but i will do my best!
The brackets are the "fence", ye fence Razz
You will think like "WTF", and of course this is really tricky. But when you get it, you are a footstep closer to program in java! Smile

Let's say, i have a bit of code here:

if (p.rights == 0) {
titles = "<img=3>";
colors = "<col=6374B5>";
}

- You see the brackets? Good... You see, it's like surrounding the code? It's "making" the code.
Like a fence, without the fence your sheeps will run away. It's the same with the code, without the brackets your code will "run" away and be compiled at another place. (Did i really come up with that myself? I'm a poet xD haha..)
Wich will lead to alot of errors (in most of the cases).

For example:
if (p.rights == 0)
titles = "<img=3>";
colors = "<col=6374B5>";

- Now it's without the brackets and the code will "run away" to the next bit of code. (i know it won't happen anything with this bit of code, but still. I'm just here to help! Smile )
So as I said in the "Player Rights" chapter. The p.rights == 0) { does have two brackets, and both of them are "connected" to each other sorrounding the code.
A great way to save alot of space in your command file.
Read this many times, and if you still don't understand. Send me a pm or a mail, OR talk to me on msn. Smile


3. The command

I think you are kinda bored of reading all this.. And are very excited to make a command? Right? Razz So, there are alot of different commands, ::pure (Gives you pure stuff, ::tele (Teleports you), ::master (all skills 99) and ::pickup (Gives you the item you type in).
That's the most common commands. But, if a server doesn't have those commands? affraid You need to make them yourself, right? I'm going to teach you some of the code inside them. Smile

- Now when you are in your commands.java file, and you know what brackets are, and what they do? Good, and you know where to put your commands if you want it to be used by admins only, or moderaotrs and lower and so on.. cheers

Here's an example of what a command could look like:
else if (cmd[0].equals("godwars"))
{
p.teleportTo(2881, 5310, 2, 4, 0, 8939, 8941, 1576, 0, 1577, 0);
p.frames.showInterface(p, 255);
p.frames.setString(p, "Welcome to the Godwars! During the third age, the gods fought one final war over the possesion of a sword... A mighty sword, they call it a godsword. Now it's your turn to change the history, get your hands on a godsword and be the greatest warrior of them all!", 255, 3);
p.frames.sendMessage(p, "Type ::gods for more information about the gods!");
}

- This command, ::godwars will tele you to the godwars dungeon and send you a interface with a "string" (text) on and send you a message in the Chatbox.
Here's a table to split up the code, and tell you what they all do. Smile
else if (cmd[0].equals("godwars"))This is your text to type, when you are ingame. like this one is ::godwars, but if you change "godwars" into "xeloader" and you type ::xeloader ingame, you will be teleported into godwars dungeon. So the text is the command Smile The rest isn't that important for now!
p.teleportTo(2881, 5310, 2, 4, 0, 8939, 8941, 1576, 0, 1577, 0);2881 is the X coord, 5310 is Y coord and 2 is the heightlevel. The rest of them are Teleport variables, timers, gfx and animations, so don't touch them if you don't know what you are doing.
p.frames.showInterface(p, 255);
p.frames.setString(p, "Welcome to the Godwars! During the third age, the gods fought one final war over the possesion of a sword... A mighty sword, they call it a godsword. Now it's your turn to change the history, get your hands on a godsword and be the greatest warrior of them all!", 255, 3);
This is the Interface that pops up when you use the ::godwars command. 225 is the interface ID, p.frames is the "path" to the frames. It's not so much to tell you about this, it's easier to learn yourself. Smile
p.frames.sendMessage(p, "Type ::gods for more information about the gods!");This sends you the message in the Chatbox, Change the text inside the "" to change the text that's getting sent.
AND
Back to top Go down
https://xeloader.darkbb.com
Masterchef
Moderator
Moderator
Masterchef


Number of posts : 61
Programming Skill :
[503+] Commands Tutorial~ Left_bar_bleue0 / 1000 / 100[503+] Commands Tutorial~ Right_bar_bleue

Registration date : 2008-12-18

[503+] Commands Tutorial~ Empty
PostSubject: Re: [503+] Commands Tutorial~   [503+] Commands Tutorial~ Icon_minitimeSun Jan 11, 2009 12:03 am

Thanks, I needed this for my server Smile.
Post the Tutorial for the commands like
"::3rdage" "::godswords" in a new topic.
And a way to "Compile" because i cannot find the "Compile" file.

Thanks

//Masterchef
Back to top Go down
http://xeloader.co.nr/
xeloader
Creator & Owner
Creator & Owner
xeloader


Number of posts : 326
Age : 31
Programming Skill :
[503+] Commands Tutorial~ Left_bar_bleue25 / 10025 / 100[503+] Commands Tutorial~ Right_bar_bleue

Programming Languages : VB.net, Java [A little], HTML.
Registration date : 2008-07-08

[503+] Commands Tutorial~ Empty
PostSubject: Re: [503+] Commands Tutorial~   [503+] Commands Tutorial~ Icon_minitimeSun Jan 11, 2009 5:43 pm

No problem.
I will try to fix it as soon as possible!
Just got home from a camp so Razz
C ya
//Xeloader
Back to top Go down
https://xeloader.darkbb.com
Masterchef
Moderator
Moderator
Masterchef


Number of posts : 61
Programming Skill :
[503+] Commands Tutorial~ Left_bar_bleue0 / 1000 / 100[503+] Commands Tutorial~ Right_bar_bleue

Registration date : 2008-12-18

[503+] Commands Tutorial~ Empty
PostSubject: Re: [503+] Commands Tutorial~   [503+] Commands Tutorial~ Icon_minitimeSun Jan 11, 2009 5:57 pm

alright Smile thanks

//chef
Back to top Go down
http://xeloader.co.nr/
Sponsored content





[503+] Commands Tutorial~ Empty
PostSubject: Re: [503+] Commands Tutorial~   [503+] Commands Tutorial~ Icon_minitime

Back to top Go down
 
[503+] Commands Tutorial~
Back to top 
Page 1 of 1
 Similar topics
-
» Any tutorial for 503+ full range?

Permissions in this forum:You cannot reply to topics in this forum
XeloXoft - Everything is possible :: Private Server Developement :: Runescape Servers :: [503] Servers, Clients :: Tutorials-
Jump to: