Page 1 of 2

Start Learning java

Posted: Thu Feb 06, 2014 12:08 am
by Gries
Hello, from what i could start to learn java language? I heard creating voice commands or so.


P.S Never studied it before or anything like, i have totally no experience with it.

Re: Start Learning java

Posted: Thu Feb 06, 2014 9:47 am
by jurchiks
Read core code, try to understand it.
Watch some java intro videos like this for some explanations, google other stuff: http://www.youtube.com/watch?v=Cfd9DOnuF9w

Re: Start Learning java

Posted: Thu Feb 06, 2014 7:50 pm
by DrHouse
Gries wrote:Hello, from what i could start to learn java language? I heard creating voice commands or so.


P.S Never studied it before or anything like, i have totally no experience with it.
Yes, voice commands it is a good start, but assuming you don't have any experience on coding you should spend some time previously on understanding how object-oriented programming languages work and getting familiar to java sintaxis. I would recommend following official java tutorial, it is quite enough for the beginning. You can also get almost any java book and read those chapters about java essentials.

Following this path you will get the required knowledge to understand the basic stuff of our sources, plus you will be able to tweak and modify what is written and also to create some scripts based on what you have seen: command handlers in the beginning, SQL queries, npc and skill/effect handlers later on.

After mastering the basics, your next logical step would be to start reading about more advanced stuff belonging to the high level programming layer typical features, like threading and I/O (specially networking). You will then understand a rather considerable percentage of our source and you will have also a decent understanding of the java language itself. I would recommend Dough Lea's book on threading ("Concurrent programming in Java") and almost any paper on basic and advanced networking patterns.

Re: Start Learning java

Posted: Sat Feb 08, 2014 3:31 pm
by Gries
Thx all, started making something:

Code: Select all

            else if (player.isInOlympiadMode())            {                mpRegenMultiplier *= 1.5; // Olympiad Mode            }            else if (player.isInCombat())            {                mpRegenMultiplier *= 2.5; // Combat Mode            }
Any error/or another way to do it better?
Also have tried to search something while player is flagged, but couldn't find anything :|

Re: Start Learning java

Posted: Sat Feb 08, 2014 3:41 pm
by St3eT
For check flag you can use:

Code: Select all

                     if (player.getPvpFlag() != 0)                    {                        player.sendMessage("Ugly and bad boy! you are flagged :( again kill any newbie, eh? NOOOOB!");                    } 

Re: Start Learning java

Posted: Sat Feb 08, 2014 3:44 pm
by xban1x
Maybe try simpler voice commands like: ".title <STRING>"

Re: Start Learning java

Posted: Sat Feb 08, 2014 5:38 pm
by Gries
xban1x wrote:Maybe try simpler voice commands like: ".title <STRING>"
Like this?

http://pastebin.com/AQ9PTLtJ

Re: Start Learning java

Posted: Sat Feb 08, 2014 6:10 pm
by Sdw
The title is sent through params

Re: Start Learning java

Posted: Sun Feb 09, 2014 10:56 am
by xban1x
Sdw wrote:The title is sent through params
Exactly, other then that Gries it is perfectly fine.

Re: Start Learning java

Posted: Sun Feb 09, 2014 11:53 am
by Sdw
No, Its still missing a little something :)

Re: Start Learning java

Posted: Sun Feb 09, 2014 11:56 am
by xban1x
Sdw wrote:No, Its still missing a little something :)
He didn't register it in MasterHandler.java yes. But other then that command itself works fine.

Re: Start Learning java

Posted: Sun Feb 09, 2014 12:55 pm
by Sdw
Broadcast something maybe ?

Re: Start Learning java

Posted: Sun Feb 09, 2014 1:09 pm
by xban1x
Sdw wrote:Broadcast something maybe ?
I usually don't add broadcast for things like this. It will be updated when he relogs or at some other occassion. No need for spamming.

Re: Start Learning java

Posted: Sun Feb 09, 2014 1:47 pm
by Gries
xban1x wrote:
Sdw wrote:The title is sent through params
Exactly, other then that Gries it is perfectly fine.
What you mean?

Re: Start Learning java

Posted: Sun Feb 09, 2014 3:10 pm
by Sdw
xban1x wrote:
Sdw wrote:Broadcast something maybe ?
I usually don't add broadcast for things like this. It will be updated when he relogs or at some other occassion. No need for spamming.
My players expect it asap. A broadcasttitleinfo wont do any harm once in a while.