Posts by Patrick
-
-
Zoals ik al in mijn eerste bericht zei, ik moet eerst weten wat en hoe en wat ik werk per opdracht niet per uur tarief. PM me maar als je de bugs wilt melden en wat ik er voor vraag.
-
ik zelf werk dan met phpdesigner en die herkent automatisch de variables als ik de $k bijvoorbeeld doe, meestal is wanneer hij hem niet herkent weet ik ook dat die variable met een hoofdletter "K" begint.
-
slordigheid vind ik vooral wat je zelf vind ik vind het werken met hoofdletters makkelijk om mijn code te overzien zelfde als de enters die is voor mij makkelijk om bepaalde stukken code terug te lezen.
iedereen programmeert op zijn eigen manier en doe dat natuurlijk ook respecteren als het resultaat uit eindelijk maar goed is, voor de rest slordigheid vind ik zelf nog wel mee vallen.
-
Hey iedereen,
hierbij bied ik mijzelf aan als programmeur voor kleine en grote opdrachten voor programmatie van websites of andere programmeringen die gerealiteerd zijn aan het internet hier onder versta ik:
- PHP
- HTML
- JavascriptDaarnaast heb ik de laatste tijd kennis op gedaan over het programmeren van IRC Bots in PHP dus daarmee kan ik je ook van dienst zijn (Een standaard framework ligt hiervoor al klaar)
Voorbeelden van mijn programmatie:
PHP
Toon Meerpublic function ReloadModule ($Parent, $ModuleName) { $LengthString = strlen(trim($ModuleName)); foreach ($Parent->Modules as $ModName => $Instance) { $uIdModule = substr($ModName, $LengthString ); $WholeModule = trim($ModuleName) . $uIdModule; if ($ModName == $WholeModule) { unset($Parent->Modules[$ModName]); $UniqId = trim($ModuleName) . uniqid(); $ModuleName = trim($ModuleName) . '.php'; if (file_exists($Parent->BotConfig['modulepath'] . 'class.' . $ModuleName)) { $ModuleContent = file_get_contents($Parent->BotConfig['modulepath'] . 'class.' . $ModuleName); $Parent->Temp = $UniqId; return true; } $ModuleContent = preg_replace('@class\s+(\w+)@i','class ' . $UniqId, $ModuleContent, 1); eval('?>' . $ModuleContent); $ModuleName = substr($ModuleName, 0, -4); $Parent->Modules[$UniqId] = new $UniqId($this); } } return false; }
en nog 1:
PHP
Toon Meer/** * * Bereken hoeveel pagina's er nodig zijn * om alle items netjes weer te geven * */ $cQuery = mysql_query ( ' SELECT * FROM `portfolio` ' ); $cQount = mysql_num_rows ( $cQuery ); $page = round($cQount / 6, 1); if ( is_float ( $page ) ) { $tPages = explode ( '.' , $page ); $tPages[0]++; $TotalPages = $tPages[0]; } else { $tPages = explode ( '.' , $page ); $TotalPages = $tPages[0]; } $linkHtml = null; $CountLink = 0; $BeginIdNav = 0; while ($CountLink < $TotalPages) { $CountLink++; $linkHtml .= '<a href="portfolio.php?begin=' . $BeginIdNav . '">' . $CountLink . '</a>'; $BeginIdNav = $BeginIdNav + 6; }
Voor meer informatie kan je via PM de vragen stellen, ik werk per opdracht en over de prijs is niks te zeggen tot de opdracht bekend is bij mij en hoeveel tijd / werk ik er in moet stoppen.
Betaling gebeurd uiteraard na oplevering en na goedkeuring van de opdracht gever. Dit is freelance en geen KVK of iets in die vorm is dus beschikbaar.
Reactie's daarover zijn daarop dus ook redelijk nutteloos.
Ik zie de PM's graag te gemoet!
-
Je hebt zeg maar gewoon commands voor de bot de core en raw command handling (raw line die binnenkomt vanuit de server)
Nu wil ik een childclass maken voor de raw commands en een child class voor de commands
-
Ik heb een main class, en daar gaan redelijk wat child classes aan hangen, en ik heb geen zin die allemaal 1 voor 1 aan te roepen, kan er op 1 of andere manier automatisch ingeladen worden?
-
Als ik een childclass wil activeren moet ik weer $obj = new child();
te doen is er een manier om deze class automatisch te activeren wanneer hij geinclude wordt? -
yeah, zat even fout te denken maar goed,
ander vraagje(Ja ik ben lekker bezig ik weet.. :P)
Wanneer ik de child class include is er dan manier dat automatisch ingeladen wordt?
-
Maar kijk ik wil vanuit de hoofdclass een functie gebruiken van de subclass, maar dat gaat dus niet?
-
zoals de titel het zegt, hoe kan ik dat voor elkaar krijgen aangezien tot nu toe niet echt wil werken hoe ik het doe.
En dan bedoel ik niet dat je hem aanroept met:
$obj = new child();
maar in de parent class zelf en dan werkt die regel hierboven niet echt... -
connecten naar irc
en daarna vrij weinig doen je kan hem laten joinen naar een kanaal door:
/msg [botname] !raw join [channame]
dan kan je !raw [vanalles en nog wat]
!parameter (gedefineerde parameters)
!hostmask (zal info over de hostmask in kwestie geven)en voor de rest doet het niks legt gewoon een basis voor mensen die vooruit willen
-
voor als iemand zich verveeld en irc heeft
:
http://www.criminalspoint.com/…/10696/IRC-bot-class.htmlcomplete basic class
-
voor de gene die het willen weten wat de fout was:
in de raw_write functie:
moet met dubbele quote tekens enkele doet hij het niet
Nieuwe reactie samengevoegd met originele reactie op 12.11.10 00:53:10:
en voor de mensen die een opstart willen hebben voor een irc bot:PHP
Toon Meer<?php /** * @filesource bot.php * @version 0.1-alpha * @author Patrick Rennings * @copyright 2010 * * @usage Basic IRC Bot class */ Class ViiIrcBot { protected $BotSocket; protected $BotConfig; protected $BotData; protected $Parameter; /** * @name ViiIrcBot::__construct * @param void * @return void * * @usage Main part for creating the bot */ public function __construct () { $this->BotConfig = array( /** * Bot configuration for information */ 'nickname' => 'ViiBot4', 'realname' => 'Vii personal bot', 'ident' => 'ViiBot', /** * Bot server configration */ 'hostname' => 0, 'server' => 'ogn1.ogamenet.net', 'port' => 6667, /** * Bot channel configration */ 'channel' => array('#Vii') ); /** * Prepare for bot connection */ if(!$this->ConnectViiBot()) { die('Connection failed.'); } else { $this->ConnectToIrc(); $this->BotMainLoop(); } } /** * @name ViiIrcBot::ConnectViiBot * @param void * @return boolean * * @usage login to the irc server */ protected function ConnectViiBot() { /** * Create a socket for bot connection */ $this->BotSocket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP); if (!$this->BotSocket) { return false; } /** * Bind the socket to make it irc'able */ if(!socket_bind($this->BotSocket, $this->BotConfig['hostname'])) { return false; } if(!socket_connect($this->BotSocket, $this->BotConfig['server'], $this->BotConfig['port'])) { return false; } /** * Return positive result */ return $this->BotSocket; } /** * @name ViiIrcBot::ConnectToIrc * @param void * @return boolean * * @usage Connect to the irc server */ protected function ConnectToIrc () { /** * Utilize connection */ $this->RawWrite('USER ' . $this->BotConfig['ident']. ' ' . $this->BotConfig['hostname'] . ' ' . $this->BotConfig['server'] . ' :'. $this->BotConfig['realname']); /** * Define bot nickname to use * on the server */ $this->RawWrite('NICK ' . $this->BotConfig['nickname']); return true; } /** * @name ViiIrcBot::RawWrite * @param $Parameter * @return void * * @usage dump an raw line in to the server */ protected function RawWrite ($Parameter) { socket_write($this->BotSocket, $Parameter . "\r\n"); } /** * @name ViiIrcBot::DefineRawLine * @param void * @return Void * * @usage Defining usable parameters for commands */ protected function DefineRawLine($RawLine) { $this->Parameter['hostmask'] = $RawLine[0]; $this->Parameter['servercmd'] = $RawLine[1]; $this->Parameter['location'] = $RawLine[2]; $this->Parameter['command'] = trim(substr($RawLine[3], 1)); if (!empty($this->Parameter['command'])) { $ExplodingPar = explode($RawLine[3], $this->BotData); $this->Parameter['parameters'] = $ExplodingPar[1]; } /** * Splitting hostmask for usable things * $this->Parameter['hostmask'] = Vii`[email protected] */ if (preg_match('/^([^!@]+)!(?:[ni]=)?([^@]+)@([^ ]+)/', $this->Parameter['hostmask'])) { $TempStorage = preg_match('/^([^!@]+)!(?:[ni]=)?([^@]+)@([^ ]+)/', $this->Parameter['hostmask'], $HostArray); $this->Parameter['hostmask'] = array(); $this->Parameter['hostmask']['hostmask'] = substr($HostArray[0], 1); $this->Parameter['hostmask']['nickname'] = substr($HostArray[1], 1); $this->Parameter['hostmask']['ident'] = $HostArray[2]; $this->Parameter['hostmask']['banmask'] = '*!*@' . $HostArray[3]; } } /** * @name ViiIrcBot::BotMainLoop * @param void * @return boolean * * @usage Main loop of usage of the bot */ protected function BotMainLoop () { while($this->BotData = socket_read($this->BotSocket,65000,PHP_NORMAL_READ)) { /** * Even when the line is empty, just continue */ if($this->BotData == "\n") { continue; } /** * Get usable data from the raw output line of irc */ $ConfiguratingData = explode(' ', $this->BotData); $this->DefineRawLine($ConfiguratingData); /** * Go play ping pong with the server */ if($this->Parameter['hostmask'] == 'PING') { $this->RawWrite('PONG '. $this->Parameter['servercmd']); } /** * Other commands */ if ($this->Parameter['command'] == '!raw') { $this->RawWrite($this->Parameter['parameters']); } if ($this->Parameter['command'] == '!hostmask') { $this->RawWrite('PRIVMSG ' . $this->Parameter['location'] . ' :Hostmask:' . $this->Parameter['hostmask']['hostmask']); $this->RawWrite('PRIVMSG ' . $this->Parameter['location'] . ' :Nickname: ' . $this->Parameter['hostmask']['nickname']); $this->RawWrite('PRIVMSG ' . $this->Parameter['location'] . ' :Banmask: ' . $this->Parameter['hostmask']['banmask']); $this->RawWrite('PRIVMSG ' . $this->Parameter['location'] . ' :Identity: ' . $this->Parameter['hostmask']['ident']); } if ($this->Parameter['command'] == '!parameter') { $this->RawWrite('PRIVMSG ' . $this->Parameter['location'] . ' :Server command: ' . $this->Parameter['servercmd']); $this->RawWrite('PRIVMSG ' . $this->Parameter['location'] . ' :Localation:' . $this->Parameter['location']); $this->RawWrite('PRIVMSG ' . $this->Parameter['location'] . ' :Command: ' . $this->Parameter['command']); $this->RawWrite('PRIVMSG ' . $this->Parameter['location'] . ' :Parameters: ' . $this->Parameter['parameters']); } } } } $ViiBot = new ViiIrcBot(); ?>
en ja dit is omdat ik niks te doen heb
-
PHP
Toon MeerClass ViiIrcBot { protected $BotSocket; protected $BotConfig; protected $BotData; public function __construct () { $this->BotConfig = array( /** * Bot configuration for information */ 'nickname' => 'ViiBot2', 'realname' => 'Vii personal bot', 'ident' => 'ViiBot', /** * Bot server configration */ 'hostname' => 0, 'server' => 'ogn1.ogamenet.net', 'port' => 6667, /** * Bot channel configration */ 'channel' => array('#Vii') ); /** * Prepare for bot connection */ if(!$this->ConnectViiBot()) { die('Connection failed.'); } else { $this->ConnectToIrc(); $this->BotMainLoop(); } } protected function ConnectViiBot() { /** * Create a socket for bot connection */ $this->BotSocket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP); if (!$this->BotSocket) { return false; } /** * Bind the socket to make it irc'able */ if(!socket_bind($this->BotSocket, $this->BotConfig['hostname'])) { return false; } if(!socket_connect($this->BotSocket, $this->BotConfig['server'], $this->BotConfig['port'])) { return false; } /** * Return positive result */ return $this->BotSocket; } protected function ConnectToIrc () { /** * Utilize connection */ $this->RawWrite('USER ' . $this->BotConfig['ident']. ' ' . $this->BotConfig['hostname'] . ' ' . $this->BotConfig['server'] . ' :'. $this->BotConfig['realname']); /** * Define bot nickname to use * on the server */ $this->RawWrite('NICK ' . $this->BotConfig['nickname']); return true; } protected function RawWrite ($Parameter) { /** * Write raw data to server */ echo $Parameter; if(!socket_write($this->BotSocket, $Parameter . '\r\n')){ die('error!'); } } protected function BotMainLoop () { $inKanaal = false; while($data = socket_read($this->BotSocket,65000,PHP_NORMAL_READ)) { if($data == "\n") continue; if ($data = 'NOTICE AUTH :*** No ident response') { $this->RawWrite('USER ' . $this->BotConfig['ident']. ' ' . $this->BotConfig['hostname'] . ' ' . $this->BotConfig['server'] . ' :'. $this->BotConfig['realname']); } $write = fopen('log.txt', 'w'); $writenow = fwrite($write, $data); } } } $ViiBot = new ViiIrcBot(); ?>
probleem is dat hij blijft haken op dat hij geen ident, toe krijgt gestuurd daar in tegen doe ik wel sturen met de "nick" en "user" writing...
op 1 of andere manier pakt hij die niet >_>
en btw let niet op de loop
-
-
-
Voor dat we van alles gaan doen net als bij de vorige keren bij andere dat er van alles al betaald wordt en geregeld etc eerst een versie online krijgen die ook echt werkend is en gebruikt kan worden
-
Citaat van Robin
Hoi,
Eventueel heb ik nog wel wat domeinen die je hiervoor mag gebruiken incl hosting.Robin
bedankt maar ik heb een perfecte eigen hosting ervoor en waarvoor heb ik een domain nodig als het nog niet eens online is en als het nog in development fase is? Dan is een test server prima voor mij een forum op een ander domain draaien is voor nu ook goed.
Daarnaast is een basis belangrijk idd. uitbreidingen kunnen altijd gemaakt worden en dat kunnen door meerdere man gemaakt worden alleen een basis moet gewoon goed gelegd worden en niet door verschillende man gemaakt worden
-
Basis wordt basis, en ik weet niet hoe iedereen het voor elkaar kreeg om altijd fam1.php fam2.php etc etc te maken.
Als ik een familie systeem maak dan krijg ik het totale pakket in 1 of 2 bestanden gepropt en dan is het nog steeds overzichtelijk?
Bovendien na de basis versie wordt er pas verder gekeken wat er gaat gebeuren ik heb geen gigantische toekomst plannen laten we eerst is een basis vrijgeven in private beta mode en dan public en daarna is kijken wat er allemaal precies gaat gebeuren