示例#1
0
 function fBGifts($inittype = '')
 {
     $this->userId = $_SESSION['userId'];
     if (!is_numeric($this->userId)) {
         $this->error = "faceBot Not Initialized/User Unknown";
         return;
     }
     //Open Databases
     $this->_fBGiftsDBM = new SQLiteDatabase(fBGifts_Path . PluginF(fBGifts_Main));
     if (!$this->_fBGiftsDBM) {
         $this->error = 'fBGifts - Database Error';
         return;
     }
     //Get Settings
     $this->settings = $this->fBGetSettings();
     //Load the world from Z*
     if ($this->settings === false) {
         $this->_fBGifts_checkDB();
         //Database doesn't exist, create
     }
     $this->_fBUpdateSettings();
     //Insert initial settings
     if ($inittype != 'formload') {
         $this->_fBGetCookie();
         AddLog2('fBGifts: facebook Cookie Location: ' . $this->cookie);
         $this->_acceptGifts();
     }
 }
示例#2
0
 function fvLinks($inittype = '')
 {
     $this->userId = $_SESSION['userId'];
     $this->error = '';
     $this->haveWorld = true;
     $this->flashRevision = $_SESSION['flashRevision'];
     if (!is_numeric($this->userId)) {
         $this->error = "Farmville Bot Not Initialized/User Unknown";
         return;
     }
     //Open Databases
     $this->_fsManagerDBM = new SQLiteDatabase(fvLinks_Path . PluginF(fvLinks_Main));
     $this->_fsManager_checkDB();
     if (!$this->_fsManagerDBM) {
         $this->error = 'fvLinks - Database Error';
         return;
     }
     //Get Settings
     $this->settings = $this->fsGetSettings();
     if ($inittype == 'formload') {
         if (empty($this->settings)) {
             $this->error = 'Please allow fvLinks to run a cycle';
         }
         return;
     }
     $this->_fsUpdateSettings();
     $this->_fsExpireLinks();
     //$this->_fsGetLocales();
     $this->GetALinks();
 }
示例#3
0
function save_array($array, $filename)
{
    file_put_contents($_SESSION['this_plugin']['folder'] . '/' . PluginF($filename), serialize($array));
}
示例#4
0
 function fvManager($inittype = '')
 {
     list($this->level, $this->gold, $this->coin, $this->wsizeX, $this->wsizeY, $firstname, $locale, $tileset, $wither, $xp, $energy, $this->flashRevision) = explode(';', fBGetDataStore('playerinfo'));
     $this->userId = $_SESSION['userId'];
     $this->flashRevision = $_SESSION['flashRevision'];
     $this->xp = $xp;
     $this->energy = $energy;
     $this->error = '';
     $this->haveWorld = false;
     if (!is_numeric($this->userId)) {
         $this->error = "Farmville Bot Not Initialized/User Unknown";
         return;
     }
     //Open Databases
     $this->_fvManagerDBM = new SQLiteDatabase(fvManager_Path . PluginF(fvManager_Main));
     $this->_fvManagerDBW = new SQLiteDatabase(fvManager_Path . PluginF(fvManager_World));
     $this->_fvManagerDBU = new SQLiteDatabase(fvManager_Path . PluginF(fvManager_Units));
     if (!$this->_fvManagerDBM || !$this->_fvManagerDBW || !$this->_fvManagerDBU) {
         $this->error = 'fvManager - Database Error';
         return;
     }
     $this->_fvManagerDBM->queryExec('PRAGMA cache_size=20000');
     $this->_fvManagerDBM->queryExec('PRAGMA synchronous=OFF');
     $this->_fvManagerDBM->queryExec('PRAGMA count_changes=OFF');
     $this->_fvManagerDBM->queryExec('PRAGMA journal_mode=MEMORY');
     $this->_fvManagerDBM->queryExec('PRAGMA temp_store=MEMORY');
     $this->_fvManagerDBW->queryExec('PRAGMA cache_size=20000');
     $this->_fvManagerDBW->queryExec('PRAGMA synchronous=OFF');
     $this->_fvManagerDBW->queryExec('PRAGMA count_changes=OFF');
     $this->_fvManagerDBW->queryExec('PRAGMA journal_mode=MEMORY');
     $this->_fvManagerDBW->queryExec('PRAGMA temp_store=MEMORY');
     $this->_fvManagerDBU->queryExec('PRAGMA cache_size=20000');
     $this->_fvManagerDBU->queryExec('PRAGMA synchronous=OFF');
     $this->_fvManagerDBU->queryExec('PRAGMA count_changes=OFF');
     $this->_fvManagerDBU->queryExec('PRAGMA journal_mode=MEMORY');
     $this->_fvManagerDBU->queryExec('PRAGMA temp_store=MEMORY');
     //Get Settings
     $this->settings = $this->fvGetSettings();
     if ($inittype == 'formload') {
         if (empty($this->settings)) {
             $this->error = 'Please allow fvManager to run a cycle';
         }
         return;
     }
     //Version Upgrade
     if ($this->settings !== false && (!isset($this->settings['version']) || $this->settings['version'] != fvManager_version)) {
         AddLog2('fvManager preparing to upgrade');
         $fwSQL = "DROP TABLE myworld;";
         $q = $this->_fvManagerDBW->query($fwSQL);
         $fgSQL = "DROP TABLE giftbox;";
         $q = $this->_fvManagerDBW->query($fgSQL);
         $fuSQL = "DROP TABLE units;";
         $q = $this->_fvManagerDBU->query($fuSQL);
         $fgSQL = "DROP TABLE fmarket;";
         $q = $this->_fvManagerDBW->query($fgSQL);
         $fbSQL = "DROP TABLE fmbushels;";
         $q = $this->_fvManagerDBW->query($fbSQL);
         $fbSQL = "DROP TABLE work;";
         $q = $this->_fvManagerDBM->query($fbSQL);
         $fbSQL = "DROP TABLE storage;";
         $q = $this->_fvManagerDBW->query($fbSQL);
         $this->_fvManager_checkDB();
         //Database doesn't exist, create
         $this->_fvUpdateSettings();
         //Insert initial settings
         $this->_fvUpdateUnits();
         //Update the Units file
         AddLog2('fvManager upgrade finished');
     }
     //Load the world from Z*
     $this->_refreshWorld();
     if ($this->haveWorld === true) {
         if ($this->settings === false) {
             $this->_fvManager_checkDB();
             //Database doesn't exist, create
             $this->_fvUpdateSettings();
             //Insert initial settings
             $this->_fvImageRev();
             //Update the Image Revision
             $this->_fvUpdateUnits();
             //Update the Units file
             $this->_fvUpdateWorldDB();
             //Update the World
             $this->_findEmpty();
             //$this->_fvCreateMap();//Create World Map
             //$this->_fvGetEmptySpots();//Get Empty Spots
             $this->error = 'Please allow fvManager to run a cycle to update all settings';
             return;
         }
         if ($this->settings['flashRevision'] != $this->flashRevision) {
             $this->_fvImageRev();
             //Update the Image Revision
             $this->_fvUpdateUnits();
             //Update the Units file
             $this->settings = $this->fvGetSettings();
         }
         if ($this->settings['unitversion'] != $this->flashRevision) {
             $this->_fvUpdateUnits();
             //Update the Units file
         }
         $this->_fvUpdateWorldDB();
         //Update the World
         $this->_findEmpty();
         $this->_fvUpdateSettings();
         //Update the settings
         $this->_fvUpdateImages();
         //Update Thumbnails
     }
 }
示例#5
0
 function FarmStats($inittype = '')
 {
     list($this->level, $this->gold, $this->coin, $this->wsizeX, $this->wsizeY, $this->uname, $locale, $this->tileset, $this->wither, $this->xp, $this->fuel, $this->flashRevision) = explode(';', fBGetDataStore('playerinfo'));
     $this->userId = $_SESSION['userId'];
     $this->error = '';
     $this->haveWorld = true;
     if (!is_numeric($this->userId)) {
         $this->error = "Farmville Bot Not Initialized/User Unknown";
         return;
     }
     //Open Databases
     $this->_fsManagerDBM = new SQLiteDatabase(FarmStats_Path . PluginF(FarmStats_Main));
     $this->_fsManagerDBW = new SQLiteDatabase(FarmStats_Path . PluginF(FarmStats_World));
     $this->_fsManagerDBM->queryExec('PRAGMA cache_size=20000');
     $this->_fsManagerDBM->queryExec('PRAGMA synchronous=OFF');
     $this->_fsManagerDBM->queryExec('PRAGMA count_changes=OFF');
     $this->_fsManagerDBM->queryExec('PRAGMA journal_mode=MEMORY');
     $this->_fsManagerDBM->queryExec('PRAGMA temp_store=MEMORY');
     $this->_fsManagerDBW->queryExec('PRAGMA cache_size=20000');
     $this->_fsManagerDBW->queryExec('PRAGMA synchronous=OFF');
     $this->_fsManagerDBW->queryExec('PRAGMA count_changes=OFF');
     $this->_fsManagerDBW->queryExec('PRAGMA journal_mode=MEMORY');
     $this->_fsManagerDBW->queryExec('PRAGMA temp_store=MEMORY');
     if (!$this->_fsManagerDBM || !$this->_fsManagerDBW) {
         $this->error = 'FarmStats - Database Error';
         return;
     }
     //Get Settings
     $this->settings = $this->fsGetSettings();
     if ($inittype == 'formload') {
         if (empty($this->settings)) {
             $this->error = 'Please allow FarmStats to run a cycle';
         }
         return;
     }
     //Load the world from Z*
     if ($this->haveWorld === true) {
         if ($this->settings === false) {
             $this->_fsManager_checkDB();
             //Database doesn't exist, create
             $this->_fsUpdateSettings();
             //Insert initial settings
             $this->_fsUpdateWorldDB();
             //Update the World
             $this->_fsGetEmptySpots();
             //Get Empty Spots
             $this->error = 'Please allow FarmStats to run a cycle to update all settings';
             return;
         }
         if ($this->settings['flashRevision'] != $this->flashRevision) {
             $this->settings = $this->fsGetSettings();
         }
         $this->_fsUpdateWorldDB();
         //Update the World
         //Export Files
         $seedinfo = $this->fsGetWorldSeeds();
         save_botarray($seedinfo, F('fs_seedinfo.txt'));
         $this->_fsUpdateSettings();
         //Update the settings
     }
 }
示例#6
0
 function fvFarmer($inittype = '')
 {
     list($this->level, $this->gold, $this->coin, $this->wsizeX, $this->wsizeY, $this->uname, $locale, $this->tileset, $this->wither, $this->xp, $this->fuel, $this->flashRevision) = explode(';', fBGetDataStore('playerinfo'));
     $this->userId = $_SESSION['userId'];
     $this->error = '';
     $this->haveWorld = false;
     if (!is_numeric($this->userId)) {
         $this->error = "Farmville Bot Not Initialized/User Unknown";
         return;
     }
     //Open Databases
     $this->_fvFarmerDBM = new SQLiteDatabase(fvFarmer_Path . PluginF(fvFarmer_Main));
     if (!$this->_fvFarmerDBM) {
         $this->error = 'fvFarmer - Database Error';
         return;
     }
     $this->_fvFarmer_checkDB();
     //Database doesn't exist, create
     //Get Settings
     $this->settings = $this->fvGetSettings();
     if ($inittype == 'formload') {
         $this->overrides = $this->fvGetOverRides();
         return;
     }
     //Load the world from Z*
     $this->_refreshWorld();
     if ($this->haveWorld === true) {
         if ($this->settings === false) {
             $this->_fvFarmer_checkDB();
             //Database doesn't exist, create
             $this->_fvUpdateSettings();
             //Insert initial settings
             $this->_fvUpdateSeedDB();
             //Update the World
             $this->error = 'Please allow fvFarmer to run a cycle to update all settings';
             return;
         }
         if ($this->settings['flashRevision'] != $this->flashRevision || $this->settings['unitversion'] != $this->flashRevision) {
             $this->_fvUpdateUnits();
             //Update the Units file
             $this->settings = $this->fvGetSettings();
         }
         $this->_fvUpdateSeedDB();
         //Update the World
         $this->_fvUpdateSettings();
         //Update the settings
         $this->overrides = $this->fvGetOverRides();
         $this->fvBestVehicles();
     }
 }
示例#7
0
 function fvTools($inittype = '')
 {
     list($level, $gold, $cash, $this->sizeX, $this->sizeY, $firstname, $locale, $tileset, $wither, $xp, $energy, $this->flashRevision) = explode(';', fBGetDataStore('playerinfo'));
     $this->userId = $_SESSION['userId'];
     $this->flashRevision = $_SESSION['flashRevision'];
     $this->haveWorld = false;
     if (!is_numeric($this->userId)) {
         AddLog2("Farmville Bot Not Initialized/User Unknown");
         echo "Farmville Bot Not Initialized/User Unknown";
         return;
     }
     //Open Databases
     $this->_fvToolsDBM = new SQLiteDatabase(fvTools_Path . PluginF(fvTools_Main));
     $this->_fvToolsDBW = new SQLiteDatabase(fvTools_Path . PluginF(fvTools_World));
     if (!$this->_fvToolsDBM || !$this->_fvToolsDBW) {
         $this->error = 'fvTools - Database Error';
         return;
     }
     $this->_fvTools_checkDB();
     $this->_fvToolsDBM->queryExec('PRAGMA cache_size=20000');
     $this->_fvToolsDBM->queryExec('PRAGMA synchronous=OFF');
     $this->_fvToolsDBM->queryExec('PRAGMA count_changes=OFF');
     $this->_fvToolsDBM->queryExec('PRAGMA journal_mode=MEMORY');
     $this->_fvToolsDBM->queryExec('PRAGMA temp_store=MEMORY');
     $this->_fvToolsDBW->queryExec('PRAGMA cache_size=20000');
     $this->_fvToolsDBW->queryExec('PRAGMA synchronous=OFF');
     $this->_fvToolsDBW->queryExec('PRAGMA count_changes=OFF');
     $this->_fvToolsDBW->queryExec('PRAGMA journal_mode=MEMORY');
     $this->_fvToolsDBW->queryExec('PRAGMA temp_store=MEMORY');
     //Get Settings
     $this->_fvUpdateWorldDB();
     if ($inittype != 'formload') {
         $this->_refreshWorld();
         $this->_fvDoWork();
     }
 }
 function fvNeighbors($inittype = '')
 {
     list($this->level, $this->gold, $cash, $this->wsizeX, $this->wsizeY, $firstname, $locale, $tileset, $wither, $this->xp, $this->energy) = explode(';', fBGetDataStore('playerinfo'));
     $this->userId = $_SESSION['userId'];
     $this->flashRevision = $_SESSION['flashRevision'];
     $this->error = '';
     $this->haveWorld = false;
     $this->fndebug = false;
     if (!is_numeric($this->userId)) {
         $this->error = "Farmville Bot Not Initialized/User Unknown";
         return;
     }
     //Open Databases
     $this->_fnNeighborsDBM = new SQLiteDatabase(fvNeighbors_Path . PluginF(fvNeighbors_Main));
     if (!$this->_fnNeighborsDBM) {
         $this->error = 'fvNeighbors - Database Error';
         return;
     }
     $this->_fnNeighborsDBM->queryExec('PRAGMA cache_size=20000');
     $this->_fnNeighborsDBM->queryExec('PRAGMA synchronous=OFF');
     $this->_fnNeighborsDBM->queryExec('PRAGMA count_changes=OFF');
     $this->_fnNeighborsDBM->queryExec('PRAGMA journal_mode=MEMORY');
     $this->_fnNeighborsDBM->queryExec('PRAGMA temp_store=MEMORY');
     $this->_fnNeighbors_checkDB();
     //Get Settings
     $this->settings = $this->fnGetSettings();
     if ($inittype == 'formload') {
         if (empty($this->settings)) {
             $this->error = 'Please allow fvNeighbors to run a cycle';
         }
         return;
     }
     if ($this->settings !== false && (!isset($this->settings['version']) || $this->settings['version'] != fvNeighbors_version)) {
         $fbSQL = "DROP TABLE neighborsn;";
         $q = $this->_fnNeighborsDBM->query($fbSQL);
         $this->_fnNeighbors_checkDB();
         //Database doesn't exist, create
         /*$this->_fnUpdateSettings();//Insert initial settings
         		AddLog2('fvNeighbors upgrade finished');*/
     }
     //Load the world from Z*
     $this->_refreshWorld();
     if ($this->haveWorld === true) {
         if ($this->settings === false) {
             $this->_fnNeighbors_checkDB();
             //Database doesn't exist, create
             $this->_fnUpdateSettings();
             //Insert initial settings
             $this->error = 'Please allow fvNeighbors to run a cycle to update all settings';
             return;
         }
         $this->_fnUpdateSettings();
         //Update the settings
         $this->_fnUpdateWorldDB();
         //Update the World
     }
 }