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.

custom pushmode

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

why not just like this

Code: Select all

putserv "mode $chan +a"
putserv "mode $chan +a"
putserv "mode $chan +a"
or something like that use that as a example
all under the same proc

and you can replace putserv with putnow or putquick :D
ComputerTech
s
simo
Revered One
Posts: 1069
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

if your willing to help out would be apreciated caesar or anyone else who knows tcl the idea is to be able to send stacked and single modes to massmode and to have massmode stack them by itselve just like pushmode does only pushmode doesnt recognize all chanmodes thets the reason for wanting to use a custom pushmode that makes it also usefull for scripts i use that send single modes in mass but sent one by one
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I looked at eggdrop's source code on GitHub and I don't see anything limiting what modes the 'pusmode' can set:

Code: Select all

static int tcl_pushmode STDVAR
{
  struct chanset_t *chan;
  char plus, mode;

  BADARGS(3, 4, " channel mode ?arg?");

  chan = findchan_by_dname(argv[1]);
  if (chan == NULL) {
    Tcl_AppendResult(irp, "invalid channel: ", argv[1], NULL);
    return TCL_ERROR;
  }
  plus = argv[2][0];

  mode = argv[2][1];
  if ((plus != '+') && (plus != '-')) {
    mode = plus;
    plus = '+';
  }
  if (argc == 4)
    add_mode(chan, plus, mode, argv[3]);
  else
    add_mode(chan, plus, mode, "");
  return TCL_OK;
}
If you do a

Code: Select all

.tcl puthelp "MODE #channel +a"
for example, dose it work?

Apart the 'a' flag, what other channel flags don't work?
Once the game is over, the king and the pawn go back in the same box.
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

caesar wrote:I looked at eggdrop's source code on GitHub and I don't see anything limiting what modes the 'pusmode' can set:
I suspect that the problem isn't that. I think it is that pushmode can take another argument, with only some modes. An example would be +o .
As in: pushmode #chan +o somenick

I think that +a is such a mode where it cannot. And I think that's where the snag is. It's not taking a nick as an argument, after the mode value - if it is "a".

Let's see what the original poster has to say. I hope understood it.

To really be sure of what is going on, wouldn't the thing to do be : enable the use of the r and v flags in the console, for bot owner, and then add them to console?
THEN do the .tcl command you proposed, along with some others, and compare and really see what is going on?
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
s
simo
Revered One
Posts: 1069
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

The thing about pushmode is u cant send for example: pushmode $chan +bo-v bmask nick nick and a normal mode setting like the example you gave would not even be set if max allowed on ircd was exceeded not to mention it does not do any stacking by itself.
The idea with a custom pushmode proc is it would take both stacked and single modes and stack them using modes-per-line and wouldnt have any limitations when it comes to chanmodes like pushmode seems to have
i hope the point im trying to make is a bit more clear

Tnx in advance
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

@willyw : It takes a minimum of 2 or maximum of 3 arguments. The first being the channel, second is the mode change (if there's no + or - sign in the 'mode' then it will add a + by default) and finally last one is the argument one of the modes that need one, for example limit or channel key.

I looked at the code and don't see where the snag comes from.

@simo: You talk about two things in one:

- one function that would stack let's say you got 20 elements and want to take out 5 at a time. This is doable and isn't much of an issue.

- 'single modes' to be stacked that's basically means reinventing the wheel, or simpler put a new queue system that would accept any form of input and stack the output in a time frame.

Wouldn't be easier if you try to send a stack stuff to be split or delay those single mode change until would have a stack in your proc?

I'll have a try at this but not right now cos got some stuff at work that need my attention.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1069
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

tnx in advance caesar
Post Reply