trigger has time to start (xxx) and time to end (yyy) in npcgen, cron activates anons script about start at (xxx) and anons script about finish at (yyy).
you can edit triggers with a npcgen-editors, there is a few workable full npcgens.
Printable View
trigger has time to start (xxx) and time to end (yyy) in npcgen, cron activates anons script about start at (xxx) and anons script about finish at (yyy).
you can edit triggers with a npcgen-editors, there is a few workable full npcgens.
I've been trying to get one to work still, can you post a example or a working one or pm it to me?
Im at work now and dont have my files here. Gimme a screenshoot of your trigger in npcgen and paste a codes: java, php and cron. Ill look and say where are mistakes.
6 Hours Ago - some sort of 4 am in my town :D
What does this code pull the .jsp from? Should mine look like this
http:// ***.***.*.***:8080/PWServer/jetty-7.2.0/webapps/pwAdmin/***.jsp, to match my test server and the file path to were I placed the .jsp. I am asking this now so it's right the first time. Thanks 343.
I'd actually recommend just using php5-cli over that
and usePHP Code:<?php
function broadcast($message){
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if($sock){
if(socket_connect($sock, "127.0.0.1", 29100)){
socket_set_block($sock);
$data2 = mByte(9) . mByte(0) . mInt(-1) . mInt(0) . mString($message);
$data = mUInt32(79) . mUInt32(strlen($data2)) . $data2;
socket_send($sock, $data, 8192, 0);
socket_set_nonblock($sock);
socket_close($sock);
echo "Message Sent Successfully";
} else {
echo "Message Sending Failed";
}
}
}
// pack - http://ru2.php.net/pack
function mByte($p) { return pack('C', $p & 0xFF); }
function mf($i, $j) { return ($i >> $j) & 0xFF; }
function mBytes($p, $from)
{
$packed = '';
for ($i = $from; $i >= 0; $i -= 8)
$packed .= mByte(mf($p,$i));
return $packed;
}
function mChar($p) { return mByte(mf($p,0)) . mByte(mf($p,8)); }
function mString($s)
{
$s=iconv('utf-8','utf-16le',$s);
$ret = mUInt32(mb_strlen($s));//mUInt32(count($s) * 2);
$s=array_merge(unpack("n*",$s));
for ($i = 0;$i < count($s); $i++)
{
$ret .= mByte(($s[$i]) >> 8);
$ret .= mByte($s[$i]);
}
return $ret;
}
function mShort($p) { return mBytes($p,8); }
function mInt($p) { return mBytes($p,24); }
function mLong($p) { return mBytes($p,56); }
function mUInt32($p) {
if ($p < 64)
return mByte($p);
if ($p < 16384)
return mShort($p | 0x8000);
if ($p < 536870912)
return mInt($p | 0xC0000000);
return mInt(-32) . mInt($p);
}
function mSInt32($p) {
if ($p >= 0)
return mUInt32($p);
$t=-$p;
if ($t < 64)
return mByte($p | 0x40);
if ($t < 16384)
return mShort($p | 0xA000);
if ($t < 536870912)
return mInt($p | 0xD0000000);
return mInt(-16). mInt($p);
}
function mOctets($p) {
$packed = mUInt32(count($p));
for ($i = 0; $i < count($p); $i++)
$packed .= mByte($p[$i]);
return $packed;
}
broadcast($argv[1]);
?>
php whateveryoucalledit.php "Message to broadcast"
This doesn't rely on the JSP server running and you can run it from any server that has PHP-CLI support
I will remember that. Thanks 343.
Sorry das7002, I'm still a nob at code, and 343's way looks easier for me to do, but I would gladly try yours, if you wouldn't mind explaining were to put everything. :D: Thanks for the response.
dos7002, were does the message go into the code that I want to broadcast.
Like I said
Just remember to keep message in quotes.Code:php whateveryoucalledit.php "Message to broadcast"
The code can just be save as whateveryoucalledit.php and as long as php5-cli is installed it will run by sending the message directly to gdeliveryd and skipping Java entirely.
You could also run it from a web server by changing the last line where it says broadcast($argv[1]); ($argv is all the argument given by the cli) but I've already got something like that originally in PW Chat...
Just kinda offtopicish, whats the best way to make a loop script in ubuntu? Im making a script that checks what time it is and shutsdown the server if its a certain time and i need it to loop to the if time =...
Posted via Mobile Device
Thanks das, I have written the script/s which displays server shutdown notices and then shuts down the server.
I shall try cron for getting it to run at a certain time.
Thanks :)
I am still having issues with this, I guess I am still to much of nob with php, more trial and error to come. Thanks guys.
not understood explains again
Ok here is the deal ( I am about ready to pull out all my hair and teeth lol which would make me a very ugly woman )
This is my crontab:This is what my .sh's look like:Code:# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
00 0 * * * root /etc/cron.daily/brokenbridge.sh
00 1 * * * root /etc/cron.daily/dream.sh
00 2 * * * root /etc/cron.daily/sumor.sh
00 4 * * * root /etc/cron.daily/intrepid.sh
00 6 * * * root /etc/cron.daily/misfortune.sh
00 8 * * * root /etc/cron.daily/bamboo.sh
00 10 * * * root /etc/cron.daily/sirrywine.sh
00 11 * * * root /etc/cron.daily/ADC1.sh
30 11 * * * root /etc/cron.daily/ADC2.sh
00 12 * * * root /etc/cron.daily/ADC3.sh
30 12 * * * root /etc/cron.daily/ADC4.sh
00 13 * * * root /etc/cron.daily/ADC5.sh
00 14 * * * root /etc/cron.daily/northbarrier.sh
00 16 * * * root /etc/cron.daily/walled.sh
00 18 * * * root /etc/cron.daily/tusk.sh
00 20 * * * root /etc/cron.daily/arrivals.sh
00 22 * * * root /etc/cron.daily/shatice.sh
00 23 * * * root /etc/cron.daily/1K.sh
45 0,2,4,6,8,10,12,14,16,18,20,22 * * * root /etc/cron.hourly/voteAWE.sh
45 1,3,5,7,9,11,13,15,17,19,21,23 * * * root /etc/cron.hourly/welcome.sh
#
This is what my .jsp's look like:Code:#!/bin/sh
wget http://my.test.server.!:8080/PWServer/jetty-7.2.0/webapps/pwAdmin/jsp/1K.jsp
rm *jsp*
And I am running my test server on Debian 6.0, with ronny1982's server setup with MySQL.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 = "Thousand Streams is under attack. Can anyone protect it?";
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>");
%>
I can't get the auto announcements to run at all. I'm dieing here any suggestions, Please. Thanks guys.:blink::*: