| View previous topic :: View next topic |
| Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Thu Apr 30, 2020 11:10 am Post subject: custom pushmode |
|
|
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 |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Thu Apr 30, 2020 12:21 pm Post subject: |
|
|
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
_________________ ComputerTech |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Thu Apr 30, 2020 1:10 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Thu Apr 30, 2020 1:34 pm Post subject: |
|
|
| 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: |
# 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 ! |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Thu Apr 30, 2020 3:29 pm Post subject: |
|
|
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?t=20608&highlight=clone
| Code: |
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 |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri May 01, 2020 9:09 pm Post subject: |
|
|
searching the forum i found
| Code: |
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 |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri May 01, 2020 10:01 pm Post subject: |
|
|
If anyone could help me modify the previous posted mass mode to todays eggdrop version would be much appreciated.
Tnx in advance |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat May 02, 2020 8:36 am Post subject: |
|
|
i modified it and it seems to be working as intended without errors or complaints
i like to thank user who wrote it |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon May 04, 2020 6:55 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon May 04, 2020 9:43 am Post subject: |
|
|
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:
| Quote: |
+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. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon May 04, 2020 11:35 am Post subject: |
|
|
tnx once again for your reaction caesar i tested just now let me show u the results
| Quote: |
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 |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Mon May 04, 2020 3:38 pm Post subject: |
|
|
Caesar said | Code: |
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
as i said at the start  _________________ ComputerTech |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon May 04, 2020 6:00 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Tue May 05, 2020 11:09 am Post subject: |
|
|
again hehe
ComputerTech said before | Code: |
if it's for pushmode +a for admin of a user thats different
|
thats what i said
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  _________________ ComputerTech |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue May 05, 2020 2:36 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|