public function LoadModule($Key, $Name, $AliasOf) { if ($this->KeyExists($Key)) { $Name = strtolower($Name); $AliasOf = strtolower($AliasOf); $Lua = false; if (IsLuaFilename($Name)) { $Lua = true; } if (IsLuaFilename($AliasOf)) { $Lua = true; } if ($Lua) { $this->Modules[$Key][$Name] = new LuaModule($this, $this->WhatsBot, $this->WhatsApp, $Key, $Name, $AliasOf); } else { $this->Modules[$Key][$Name] = new PHPModule($this, $this->WhatsBot, $this->WhatsApp, $Key, $Name, $AliasOf); } $Loaded = $this->Modules[$Key][$Name]->IsLoaded(); if (!$Loaded) { $this->UnloadModule($Key, $Name); } return $Loaded; } return false; }
private function LoadThread($Name) { if (IsLuaFilename($Name)) { $this->Threads[$Name] = new LuaThread($Name); } else { $this->Threads[$Name] = new PHPThread($Name); } $Loaded = $this->Threads[$Name]->IsLoaded(); if (!$Loaded) { $this->UnloadThread($Name); } return $Loaded; }