Jump to content

melron

Legendary Member
  • Posts

    1,399
  • Credits

  • Joined

  • Last visited

  • Days Won

    27
  • Feedback

    0%

Everything posted by melron

  1. use //social <id> to see them with live preview
  2. Give to anyone the opportunity to have the ability to edit a topic/post of another member for various reasons. Based on a recent topic that i saw, the topic creator pasted a long code with bad spaces etc and it was really unreadable. So, i have two options. Reply with (my spam) 'move it to pastebin' Do not reply at all (because i wont open my ide, paste the code, format the spaces, find the solution for 1 topic. It would be nice if an option would be there to edit the content while when the 'save' action will take place, it would not save it directly, but the topic creator will get a notification that will inform him about a content change request from X (and a view panel with the changes) with 2 actions. Allow , Discard. Increase a value or something (that has to be visible like reputation) whenever a post is upvoted. I dont mean the reactions. I mean the up arrow just next to profile avatar icon in a topic. What's the purpose of that? I cant even remember the last time someone used that ability. its useless as it is right now, but with a few additions it could be very nice feature. Select best answer (suggestion for mods) and not locking the topic without a post is selected as best answer. Many of the topics have answers on that and instead of selecting one of them as a best answer, they just get what they want and close the broswer. Why not a moderator selecting that answer. @Maxtor
  3. I guess its possible. Νevertheless i'm not into client editing. Maybe some client devs could answer that @Asuki. The fact that all these years it hasn't be replaced with something else like discord, it means it will be pain in the ass. Edit: Actually @xdem could give you some directions
  4. Hi folks, some time has passed since my last share so, i decided to share with you a pretty basic communication between l2 and discord. Q&A Do i need to download external libraries? Yes, you need the JDA-4.3.0_310-withDependencies.jar library to be implemented at your sources What is currently implemented on this code? Well, there are 3 features that i have implemented: Whenever a player logs in, the discord bot will send him a Private Message containing the IP Address from which this action was performed . Whenever a grand boss dies, the bot will send a message in a channel (currently #raid-died) with some images,last hit,clan,respawn time etc. Currently, only Baium is implemented with images. You can add the rest at the ImageContent enum. Whenever a player is DiscordLegend (you have to think how a player would get that status) and says something in shout or trade, the bot will also write the same text at the shout, trade channels. (You can play with those channels and think of something smart) How will the bot recognize the discord profile of a member and send him a pm? Where is the profile id located in discord? You have to create your own method for that. In the previews, i have add manually MY id to do the tests. You can add custom html message that would be optional and request from users to enter their discord ID in order to get notifications etc. The ID is not the one that is after the hash (#) . You have to go at My Account tab, and click at the 3 dots that are located just after your name#id by pressing CopyID. (i would say that is a long value and not Integer.) How can i add my own image for a grand boss death feature? Just upload it somewhere (or even on your own website) and pass that url at the ImageContent enum which is located in GrandBossDeath class. Wont that spamming the whole discord with all those notifications? Well, actually no, its in your hand to handle WHEN the bot should say something. What is bot? And how can i create it? Well, you should go at youtube and watch some tutorials for that. If you dont know what is it just dont implement the code. I have my own bot, how can i make my bot do this job? Thats nice, all you have to do is to fill the BOT_TOKEN variable in Discord class with your bot token. What's the purpose of the channel messages of transactions? Well, plenty of discord servers have their own channels with trade transactions and many of them are using it to announce a transaction (wts,wtb). It's very convenient, players can see who is selling or buying what without even being ingame. Some previews: Login activity: Shout & Trade notification: Raid killed notification: Will you support that in the future? No. It took me about 2 weeks to create it while the whole code can be written in 2 days of 3 hours of work per day. My time is limited. In which acis rev can be implemented? Its java. a few adaptions and you're done. Can i add it to l2jfrozen? Read one bullet above. What else could be added to that one? I can't find any idea. Well your imagination sucks. Like mine . BUT! I'll give you an example that is not implemented in the source code. The result of This code is that one: Source code Also, be kind if you find mistakes in the code, as humans we make mistakes... Have fun!
  5. Use directly Rnd.get(array) for a random element public static final <T> T get(T[] array)
  6. Thanks for sharing. If you wrote this code, could you explain your thought about this line? doCast(SkillTable.getInstance().getInfo(4143, Math.min(10, Math.round(4143 / 10)))); i mean the 2nd parameter of getInfo method. There isn't any dynamic data there and it will always return 10 as level. Whats its purpose?
  7. Thanks for sharing. You should also consider to update the whole code style with the new tools that java is offering.
  8. Every person can watch a 20 min video and create the MOST UNIQUE SERVER . Then, they facing the problem of 'too many servers' and they have to pay clans to join them. Then, the 2nd problem comes up! Another server also paid the paid clans and suddenly, the online count, from 250 is falling to 50 while the '50' users are saying "Server is dead go to next one". 2 Facts here: 1) What if the clan payment 'thing' just stop? What would happen? 2) What if the process of a server creation could have anti-noob system? What would happen?
  9. Τρολλαρω ρε relax
  10. Μου εμφανίζει Syntax error on token "instanceof", delete this token αφού γράψω αυτό if (instanceof activeChar != null) { } Γιατί???
  11. Do you have mental health problems? For real dude...
  12. Σου είπα... iText
  13. This is exactly what you asked at your main post :D. try to import encodings import encodings if does not work too, you have two options. install python on your computer to have access at the encodings folder in order python will read them from your program files delete that script and do it via java
  14. change the encode() to encode('utf-8') and check it
  15. - elif nick.startswith("[ADM]") or nick.startswith("[GM]") or nick.startswith("[EGM]") or nick.startswith ("[HGM]") or nick.startswith("[DL]") or nick.startswith("-") or nick.startswith("<"): + elif nick.startswith("[ADM]") or nick.startswith("[GM]") or nick.startswith("[EGM]") or nick.startswith ("[HGM]") or nick.startswith("[DL]") or nick.startswith("-") or nick.startswith("<") or not nick.encode().isalpha():
  16. Sorry root, but your words are not corresponding to your code. An OOP style is complete different than this code. Actually is the opposite. In the other hand, i finding useless and pointless the atomic boolean. Explain me your thought up there, if you dont have that boolean and make it like this: if (TIMESTAMP < System.curentTimeMilliseconds()) { TIMESTAMP = System.curentTimeMilliseconds() + 60000L; // get data from DB here, build HTML text and save into HTML_TEXT field. } What would be the problem? As i mentioned before and aggreed about the 2nd change of stinky's code, that would be a solution too. I personally, didn't want to be the smart guy with the better code if you see my previous posts, but tried to optimize the code with a different way of coding. instead of timestamps i preferred to use classes to do the job. And about the performance you mentioned, we dont have to look the hardware and compare the speed, but the code itself. btw, i would love to see your script completed and see how you will feed the 'string' but also, the way of 'resetting' that string. You tried to simplify it but you created another spaces
  17. I would prefer to see some examples from your side by showing why you prefer that way instead of synchronize. To be honest, ive never used it in l2 scene but im using it a lot in my work. I'll show you an example. Lets say we have some dozens requests per minute from random users and the 'main' method that will be executed is the method named 'test' private void test(User user) { doSomething1(user); doSomething2(user); startUpdating(user); // here we need to prevent any other user to execute this method doSomething3(user); doSomething4(user); doSomething5(user); stopUpdating(user); // until this method take place. When that ends, we release the locked object. doSomething6(user); doSomething7(user); } As you can see, here, is a perfect example to use ReentrantLock just because we will start the lock case in 'startUpdating' and unlock in 'stopUpdating' while all the other users will stay at 'doSomething2' but also, the main user will continue on 3,4,5 methods and finally will be released after the stopUpdating method is fired. By using synchronize on the method structure or even with keyword and brackets {obj} , will cause big problems. We also using it just to lock something for a specific time periods. All i want to say is, its just 'too much' for this example.. Ofc it could work but again, is too much... Actually this is exactly what ReentrantLock is doing with its own way, with the main difference that you can 'prevent' the infinitely synchronization of the sync keyword which in this example would never happen. You can let it as it is, you wont have problems with that change of the 2nd pastebin. Nonetheless i said the same thing about the TP just in another manager. Im posting an optimized version of your code with my style with the difference that i used the same manager . Also, you dont have to care so much about the objects that have to be created up on the player's request just because it is java... GC is there... https://pastebin.com/NukMRMgj
  18. - public void showRakingList(Player player) + public synchronized void showRakingList(Player player) @Zake ReentrantLock is a bad way to solve this 'problem' and does not need to be placed here for many reasons. Indeed, it might be show different html content rarely even while StringBuilder is way faster than StringBuffer cause is fat since is syncing all of its methods, but all you have to do, is an object synchronization (if stinky still want to keep it as it is) but not by using the reentrantLock here, in this case... @StinkyMadness I would do the whole thing a bit different, like a manager which will storing the infos in custom classes and generate the content directly up on the player's request with a FloodProtector check. No sync at all
  19. A scam is a term used to describe any fraudulent business or scheme that takes money or other goods from an unsuspecting person. I think you should STFU.
  20. <skill id="3081" levels="10" name="Item Skill: Charm"> <table name="#chance"> 2 2 2 3 3 3 4 4 5 5 </table> <table name="#triggeredLevel"> 1 2 3 4 5 6 7 8 9 10 </table> <set name="target" val="SELF" /> <set name="skillType" val="BUFF" /> <set name="operateType" val="PASSIVE" /> <set name="chanceType" val="ON_HIT" /> <set name="reuseDelay" val="30000" /> <set name="activationChance" val="#chance" /> <set name="triggeredId" val="5165" /> <set name="triggeredLevel" val="#triggeredLevel" /> </skill> The rest is up to you
×
×
  • Create New...