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 ... 24 25 [26] 27 28 ... 123
376
OmnomIRC Development / IRC Client Integration
« on: June 27, 2011, 07:03:03 am »
Hey, this is Sorunome here. Below you can find Nethams original post.

This are bindings for OmnomIRC to integrate into an IRC client, like, let's say, HexChat.
Ok, HexChat is the only one I've written it for, so far.
The binding is available at the repository, currently only the dev branch, so go over here: https://github.com/Sorunome/OmnomIRC2/blob/dev/omnombindings_hexchat.py




Netham45's stuff may still work, but maybe not, it is untested and heavily outdated as I changed the IRC bot a lot since. You can still check it out, though

Old code/bindings, by Netham45:
Spoiler For old:

I've written some tools to allow OmnomIRC to integrate into your IRC clients.

Here's the mIRC code, just put this into the remote.ini section of your scripts:

Spoiler For OmnomIRC only code:
Code: [Select]
ON ^*:TEXT:*:#:if ( $nick == OmnomIRC ) { echo $chan $iif($regsubex($readini($mircini,options,n4),/(^(.+?,){11}(.+?).*)/,\3) == 1,$timestamp,) $iif( $mid($1-,2,1) == $chr(35) , (4 $+ $chr(35) $+ ) $+ $mid($1-,4), (12O) $+ $mid($1-,7) ) | haltdef }

Spoiler For OmnomIRC & Saxjax code:
Code: [Select]
ON ^*:TEXT:*:#:{
  var %timestamp $chr(20)
  if ($regsubex($readini($mircini,options,n4),/(^(.+?,){11}(.+?).*)/,\3) == 1) { var %timestamp $timestamp }
  if ( $nick == OmnomIRC ) { echo $chan %timestamp $iif( $mid($1-,2,1) == $chr(35) , (4 $+ $chr(35) $+ ) $+ $mid($1-,4), (12O) $+ $mid($1-,7) ) | haltdef }
  if ( $nick == Saxjax ) { echo $chan %timestamp $regsubex( $1- ,\((.)\).\[(.+?)\] (.*),( $+ 5\1 $+  $+ ) <\2> \3) | haltdef }
}

And there is an XChat plugin attached. To use this, put it in %appdata%\X-Chat 2\ and restart XChat.
The file included only works on Windows X-Chat 2.

Here is the source code if someone wishes to compile it for Linux. It's a bit rushed, and not the neatest.
Code: [Select]
#include "xchat-plugin.h"
#include <string>
#include <cstdlib>
#include <regex>
#include <iostream>
#define PNAME "OmnomIRC Integration"
#define PDESC "Integrates OmnomIRC into X-Chat"
#define PVERSION "0.1"

static xchat_plugin *ph;   /* plugin handle */
static int enable = 1;
static char omnomIRC_Name[] = "OmnomIRC";
using namespace std::tr1;
using namespace std;
//#define debug
static void dbgPrint(const char *message)
{
#ifdef debug
xchat_print(ph,message);
#endif
}
static void dbgPrint(string message)
{
#ifdef debug
xchat_print(ph,message.c_str());
#endif
}
static string getMessageType(string message)
{
if (regex_search(message.begin(),message.end(),regex("^.{0,3}\\((.)\\).{0,1}<(.+?)> (.*)")))
return "message";
if (regex_search(message.begin(),message.end(),regex("^.{0,4}\\((.)\\)([^:space:]{0,4})\\* ?(.*)")))
return "action";
return "";
}
static char* getNameColor(const char *name)
{
char *rcolors[] = {"19", "20", "22", "24", "25", "26", "27", "28", "29"};
int sum = 0, i = 0;
while (name[i] != '\x00')
sum += name[i++];
sum %= 9;
return rcolors[sum];
}
static int on_text_cb(char *word[], void *userdata)
{
if (strcmp(word[0],omnomIRC_Name))
{
string messageType = getMessageType(word[2]).c_str();
string type = word[0];
cmatch parts;
if (strcmp(messageType.c_str(),"message") == 0)
{
regex rx("^.{0,3}\\((.)\\).{0,1}<(.+?)> (.*)");
regex_search(word[2],parts,rx);
bool omnomirc = parts[1].str().c_str()[0] == 'O';

string name;
if (omnomirc)
{
name.append("\x03""(\x03""12O\x03"")\x03");
name.append(getNameColor(parts[2].str().c_str()));
}
else
{
name.append("\x03""(\x03""4#\x03"")\x03");
name.append(getNameColor(parts[2].str().c_str()));
}
name.append(parts[2]);
string msg;;
msg.append(parts[3]);
parts[2].str();
if (xchat_nickcmp(ph,xchat_get_info(ph,"nick"),parts[2].str().c_str()) == 0)
xchat_emit_print(ph, "Channel Message",name.c_str(), msg.c_str(), "@", NULL); //Don't highlight on local messages
else
xchat_emit_print(ph, type.c_str(), name.c_str(), msg.c_str(), "@", NULL);
return XCHAT_EAT_ALL;
}
else if (strcmp(messageType.c_str(),"action") == 0)
{
regex rx("^.{0,3}\\((.)\\)([^:space:]{0,4})\\* ?(.*)");
regex_search(word[2],parts,rx);
bool omnomirc = parts[1].str().c_str()[0] == 'O';
string name = "\x03""\x03";
if (omnomirc)
name.append("12O\x03""18 *");
else
name.append("04#\x03""18 *");
string message(parts[2]);
message.append(parts[3]);
xchat_emit_print(ph, type.c_str(), name.c_str(), message.c_str(), "@", NULL);
return XCHAT_EAT_ALL;
}

}

   return XCHAT_EAT_NONE;
}

void xchat_plugin_get_info(char **name, char **desc, char **version, void **reserved)
{
   *name = PNAME;
   *desc = PDESC;
   *version = PVERSION;
}

int xchat_plugin_init(xchat_plugin *plugin_handle,
                      char **plugin_name,
                      char **plugin_desc,
                      char **plugin_version,
                      char *arg)
{
   /* we need to save this for use with any xchat_* functions */
   ph = plugin_handle;

   /* tell xchat our info */
   *plugin_name = PNAME;
   *plugin_desc = PDESC;
   *plugin_version = PVERSION;

   xchat_hook_print(ph, "Channel Message", XCHAT_PRI_NORM, on_text_cb, NULL);
   xchat_hook_print(ph, "Channel Msg Hilight", XCHAT_PRI_NORM, on_text_cb, NULL);

   xchat_print(ph, "OmnomIRC Integration loaded successfully!\n");

   return 1;
}

Edit: Updated mIRC script. >:D


377
News / Re: OmnomIRC temporary offline
« on: June 27, 2011, 02:17:39 am »
Ah that's good. Was it made on purpose for those running botnets or something due to other Efnet admins being picky? I remember a few years ago no bot were allowed at all on EFnet O.O (although people used eggdrops anyway)

Quote from: irc.mzima.net
* -            The usage of bots is encouraged to help maintain your
* -            channel, however abusive bots will be removed post haste.

That's all I know about their policy on it. I just know that I've had 8 or 9 clients on there before while developing bots and such.

378
OmnomIRC Development / Re: Duplicated nicks in user list
« on: June 27, 2011, 01:57:20 am »
Is it supposed to be fixed now? Because I saw it happen again earlier. OmnomIRC, InvaderKED and Eeems were showing up twice, and KittiGirl1 showed up as well, even though she was only online as KittyGirl.

I believe that's because they're on both networks, or they're signed into IRC twice(got disconnected, and the ghost hasn't timed out, etc...)

379
News / Re: OmnomIRC temporary offline
« on: June 27, 2011, 01:55:39 am »
This sucks Netham45. However does Mzima allows multiple connections?

Yes. In fact, they're the only server on efnet that doesn't have a connection cap.

380
OmnomIRC Development / Re: Duplicated nicks in user list
« on: June 26, 2011, 07:30:04 pm »
That was due to it freaking out last night when it got k-lined from choopa.

381
OmnomIRC Development / Re: Scrolling got brokened
« on: June 26, 2011, 07:29:25 pm »
Fixed. Had changed the name of the box that contained the messages for IE (ugh) compatibility, and forgot to change what the scrollers were targeting.

382
I wasn't requesting enough lines to fill a large display. I've upped it to 150 lines, should solve that.

Also, the style was set at page load. I moved the dynamic sizing things into the onresize event.

383
News / Re: OmnomIRC temporary offline
« on: June 26, 2011, 05:45:30 am »
I blame this one on EFNet. The damn server I was on (Choopa) k-lined me for no visible reason what-so-ever, so it kept trying to reconnect, getting whacked for k-line, restarting, trying to reconnect, etc..., flooding the chatbox every time it joined the chans properly on OmniNet.

Also, from this point on, I am going to use mzima exclusively for bots, as they seem to be the only bot-friendly server (as in, the only server that isn't so goddamn stupid they randomly k/d-line people who match an unpublished list of generic identifying traits).

384
fix'd. CSS issue.

385
OmnomIRC Development / Re: Join/part/quit messages
« on: June 25, 2011, 02:42:58 pm »
fix'd.

386
OmnomIRC Development / Re: Having issues with OmnomIRC? START HERE!
« on: June 25, 2011, 02:22:23 pm »
@Silver, my guess is you have some sort of extension like noscript or something that's getting a bit overzealous and screwing with stuff. That's beyond just screwing up, your browser isn't refreshing properly when content is updated. All the gibberish in the username box makes me think that something is corrupted somewhere.

@Shmibs, I fixed the text being on the left like that a while ago(a long while ago), that happened when I moved over from divs to a table. Have you cleared cache and such?

387
That was me moving stuff around.

388
OmnomIRC Development / Re: iOmnom development thread
« on: June 25, 2011, 01:52:56 am »
that's not iOmnom, but I removed it by accident. Sec.

389
OmnomIRC Development / Re: OmnomIRC Protocol Information
« on: June 25, 2011, 01:02:59 am »
Oh ok. Well I hope you don't have too much troubles implementing a secure way to do this.

I think I just got it. >:D

http://netham45.org/OmnomIRC_Test/

^ This should automagically rip out your Omnimaga name.

390
OmnomIRC Development / Re: OmnomIRC Protocol Information
« on: June 25, 2011, 01:00:29 am »
Just came up with a simple solution. Script tags don't fall victim to the same origin policy, so I don't need all that crap.

And, DJ, my goal of making it use the sites cookies is to not need to use usernames/passwords.

Pages: 1 ... 24 25 [26] 27 28 ... 123