31 August, 2006

miscellany: More ideas to code and recode and recode.

Now that the original mailcode works as designed, it's time to add the reply code. So far it's been a bit of a wrestle, but what I'm going to try is having the text link send the prior message's contents and applicable info to the chatbot. Save necessary info to a temp file suitably named for the username in a temp directory as a pipe delimited file. Then, upon an attempted reply, check for the temp file if the sender has the proper permissions to use the system, open the file if it exists, append the needed bits into the new text, and send.

Said brainstorm, of course, should be implemented not into a second plugin with different usage than the original mailcode.

So now it's just time to see about retrofitting the old mailcode into the newer setup. Maybe add forwarding and CC/BCC capabilities while I'm at it, ha ha ha. This will either never get finished due to constant nitpicking, or will get finished, but never be released for general use.

If this works, there's no real reason to use the interdepartmental mail (save some sort of archiving) as it stands-- unless some of the regular mailcode features get added in. Also, the interdepartmental mail is limited only to internal use, so it'll probably get somewhat less use.

28 August, 2006

miscellany: more coding nonsense

Got the directory listings to work. And on the first go, too. Makes up for some of the stuff I've been going around and around on.

Forums work, too. Turns out there was a problem with the original bot forum posting code that made nothing actually get posted. Altered the code to match up more with the e-mail coding, and now it works.

Interdepartmental mail is still buggy-- the messages get saved, but not necessarily sent to offline recipients. Might be an error with how I set up the basic user permissions. Have to double check.

Still haven't bothered with a reply plugin yet, but I'll get to it. Also want to alter the existing user reports code.

Then, all I have to do is see if anyone would want to use and host the damn thing. I don't want to run the chatbot, as it will require always on capability.

27 August, 2006

miscellany: starting to port code back into plugins

Now that some of the bot code is starting to function as intended, I've started sticking it out of the main bot code, and back into the plugin format which didn't work when I first started this little project.

The department member add/remove works, and so does the current pseudo-email. Went with the unstored blob method, which will no doubt be the wrong choice-- could pretty easily go back to storing everything, but I don't currently feel like it.

Still working on interdepartmental messaging, forums (or "reports"), and maybe a departmental listing. Perhaps even allow for users to post a bit of biographical information and a departmental affiliation.


while($coding_headaches>=0 || $hateful>=0 || ($foo>=0 && $bar>=0)){if(!empty($cigarettes)){if(file_exists("pocket/cigarettecase/cigarettes")){$cigsmoke=
fopen("pocket/cigarettecase/cigarettes", "w");if($cigarettes>=1) {$cigarettes--;fwrite($cigsmoke,"cough cough");fclose($cigsmoke);$coding_headaches--;$hateful--;$foo--;$bar--;}
else{$no_cigarettes="aaaaaaarrrrgh!";echo $no_cigarettes;$coding_headaches++;$hateful++;$foo++;$bar++;}}}
if(empty($coffeecup)){
if(file_exists("kitchen/apps/coffeemaker"))
{$coffee=fopen("kitchen/apps/coffeemaker", "w");$scoop=0;$h20=0;
while($scoop<15){$scoop++;while($h20<10){$h20=++;}}$ready=600;
while($ready>=600){$ready--;}if ($ready==0){fwrite($coffee,"done");fclose($coffee);$
coffeecup=10;}}else{$no_coffee="aaaaaaarrrrgh!";echo $no_coffee;$coding_headaches++;$hateful++;$foo++;$bar++;}}
if($coffeecup>=1){$coffeecup--;$coding_headaches--;
$hateful--;$foo--;$bar--;}if($no_cigarettes=="aaaaaaarrrrgh!" && $no_coffee="aaaaaaarrrrgh!"){if($coding_headaches!=0 && $hateful!=0 && ($foo+$bar!=0)){$coding_headaches=$coding_headaches*$hateful*($foo + $bar);}}}


26 August, 2006

miscellany: insert evil cackling here

So, converting the text input into a blob works-- and so does the way it's currently set up to send. Won't save on the bot host, so shouldn't be bogging down a drive with storing this stuff. (Could probably explain it as messages being destroyed on transmission for optimal security, or some such.)

Next thing then, is a reply function. Will have to store the prior contents as a text link in the mail message, along with the subject and sender. This should be another learning experience :D

The new version of the department roster administration code doesn't work, mainly because the function I wrote to handle the department check is bugged. Might fix it, or just go the path of least resistance and use the working prior version instead of the "upgraded" broken version.

24 August, 2006

miscellany: inspired by Warning: on line 13739

Now that some of the damn mailcode sort of works, why not try and simplify it a bit more by just making a blob and firing it off to the recipient? No need to store it on the bot host, since it's really just for pseudo-e-mail for a game. Also gets rid of most of the problems with random bot guests reading others' mail.

Then, the interdepartmental mail becomes a bit more useful. Less duplication of service.

Edit: Well, now it's a new unexpected T_VARIABLE on line 13272. Hurray for multiple backups before making any changes... bleh, will fix it tomorrow.

22 August, 2006

miscellany: "Parse error, unexpected T_VARIABLE on line 13687"

I hate missing semicolons.

Problem created right before bed yesterday, and fixed at first chance today. Have a decent chunk of the added functionality for the bot working, but there's still quite a bit to hammer out.

The finished pile:
  • Login (not actually a functional login, just works for "looks"-- and it provides access to the actually intended functions.
  • admin adding/removing members from departments
  • header/footer (looks vaguely e-mailish)
Needs work:
  • interdepartmental code works, but the formatting of the results is from hell
  • forum code appears to work, but doesn't
To be implemented (maybe):
  • some way to file reports (probably just altered mailcode)
  • a way to reply to the mail (like the web-based "reply" button)
  • something else that will no doubt occur to me as I screw up another bit of code, ad nauseum
  • take all those bits of edited code that didn't work as plugins the first several times (the ones that work as part of the main php file) and mangle them into working plugins. MWAHAHAHAHAHAHAH!!! Won't that be masochistic.