How to Auto Announce

Results 1 to 13 of 13
  1. #1
    [B]aSH nofxpunkerbrian is offline
    MemberRank
    Apr 2009 Join Date
    1,151Posts

    How to Auto Announce

    This requires Iweb but its cool to use.

    Simply Create a .jsp file in your iweb folder with the following contents:

    Code:
    <%@page contentType="text/html; charset=GBK"%>
    <%@page import="java.lang.*"%>
    <%@page import="java.util.*"%>
    <%@page import="java.text.*"%>
    <%@page import="org.apache.commons.lang.StringEscapeUtils"%>
    <%@page import="protocol.*"%>
    <%@page import="com.goldhuman.auth.*"%>
    <%@page import="com.goldhuman.util.*"%>
    <%@page import="org.apache.commons.logging.Log"%>
    <%@page import="org.apache.commons.logging.LogFactory"%>
    <%@page import="java.io.*"%>
    <%@page import="java.sql.*"%>
    <%
    	//
    	// Coded by [B]aSH from Vendetta Gaming Network.
    	// 
    String msg = "PUT ANNOUNCEMENT HERE";
    try {
    	protocol.DeliveryDB.broadcast((byte)9,-1,msg);
    }
    catch (Exception e)
    {
    	out.println("<font color=red>Error Attempting to Broadcast Message!</font>");
    }	
    %>
    <%
    out.println("<font color=green>Successfully Sent Broadcast Message!</font>");
    %>
    Then Create a cron directing to your .jsp to tick whenever you want it to.

    Restart your Java service so it works and there you go :)


  2. #2
    Enthusiast angel2108 is offline
    MemberRank
    Aug 2009 Join Date
    47Posts

    Re: How to Auto Announce

    Great guide Bash love it, but is there a way to have it announce more than just one msg at a time?

    I want to get it to announce a few server rules every 45 minutes.

    iv already got it auto refreshing just i can not figure out how to get more than one announce without cloning the script 5 times >.<

  3. #3
    [B]aSH nofxpunkerbrian is offline
    MemberRank
    Apr 2009 Join Date
    1,151Posts

    Re: How to Auto Announce

    Yea its possible, Ill write something for u tomorrow and show you.

  4. #4
    Enthusiast angel2108 is offline
    MemberRank
    Aug 2009 Join Date
    47Posts

    Re: How to Auto Announce

    Thanks Bash. ^^ BTW I'm Arthur on your MSN.

  5. #5
    [B]aSH nofxpunkerbrian is offline
    MemberRank
    Apr 2009 Join Date
    1,151Posts

    Re: How to Auto Announce

    Alright cool.

    Ill sort u out a script and release it to everyone.

  6. #6
    Love MMORPG!! asreinna is offline
    MemberRank
    Sep 2008 Join Date
    AsiaLocation
    243Posts

    Re: How to Auto Announce

    some problem here...only 100 characters shown...including 'space'

  7. #7
    Member PWReadyGO is offline
    MemberRank
    Jul 2010 Join Date
    BrazilLocation
    53Posts

    Re: How to Auto Announce

    Quote Originally Posted by angel2108 View Post
    Great guide Bash love it, but is there a way to have it announce more than just one msg at a time?

    I want to get it to announce a few server rules every 45 minutes.

    iv already got it auto refreshing just i can not figure out how to get more than one announce without cloning the script 5 times >.<
    I want it too, [B]ash. Tnx!

  8. #8
    Omega 343 is offline
    MemberRank
    Oct 2009 Join Date
    Ancient DGN CTYLocation
    5,514Posts

    Re: How to Auto Announce

    I tossed this together as another package for everyone:

    MEGAUPLOAD - The leading online storage and file delivery service

    Put directories in their respective places.

    Then, if you need any assistance; start tomcat, then navigate a web browser to:

    http://your_server_ip:8080/pwAdmin/AA

  9. #9
    Apprentice egortar is offline
    MemberRank
    Jul 2010 Join Date
    EarthLocation
    21Posts

    Re: How to Auto Announce

    Nice, it was really useful for me.. thx

  10. #10
    Love MMORPG!! asreinna is offline
    MemberRank
    Sep 2008 Join Date
    AsiaLocation
    243Posts

    Re: How to Auto Announce

    done...

  11. #11

    Re: How to Auto Announce

    Change:
    String msg = "PUT ANNOUNCEMENT HERE";
    to:
    String msg = request.getParameter("msg");
    Then make a cron job

    0 0,6,12,18 * * * root /usr/bin/wget http://serverip:port/iweb/jsp_name.jsp?msg=you_rmsg -q > /dev/null

  12. #12
    Nerd-IO Romulan is offline
    MemberRank
    Feb 2009 Join Date
    BelgiumLocation
    3,333Posts

    Re: How to Auto Announce

    Quote Originally Posted by pastime4u View Post
    Change:
    String msg = "PUT ANNOUNCEMENT HERE";
    to:
    String msg = request.getParameter("msg");
    Then make a cron job

    0 0,6,12,18 * * * root /usr/bin/wget http://serverip:port/iweb/jsp_name.jsp?msg=you_rmsg -q > /dev/null
    But there is no input field on the JSP page to type the message for the string "request.getParameter("msg");"

  13. #13
    Omega 343 is offline
    MemberRank
    Oct 2009 Join Date
    Ancient DGN CTYLocation
    5,514Posts

    Re: How to Auto Announce

    Quote Originally Posted by Romulan View Post
    But there is no input field on the JSP page to type the message for the string "request.getParameter("msg");"
    You edit the JSP; it's not inputted in a web interface. You permanently edit the JSP to say what you want it to say. Then CRON will call it at whatever interval you set it to. Nothing else to do, then it will auto run as long as the server is 'up' (and of course you can make as many of these as you want [ie... one that would run every hour, one that would run every monday at 6pm, one that would run every new year @ midnight whatever you set in CRON)

    && if you're using my 'package' of this I created an HTML instruction as noted in my post above... (it's really easy; you put the directories in their respective places and change the actual announcement in the JSP and modify CRON; which if I remember correctly I even include the CRON setting (as an example) that would make it run every hour; so if you installed my 'package' and did not modify anything, every hour you should see it say "PUT ANNOUNCEMENT HERE" in game))
    Last edited by 343; 08-08-10 at 12:53 PM.



Advertisement