Author |
Message |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Tue Nov 22, 2005 7:19 pm Post subject: PlayerList & Zone Pop uploaded to Site |
 |
|
|
|
How do i get a list of players and the size of the list and upload it to my website, then when the user opens the page an updated list appears showing the Player's in the Main arena and the number of players thier are.
TWCore(java) and PHP Code plz.
P.S. i think i can get the list of players and size, im just to lazy. |
|
Back to top |
|
 |
Kitsune (^) Novice

Age:33 Gender: Joined: Sep 29 2005 Posts: 42 Location: Between Heaven and Hell. Offline
|
Posted: Tue Nov 22, 2005 7:28 pm Post subject: Hrm. |
 |
|
|
|
Mebbe just get all the players to type something random, and turn on logging, and upload that to your site? >.< _________________ If (Pi=Infinite 3 Infinitity)
Carpe diem!
Know thyself. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Tue Nov 22, 2005 7:28 pm Post subject: |
 |
|
|
|
-SLAP- |
|
Back to top |
|
 |
Kitsune (^) Novice

Age:33 Gender: Joined: Sep 29 2005 Posts: 42 Location: Between Heaven and Hell. Offline
|
Posted: Tue Nov 22, 2005 7:38 pm Post subject: >.< |
 |
|
|
|
OUCH! Bd, check your messages. |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Tue Nov 22, 2005 7:46 pm Post subject: |
 |
|
|
|
Request the arena list in BotAction then add up the numbers _________________
 |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Tue Nov 22, 2005 7:54 pm Post subject: |
 |
|
|
|
Then how do i upload to server the number of players in the arena and which ones they are? |
|
Back to top |
|
 |
Kitsune (^) Novice

Age:33 Gender: Joined: Sep 29 2005 Posts: 42 Location: Between Heaven and Hell. Offline
|
Posted: Tue Nov 22, 2005 7:59 pm Post subject: >.< |
 |
|
|
|
I'm retarded when it comes to bots and FTP.
How do i upload stuff to my site? <- Using CUTEftp |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Tue Nov 22, 2005 8:27 pm Post subject: |
 |
|
|
|
. I got arena size ez. m_botAction.getArenaSize();
I just need the stupid uploading files in java. |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Wed Nov 23, 2005 1:28 am Post subject: |
 |
|
|
|
You're too lazy to do something, which is why you ask for help here? Go away, stupid troll. |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Wed Nov 23, 2005 3:58 am Post subject: |
 |
|
|
|
I would think probably the easiest thing to do if the bot doesn't run on the same server as the website would be to save it to a mysql database that you could read from some php script. Another thing you could do is save the information to a file on the bot computer and have the website computer read that.
Kitsune, stop talking. Having a bot (or person every time the number of players in an arena changes... shudder) use CuteFTP is up there in "Bad ideas I have heard". Have to give you props for trying, though
Also, just because pi appears to repeat forever does not prove the concrete existence of infinity, and certainly not that "life is infinite", whatever that means. Again, nice try  |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Wed Nov 23, 2005 9:40 am Post subject: |
 |
|
|
|
Pi and e are transcendentals. They transcend the algebra of the rationals. Doesn't prove infinity exists any more than 1/3 = 0.33333... does.
The universe is finite. A finite object cannot contain an infinite one. Life is finite. Even thermodynamics says the universe will end eventually. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 23, 2005 11:35 am Post subject: |
 |
|
|
|
And just because infinity exists doesn't mean life is.
But we should ask: is the bot setup on the same server as the website? _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Last edited by Cyan~Fire on Wed Nov 23, 2005 2:02 pm, edited 1 time in total |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Wed Nov 23, 2005 1:25 pm Post subject: |
 |
|
|
|
No the bot is running on my home pc, the server is running on a linux server somewhere else. We have unlimited mysql but it only allows connections with the prefix staff. The prefix when i connect is my ip then all the other info so it does not allow a connection. How do i fix that.
I have CPanel X. |
|
Back to top |
|
 |
Kitsune (^) Novice

Age:33 Gender: Joined: Sep 29 2005 Posts: 42 Location: Between Heaven and Hell. Offline
|
Posted: Wed Nov 23, 2005 1:29 pm Post subject: Well. |
 |
|
|
|
That was mean. Since when is the universe finite? Can you prove it? |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 23, 2005 2:03 pm Post subject: |
 |
|
|
|
@BDwins: What do you mean "only allows connections with the prefix staff"? You mean the username? If so, it should be easy to setup TWCore to login like that.
@Kitsune: oops, made a type, read again.  |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Wed Nov 23, 2005 2:08 pm Post subject: |
 |
|
|
|
When i try and connect to mysql it uses (lets pretend my actual wan ip is 127.0.0.1)
127-0-0-1@staff_dbname......
I think i figured out how to fix it, but right now all i need is the java code to upload the data into the table and the php code to read the data. |
|
Back to top |
|
 |
Purge Episode I > Eposide III Jar-Jar is kool

Age:35 Gender: Joined: Sep 08 2004 Posts: 2019 Offline
|
Posted: Wed Nov 23, 2005 2:10 pm Post subject: |
 |
|
|
|
Kitsune (^) wrote: | That was mean. Since when is the universe finite? Can you prove it? |
Considering the universe is still expanding, it's finite. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Wed Nov 23, 2005 2:46 pm Post subject: |
 |
|
|
|
I got the bot connecting to the database. I think i can make it upload information to it. Then ill google to see how to read info from sql in php. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Wed Nov 23, 2005 4:51 pm Post subject: |
 |
|
|
|
Umm anyone know how to send an Int to the table "Hot"?
I can't seem to get it to INSERT or UPDATE anything. |
|
Back to top |
|
 |
Guest
Offline
|
Posted: Wed Nov 23, 2005 7:13 pm Post subject: |
 |
|
|
|
Tutorial: How to display zone population on a webpage using TWCore, PHP and MySQL
Here is an example table structure what is needed:
CREATE TABLE `tblZonePopulation` (
`fnZonePopulationId` int(10) NOT NULL auto_increment,
`fnNumberOfPlayers` int(10) NOT NULL default '0',
`ftPlayers` text NOT NULL,
`fdDate` datetime default CURRENT_TIMESTAMP,
PRIMARY KEY (`fnZonePopulationId`)
);
|
Then we need the bot to send data to the table.
int numberOfPlayers = m_botAction.getArenaSize();
String players;
if (numberOfPlayers > 0) {
Iterator i = m_botAction.getPlayerIterator();
while (i.hasNext()) {
if (players != null) {
players += ", ";
}
players += Tools.addSlashesToString(((Player)i.next()).getPlayerName());
}
} else {
players = "The zone is empty.";
}
String query = "INSERT INTO tblZonePopulation (fnNumberOfPlayers, ftPlayers) VALUES ('" + numberOfPlayers + "', '" + players + "')";
m_botAction.SQLBackgroundQuery("yourconnectionname", null, query);
|
And finally the PHP code
<b>Zone Population</b><br>
<?
$dbh = mysql_connect ("yourhost", "yourusername", "yourpassword") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("yourdatabase");
$query = "SELECT fnNumberOfPlayers, ftPlayers FROM tblZonePopulation ORDER BY fnZonePopulationId DESC LIMIT 0, 1";
$result = mysql_query($query);
if (mysql_num_rows($result) > 0) {
?>Number of Players: <? echo row[0]; ?><br>
Players: <? echo row[1];
} else {
echo "Zone Population unavailable.";
}
mysql_free_result($result);
mysql_close($dbh);
|
OK, it wasn't really a tutorial as I didn't explain much but it's more or less selfexplanatory. I didn't test any part of the code so it is very likely there are errors and such, but it was meant as an example and finding bugs is good practice! |
|
Back to top |
|
 |
Guest
Offline
|
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Wed Nov 23, 2005 8:17 pm Post subject: |
 |
|
|
|
Parse error: parse error, unexpected '[', expecting ',' or ';' in /home/staff/public_html/zone.php on line 11 |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Wed Nov 23, 2005 8:52 pm Post subject: |
 |
|
|
|
Also i looked at the table size with phpAdmin thing, nothing is changing. It's not even being used.  |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Sat Nov 26, 2005 2:35 pm Post subject: |
 |
|
|
|
infinate things can expand too. Prove the universe is finite. |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sun Nov 27, 2005 2:23 am Post subject: |
 |
|
|
|
I never said the universe was finite, I said that pi does not prove the existance of infinity or that "life is infinite" |
|
Back to top |
|
 |
|