Jump to content

mytuo

Members
  • Posts

    3
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

About mytuo

Profile Information

  • Gender
    Not Telling
  • Country
    Afghanistan

mytuo's Achievements

Newbie

Newbie (1/16)

  • First Post Rare

Recent Badges

1

Reputation

  1. I appreciate all the attention guys :) Honestly I'm new to Java, that's true and I'm trying to debug the automatic donation system from l2 packs like ava mythras etc. The project is totally local, no publishing, no selling, just wanna get it done. I got to tweaking the source java to : public static void decode(Message msg) throws Exception { Object msgCont = msg.getContent(); String from = msg.getFrom()[0].toString(); String str = msgCont.toString(); String[] strs = str.split("\n"); if (strs[2].startsWith("This email confirms that you have received a donation of") && strs[2].contains("EUR")) { Main.handleDonation("Paypal", strs[2].split("\\)")[0].split("\\(")[1], str.split("Confirmation number: ")[1].substring(0, 17), (int)Double.parseDouble(strs[2].substring(57, strs[2].indexOf(" EUR")))); return; } System.out.println("[FATAL] Corrupted donation from:\n->" + from + " (Please check this eMail)"); } However I still get the exception about the corrupted donation. The system goes into my mailbox, reads the mail but it doesn't decode it correctly. The e-mails come in like this : and my understanding is that the 3rd line is exactly what it should be. The function does not even go to Main.handleDonation, it dies at if (strs[2].startsWith, so it must not recognize the text correctly I'm struggling alone on this for 2 days now. Thanks again to people wanting to help :) :D
  2. Hi guys, I have a code snippet here: String str = msgCont.toString(); String[] strs = str.split("\n"); if (strs[2].startsWith("partofthemessage") && strs[2].contains("x")) { Main.handleDonation("y", strs[2].split("\\)")[0].split("\\(")[1], str.split("xx: ")[1].substring(0, 17), (int)Double.parseDouble(strs[2].substring(57, strs[2].indexOf(" x")))); "); Will someone care to explain if : String[] strs = str.split("\n"); if (strs[2] means the second string of the msg content? Thanks!
×
×
  • Create New...