Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
PlayerList & Zone Pop uploaded to Site
Goto page 1, 2  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  Bot give creds via another bot Post :: Post mutpal plugin help  View next topic  
Author Message
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Tue Nov 22, 2005 7:19 pm    Post subject: PlayerList & Zone Pop uploaded to Site Reply to topic Reply with quote

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. icon_cool.gif

P.S. i think i can get the list of players and size, im just to lazy.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Kitsune (^)
Novice


Age:33
Gender:Gender:Male
Joined: Sep 29 2005
Posts: 42
Location: Between Heaven and Hell.
Offline

PostPosted: Tue Nov 22, 2005 7:28 pm    Post subject: Hrm. Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Tue Nov 22, 2005 7:28 pm    Post subject: Reply to topic Reply with quote

-SLAP-
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Kitsune (^)
Novice


Age:33
Gender:Gender:Male
Joined: Sep 29 2005
Posts: 42
Location: Between Heaven and Hell.
Offline

PostPosted: Tue Nov 22, 2005 7:38 pm    Post subject: >.< Reply to topic Reply with quote

OUCH! Bd, check your messages.
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue Nov 22, 2005 7:46 pm    Post subject: Reply to topic Reply with quote

Request the arena list in BotAction then add up the numbers
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Tue Nov 22, 2005 7:54 pm    Post subject: Reply to topic Reply with quote

Then how do i upload to server the number of players in the arena and which ones they are?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Kitsune (^)
Novice


Age:33
Gender:Gender:Male
Joined: Sep 29 2005
Posts: 42
Location: Between Heaven and Hell.
Offline

PostPosted: Tue Nov 22, 2005 7:59 pm    Post subject: >.< Reply to topic Reply with quote

I'm retarded when it comes to bots and FTP.

How do i upload stuff to my site? <- Using CUTEftp
Back to top
View users profile Send private message Add User to Ignore List
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Tue Nov 22, 2005 8:27 pm    Post subject: Reply to topic Reply with quote

icon_confused.gif . I got arena size ez. m_botAction.getArenaSize();

I just need the stupid uploading files in java.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Wed Nov 23, 2005 1:28 am    Post subject: Reply to topic Reply with quote

You're too lazy to do something, which is why you ask for help here? Go away, stupid troll.
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Wed Nov 23, 2005 3:58 am    Post subject: Reply to topic Reply with quote

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 biggrin.gif

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 biggrin.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Wed Nov 23, 2005 9:40 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Nov 23, 2005 11:35 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Wed Nov 23, 2005 1:25 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Kitsune (^)
Novice


Age:33
Gender:Gender:Male
Joined: Sep 29 2005
Posts: 42
Location: Between Heaven and Hell.
Offline

PostPosted: Wed Nov 23, 2005 1:29 pm    Post subject: Well. Reply to topic Reply with quote

That was mean. icon_sad.gif Since when is the universe finite? Can you prove it?
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Nov 23, 2005 2:03 pm    Post subject: Reply to topic Reply with quote

@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. icon_razz.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Wed Nov 23, 2005 2:08 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Purge
Episode I > Eposide III
Jar-Jar is kool


Age:35
Gender:Gender:Male
Joined: Sep 08 2004
Posts: 2019
Offline

PostPosted: Wed Nov 23, 2005 2:10 pm    Post subject: Reply to topic Reply with quote

Kitsune (^) wrote:
That was mean. icon_sad.gif Since when is the universe finite? Can you prove it?


Considering the universe is still expanding, it's finite.
Back to top
View users profile Send private message Add User to Ignore List
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Wed Nov 23, 2005 2:46 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Wed Nov 23, 2005 4:51 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Guest



Offline

PostPosted: Wed Nov 23, 2005 7:13 pm    Post subject: Reply to topic Reply with quote

Tutorial: How to display zone population on a webpage using TWCore, PHP and MySQL

Here is an example table structure what is needed:

Code: Show/Hide

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.

Code: Show/Hide

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

Code: Show/Hide

<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

PostPosted: Wed Nov 23, 2005 7:33 pm    Post subject: Reply to topic Reply with quote

Oops.. rushed the PHP part a bit :(

Code: Show/Hide

<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, fdDate FROM tblZonePopulation ORDER BY fnZonePopulationId DESC LIMIT 0, 1";
$result = mysql_query($query);

if (mysql_num_rows($result) > 0) {
    $row = mysql_fetch_assoc($result);
    echo "Number of Players: " . row[0]; . "<br> Players: " . row[1] . "<br> Last Updated: " . row[2];
} else {
    echo "Zone Population unavailable.";
}

mysql_free_result($result);
mysql_close($dbh);
?>


Should be a bit better
Back to top
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Wed Nov 23, 2005 8:17 pm    Post subject: Reply to topic Reply with quote

Parse error: parse error, unexpected '[', expecting ',' or ';' in /home/staff/public_html/zone.php on line 11
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Wed Nov 23, 2005 8:52 pm    Post subject: Reply to topic Reply with quote

Also i looked at the table size with phpAdmin thing, nothing is changing. It's not even being used. icon_eek.gif
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sat Nov 26, 2005 2:35 pm    Post subject: Reply to topic Reply with quote

infinate things can expand too. Prove the universe is finite.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sun Nov 27, 2005 2:23 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 84 page(s) served in previous 5 minutes.

phpBB Created this page in 0.504114 seconds : 50 queries executed (92.1%): GZIP compression disabled