collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18365
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Undefined variable: pw in startbot.php line 100  (Read 6287 times)

0 Members and 1 Guest are viewing this topic.

Offline taconis

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
Undefined variable: pw in startbot.php line 100
« on: July 02, 2011, 09:06:55 pm »
XP ... MySQL 5.0.2 ... PHP 5.2.6 ... 0.6.8 BeBot ...

I created the db, created the user, set the rights (global) to the db within MySQL (manual commands).  I then start up the bot using C:\BeBot\TNTB1\php.exe startbot.php.  Initially it asks for all the logins, db names, passwords and does the config.  BeBot gives the following error when trying to actually run the bot.:

Curl not available
MySQL ERROR(# 1) on query: Unable to select database tntb1 Database not found or insufficient priviledges!
Access denied for user 'tntb1'@'%' to database 'tntb1'PHP Notice:  Undefined variable: pw in C:\BeBot\TNTB1\StartBot.php on line 100

I've double checked the bot.conf and the mysql.conf and both are good.

Offline kenny

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: Undefined variable: pw in startbot.php line 100
« Reply #1 on: July 02, 2011, 09:34:52 pm »
Are you sure you have a password entered? The message says your "pw" variable is empty.

Offline taconis

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
Re: Undefined variable: pw in startbot.php line 100
« Reply #2 on: July 03, 2011, 01:26:11 am »
The passwords are set in the bot and mysql config files.

Offline taconis

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
Re: Undefined variable: pw in startbot.php line 100
« Reply #3 on: July 03, 2011, 01:27:15 am »
I did notice the variable name in bot.conf is pwd and not pw.  Think that might be the problem?

Offline uberjon

  • BeBot User
  • **
  • Posts: 32
  • Karma: +0/-0
Re: Undefined variable: pw in startbot.php line 100
« Reply #4 on: July 03, 2011, 07:58:47 am »
the variable for /conf/bot.conf should be this stuff here:
Code: [Select]
  /*
    These are the general settings of the bot:
  */

  $ao_username = "";               // Account username
  $ao_password = "";               // Account password (optional, will request on running of Bot if not entered here)
  $bot_name = "";                  // Name of the bot-character
  $dimension = "";                 // The name of the server you play on, or (1, 2 or 3 for AO)
  $guild = "";                     // Name of the guild running the bot (AOC only)

Offline taconis

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
Re: Undefined variable: pw in startbot.php line 100
« Reply #5 on: July 03, 2011, 03:03:22 pm »
So I stripped the grant rights, dropped the user, dropped the database, created the db, created the user, granted the user to everything (5.0.2 didn't like botdbname*.* and I had to drop the single quotes around user name, and totally dropped the @ localhost).  It now loads all the modules, but then comes up with...

Fatal error: Cannot redeclare class BotStatisticsUI in C:\BeBot\TNTB1\modules\ao\BotStatisticsUI.php on line 89
PHP Notice:  Undefined variable: pw in C:\BeBot\TNTB1\StartBot.php on line 100

I went back into mysql and confirmed the user has the correct access to the db and all related tables.  I still cannot figure out why the pw is showing undefined in startbot when all the passwords are correct in bot.conf and mysql.conf.

Offline Shelly

  • BeBot Apprentice
  • ***
  • Posts: 192
  • Karma: +0/-0
Re: Undefined variable: pw in startbot.php line 100
« Reply #6 on: July 08, 2011, 01:37:04 am »
This is benign.

What I did on my bots was in the StartBot.php file on line 38 is just make a declaration

$pw = NULL;

This cleared the annoying message. :)

As for your other errors... check that your php.ini file is correct (from the setup wiki). Then if that is correct... you might have file permission problem. try making sure that you are the owner all the files in your bot directory.
« Last Edit: July 08, 2011, 01:42:38 am by Shelly »

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm ]

* Who's Online
  • Dot Guests: 148
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal