This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Character limit on bot<>bot communication?

Old posts that have not been replied to for several years.
Locked
C
ClubCX
Voice
Posts: 35
Joined: Mon Nov 19, 2001 8:00 pm
Location: Bournemouth, UK
Contact:

Character limit on bot<>bot communication?

Post by ClubCX »

I've increasingly been using the botnet for transferring of information between bots, allowing workloads to be shared or delegated. However, I've run into a problem sending long lines, such as a 500 character privmsg. It seems to get truncated somewhere around 300 characters before the remote bot can parse it.

I've had the same problem when trying to store a lot of information in an XTRA user record, with the limit also being around 300 characters. Is there a reason for these restrictions?
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

if you really use privmsg: the IRCD's of nearly all networks limit the number of chars you can send.
For botnet communication: i dont know if there is a limit, if there is then just split the line and send it in smaller parts
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Why not use putbot/putallbots ?
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

putbot has a limit of 400 bytes (including the keyword + trailing space)
Have you ever read "The Manual"?
C
ClubCX
Voice
Posts: 35
Joined: Mon Nov 19, 2001 8:00 pm
Location: Bournemouth, UK
Contact:

Post by ClubCX »

Why is putbot limited to 400 bytes?
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

Possibly eggdrop author(s) doesn't need longer. You can always change it in:
src/tcldcc.c

Code: Select all

static int tcl_putbot STDVAR
{
  int i;
  char msg[1001];

  BADARGS(3, 3, " botnick message");

  i = nextbot(argv[1]);
  if (i < 0) {
    Tcl_AppendResult(irp, "bot is not on the botnet", NULL);
    return TCL_ERROR;
  }
  strncpyz(msg, argv[2], sizeof msg);

  botnet_send_zapf(i, botnetnick, argv[1], msg);
  return TCL_OK;
}
Now you can use 1000 bytes :) You can do the same for tcl_putallbots :)
Que?
C
ClubCX
Voice
Posts: 35
Joined: Mon Nov 19, 2001 8:00 pm
Location: Bournemouth, UK
Contact:

Post by ClubCX »

Thanks, KrzychuG. Can I also change the length of XTRA fields in user records?
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

Is XTRA limited to 500 bytes? If yes, then you can find it in src/userent.c

Code: Select all

 int xtra_tcl_set(Tcl_Interp * irp, struct userrec *u,
                        struct user_entry *e, int argc, char **argv)
{
  struct xtra_key *xk;

  int l;

  BADARGS(4, 5, " handle type key ?value?");

  xk = user_malloc(sizeof(struct xtra_key));
  l = strlen(argv[3]);
  egg_bzero(xk, sizeof(struct xtra_key));
  if (l > 500)
    l = 500;
  xk->key = user_malloc(l + 1);
  strncpyz(xk->key, argv[3], l + 1);

  if (argc == 5) {
    int k = strlen(argv[4]);

    if (k > 500 - l)
      k = 500 - l;
    xk->data = user_malloc(k + 1);
    strncpyz(xk->data, argv[4], k + 1);
  }
  xtra_set(u, e, xk);
  return TCL_OK;
}
Just change 500 to higher value (in 4 places as you see) , then find function xtra_gotshare and change 500 (also in 4 places) to same value as in xtra_tcl_set :)

I posted it in wrong topic last time ;)
Que?
Locked