Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Netham45

Pages: 1 ... 39 40 [41] 42 43 ... 123
601
OmnomIRC Development / Re: Various bits of OmnomIRC Source Code
« on: May 10, 2011, 02:35:33 pm »
New Spybot45 code posted. :D

602
OmnomIRC Development / Spybot45 Dev Ideas
« on: May 10, 2011, 01:44:16 am »
Since I can get external access to the Omni DB, I'ma do something like this for SpyBot45.


Code: (pseudo -almost- PHP code) [Select]
message = mysql_fetch_array(sql_query("SELECT MAX(`id_msg`) FROM `omnitempboard_messages`"));
mID = message[`ID_MSG`];
tID = message[`ID_TOPIC`];
mPoster = message[`posterName`];

topic = mysql_fetch_array(sql_query("SELECT * FROM `omnitempboard_topics` WHERE `id_topic` = %s",tID));
tBoard = topic['ID_BOARD'];
tFirstID = topic['ID_FIRST_MSG'];

fMessage = mysql_fetch_array(sql_query("SELECT * FROM `omnitempboard_messages` WHERE `id_msg` = %s",tFirstID));

tTopicName = fMessage['subject'];

echo sprintf("New Post by %s in %s http://omniurl.tk/%i/%i", mPoster,tTopicName,tID,mID);


I hate SQL sometimes. SMF DB layout even more.

What this does is:

  • Request the most recent post
  • record name, threadid
  • Request the thread associated
  • record first post ID(thread subject), board id(for filtering)
  • Request the first post in the thread
  • Record its subject, it's the title of the thread

That's actually almost all that's required for it, I just need to get it done. That will make it so the site won't slow down really bad when posting if my server is acting up. Right now it's requesting a PHP page off my server every post.

603
OmnomIRC Development / Re: OmnomIRC Dev Ideas
« on: May 10, 2011, 01:27:49 am »
fix'd.

Another thing I'd like to add is that this wouldn't replace the logs, those are best logged to a file as they currently are. This would, though, fix the multi-byte char problems for #omnimaga-fr too.

It'd also be easy to implement a jsonp feed so Eeems would stop raging. :P

604
OmnomIRC Development / OmnomIRC Dev Ideas
« on: May 10, 2011, 01:21:41 am »
Posting some thoughts I've been having about updating Omnom to be less resource intensive. Just throwing some of this stuff out there if anyone wants to comment.

Don't refresh every 5 seconds or so, but use long polling loop and just return a result when something is said(Would need some sort of client-side parser, but that could be really easy to
do.)

Basically, request update.php, update.php waits with server-side sleep()'s. When something is updated, it finishes update.php and returns the event, something like this:
eventType:base64(message)
Join:base64("Netham45")

the client-side parser would then split it based off of the :, and run Join('Netham45') which would update the textbox, which would print something like 'Netham45 has joined.' or something. Here is what I was thinking for those:

names,messages,modes,targets would be base64_encode'd
line would be the current line, a unique ID for the last line its gotten, for keeping track of where it should check server-side
Code: [Select]
line:join:name
line:join:netham45

line:part:name:message
line:part:netham45:Z8015-190D

line:quit:name:message *Merge quit and part?
line:quit:netham45:Z8015-190D

line:kick:kicker:kicked:message
line:kick:netham45:netbot45:Kick!


line:message:name:message:isOmnom
line:message:netham45:Nom!:1

line:action:name:message
line:action:netham45:explodes


line:mode:modes:targets
line:mode:+ovib:Netham45 Netham45 *@*!*

I was also planning on storing however many lines I'm displaying in an array.

Code: [Select]
Lines = Array();
Lines[0] = "1:message:Netham45:NOM!";
Lines[1] = "2:kick:Netham45:Netbot45:(Netham45)";
...

addLine(message)
{
var i = 1;
for (i;i<Lines.count();i++)
{
Lines[i-1] = Lines[i];
}
Lines[i] = message;
parseMessages();
}

and to parse, something similar:

Code: (parserish thingey javascript-ish code) [Select]

parseMessages()
{
for (i = 0;i<Lines.count();i++)
{
parse(Lines[i]);
}
}

parse(message)
{
chatBox = "";
parts = message.split(":")
type = parts[1]
curLine = lines;
switch type
{
case "join":
chatBox = chatBox + join(parts[2]);break;
case "part":
chatBox = chatBox + part(parts[2],parts[3]);break;
case "quit":
chatBox = chatBox + quit(parts[2],parts[3]);break;
case "kick":
chatBox = chatBox + kick(parts[2],parts[3],parts[4]);break;
case "message":
chatBox = chatBox + message(parts[2],parts[3]);break;
case "action":
chatBox = chatBox + action(parts[2],parts[3]);break;
case "mode":
chatBox = chatBox + mode(parts[2],parts[3]);break;
}
}

join(name)
return name + " has joined";
part(name,reason)
return name + " has left #Omnimaga (" + reason + ")";
quit(name,reason)
return name + " has quit IRC (" + reason + ")";
etc...

Server-side, I plan on having an IRC bot that logs the last 1000 or so lines to a SQL table as they're said. Any more is worthless, half that would still be worthless. :P
irc_lines = (`line_number`k,ai,`name1`,`name2`,`message`)
Code: (pseudo) [Select]
curPos = sql_query("SELECT MAX(`line_number') FROM `irc_lines`");
sql_query("INSERT INTO `irc_lines` (`action`,`name1`,`name2`,`message`) VALUES ('%s','%s','%s','%s')",curPos,"Join","Netham45","0","0");
sql_query("INSERT INTO `irc_lines` (`action`,`name1`,`name2`,`message`) VALUES ('%s','%s','%s','%s')",curPos,"Kick","Netham45","Netbot45","Stop Lagging you stupid bot!");
sql_query("DELETE FROM `irc_lines` WHERE `line_number` < %s",curPos - 1000);
And to get it from the server, something like this:
Code: (more pseudo) [Select]
getLines()
{
while (true)
{
stuffs = mysql_fetch_array(sql_query("SELECT * FROM `irc_lines` WHERE 'line_number' > %s",reqLines));

for (i=0;i<count(stuffs);i++)
{
switch (stuffs['action'])
{
case "join:
echo stuffs['line_number'] . ':' . stuffs['action'] . ':' . stuffs['name1];
etc...
}
}
if (count(stuffs)) break;
sleep(50);
}
}



Gimmeh ideas/suggestions.

605
Computer Programming / Re: IRC Score Bot
« on: May 09, 2011, 08:50:14 pm »
I voted no for this, seems like it'd just promote spamming and conflict.

606
News / Re: Crabcake Released
« on: May 09, 2011, 03:41:54 pm »
Does anyone know the point of the 8kb limit?

607
News / Re: Crabcake Released
« on: May 09, 2011, 03:38:18 pm »
I call hax.Very nice.

608
TI Z80 / Re: Help with Mario game
« on: May 09, 2011, 06:01:05 am »
And, making your questions more specific helps us help you quite a bit.

Something like
Quote
Why does this code only execute 4 times?
Code: (Problematic Code) [Select]
5->a
while (a>1)
...
a-1->a
end

is a LOT more helpful than

PLEASE HELP I ADDED A GOOMBA IT DECREASED SPEED


Possibly post a small piece of code and ask for possible optimizations, too?

610
BatLib / Re: BatLib News
« on: May 07, 2011, 06:35:35 am »
I'm honestly surprised to read this. I tend to stay out of a fair bit of the politics, so I didn't know anything was up.

I don't talk much outside of IRC, but based off your conduct there, you were one of the people I held in high regard. Looking at how you're handling this, I have to say that I still hold you in that high regard.

Sucks to see you go, but hopefully you'll still come visit.

611
I took 'em out for debugging issues, I was rewriting a chunk of it, and that was throwing errors for some reason.

I'ma make new ones sometime.

612
Yup. :P

613
Yea, the stupid bugger doesn't work with any of the CSS right.

614
OmnomIRC Development / Re: OmnomIRC temporarily disabled
« on: May 06, 2011, 11:18:31 pm »
ima move iOmnom Mini to my server some tme, but I don't think it is a big issuee right now.

Pages: 1 ... 39 40 [41] 42 43 ... 123