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!
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

custom pushmode

Post by simo »

greetz,
when using pushmode i noticed certain channel modes like +a when stacking modes dont get recognized and thus wont get set.

Is there anyway to create a custom pushmode proc to be used to stack modes in the case of modes not gettin recognized i find this usefull for the use on certain ircds

tnx in advance.
Last edited by simo on Thu Apr 30, 2020 1:14 pm, edited 1 time in total.
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

um which channel mode is +a never heard of it
if it's for pushmode +a for admin of a user thats different

And putserv does the job also

Code: Select all

 putserv +a
ComputerTech
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i know it does but it doesnt stack them like pushmode does
and after max modes per line allowed on ircd has been exceeded it wont set at all
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

simo wrote: ...
and after max modes per line allowed on ircd has been exceeded it wont set at all
Once upon a time , I fiddled with this sort of thing that you started this thread about.
I remember doing it. I just spent some time looking for notes or old scripts or anything, and can't find anything. :(

However, upon seeing the above quoted, and since I'd just been digging - I was reminded of something that is somewhat related.
This is a side note, as it does not directly address your immediate problem.

It sounds like you are investigating and pursuing it.
Good.
Be sure to find this part in eggdrop.conf :

Code: Select all

# Some networks allow you to stack lots of channel modes into one line.
# They're all guaranteed to support at least 3, so that's the default.
# If you know your network supports more, you may want to adjust this.
# This setting is limited to 6, although if you want to use a higher value,
# you can modify this by changing the value of MODES_PER_LINE_MAX in
# src/chan.h and recompiling the bot.
#set modes-per-line 3
as it may affect whatever you are experimenting with, and cause you to waste time.

There is also a
max-modes
setting.

Just text search eggdrop.conf for mode and/or modes and quickly read comments with every instance of it to see if it applied at all to what you are working on. Doing so could save you some head scratching, as you proceed.
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: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

thank you willyw i already use that the thing is that works with pushmode and pushmode doesnt set all modes like +aaaaaaaaaaa so i thought of a generic custom pushmode that will set any mode in stack

i started with the code posted by caesar http://forum.egghelp.org/viewtopic.php? ... ight=clone

Code: Select all

 proc stackBans {chan banlist} {
      set max 25
      set count [llength $banlist]
      while {$count > 0} {
         if {$count> $max} {
            set mode [string repeat "b" $max]
                set masks [join [lrange $banlist 0 [expr {$max - 1}]]]
                set banlist [lrange $banlist $max end]
                incr count -$max
                incr total $max
         } else {
            set mode [string repeat "b" $count]
            set masks [join $banlist]
            incr total $count
            set count 0
         }
      putnow "MODE $chan +$mode $masks" 
      }
   }

i changed it somewhat and used putnow but the thing is this is only for a single mode +b instead aof a generic one where u can use any chmode im kinda stuck where to go from here
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

searching the forum i found

Code: Select all

proc massmode {chan mode arg} {
	scan $mode {%[-+]%[bov]} p m
	set j [llength $arg]
	set k [expr {${::modes-per-line}-1}]
	set out "";
	for {set i 0} {$i<$j} {incr i} {
		set args [lrange $arg $i [incr i $k]]
		append out "MODE $chan $p[string repeat $m [llength $args]] [join $args]\n"
	}
	putdccraw 0 [string len $out] $out
}
i took from : http://forum.egghelp.org/viewtopic.php?t=7273

it seems to work well only the putdccraw seems deprecated i get warnings
Warning! putdccraw is deprecated. Use putnow instead!

using putnow "0 [string len $out] $out" didnt seem to work well

it doesnt set all the modes entirely it does using putdccraw 0 [string len $out] $out
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

If anyone could help me modify the previous posted mass mode to todays eggdrop version would be much appreciated.

Tnx in advance
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i modified it and it seems to be working as intended without errors or complaints

i like to thank user who wrote it
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

I just had 1 thing i was wondering if the massmode proc could be modified to handle multiple modes to lessen the amount of lines and have it compress modes as much as possible
For example: massmode $chan -v+b [join nicks][join bmasks]
Instead of sending it like
massmode $chan -v [join nicks]
massmode $chan +b [join bmasks]

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

Post by caesar »

Sorry if this sounds stupid, but is that 'a' a valid or even allowed channel mode in the first place?

Btw, putdccraw was deprecated so instead you should use putdcc or putnow (have a look at 'scripts/compat.tcl' that comes with the eggdrop).

You want to push out fast stacks of modes? putquick is too slow?

Edit: How would a line to voice A, B and C and ban *!*@a.com, *!*@b.com and *!*@c.com look like?

I mean dose it look like:
+vvv+bbb A B C *!*@a.com *!*@b.com *!*@c.com
?
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

tnx once again for your reaction caesar i tested just now let me show u the results
17:34:22 <+simo> .b Anaya Archibald Arturo Ashleigh Benjamin Britton Carlito Eartha Frame Holley Homer Lange Lavender Layla Leary Mcgrath Mckenna Mendenhall Proffitt Saenz Salerno Samuel Sharkey Simone
17:34:22 @TCL-Tester Sets Mode on #tcl-test to: +bbbbbbbbbbbbbbb *!*@123.149.76.44 *!*@nqpu:lqx1:0:e565::yr4u:r40g *!*@4MSJ76KF.IGHX27CM.2G2DUIY0.IP *!*@kn2l:s86p:8:e321::8802:98d2 *!*@31.222.222.232 *!*@112.97.54.150 *!uid304591@* *!*@a247:6384:3:3veg::k0n8:vi9u *!*@23.13.13.12 *!uid73149@* *!*@BVRQVAGE.S4KES3EI.I12G26PR.IP *!*@131.178.177.68 *!*@81.81.182.78 *!*@0m1f:39c9:3:r6lc::v055:iy8q *!*@50.150.158.125
17:34:22 (13 Users) Are Banned Anaya Archibald Arturo Ashleigh Benjamin Britton Carlito Frame Holley Homer Lange Lavender Leary
17:34:22 @TCL-Tester Sets Mode on #tcl-test to: +bbbbbbbbb *!sid27555@* *!*@133.81.84.82 *!*@80.23.182.76 *!*@233.331.11.233 *!*@Cloaked-b6r.530.61.13.IP *!*@Cloaked-u0i.890.20.71.IP *!uid41669@* *!sid24364@* *!*@19.39.234.95
17:34:23 (9 Users) Are Banned Mcgrath Mckenna Mendenhall Proffitt Saenz Salerno Samuel Sharkey Simone
17:34:23 @TCL-Tester Sets Mode on #tcl-test to: -vvvvvvvvvvvvvvv Anaya Archibald Arturo Ashleigh Benjamin Britton Carlito Eartha Frame Holley Homer Lange Lavender Layla Leary
17:34:23 @TCL-Tester Sets Mode on #tcl-test to: -vvvvvvvvv Mcgrath Mckenna Mendenhall Proffitt Saenz Salerno Samuel Sharkey Simone

in this case the ircd allows 15 modes per line but it sets less in some and we wanted it to be compressed in modes-per-line as much as possible to have it use less lines in channel
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Caesar said

Code: Select all


Sorry if this sounds stupid, but is that 'a' a valid or even allowed channel mode in the first place? 

Btw, putdccraw was deprecated so instead you should use putdcc or putnow (have a look at 'scripts/compat.tcl' that comes with the eggdrop). 
thats what i said never seen "a" as a channel mode

i still think putnow putquick,putserv would do the trick :roll:
as i said at the start :wink:
ComputerTech
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

hey there caesar, and yes it is a valid cmode on the ircd im using and others as well its admin cmode & and about the putdccraw i changed that to putnow
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

again hehe
ComputerTech said before

Code: Select all

if it's for pushmode +a for admin of a user thats different 
thats what i said :wink:

anyway yeah
note putnow used too much can get your bot in trouble depending on the ircd the bot is on
hehe i got in trouble before ever since i use putserv same thing slightly slower. but if your just putnow for channel modes it should be alright :P
ComputerTech
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

would this also be possible to send a lot of single modes and have it compress it in strings of 15 caesar instead of sending stacked modes to the proc ?

for example you send like 20 modes at it and it compresses them into stacks of max 15
Post Reply