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.

+S mode on linknet

General support and discussion of Eggdrop bots.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

soraver wrote:so, where can i find this linknet+s.diff?
there's a 404 there, and eggdrop still doesnt support the +S mode :S
Look at the date on that post? You expect after two years it would still be valid?

Try Google?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
s
soraver
Voice
Posts: 5
Joined: Sat Aug 27, 2005 6:10 pm

Post by soraver »

thanks for the fast reply,
i did google it... a lot!

try yourself if u believe i didnt...

i asked here because its the only place i found a good solution... and because dollar might still be around.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Try looking at dollar's details as there might be a contact address.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
s
soraver
Voice
Posts: 5
Joined: Sat Aug 27, 2005 6:10 pm

Post by soraver »

thats a good idea i sent him a pm....
i hope he'll see it... :s
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

in eggdrop, there is only one feasible way of handling non-standard irc modes - with [bind raw] scripts, and such samples have already been provided on these forums - search for "hardcoded modes", "bind raw", "proc foo"
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
s
soraver
Voice
Posts: 5
Joined: Sat Aug 27, 2005 6:10 pm

Post by soraver »

anyway,
i tried to code a tcl script for checking and forcing +S mode based on this one: http://forum.egghelp.org/viewtopic.php?p=22738#22738

I got bored of it not working and of my non-existant programming skills so here it is for everybody who wants to do the same thing... I'm off it now...
Just posting it to help others, i dont expect any debugging at all.

Code: Select all

set ssl_timer 60
set chanlistS  "#chan1 #chan2"

timer $ssl_timer ssl_test

proc ssl_test {} {
  global chanlistS ssl_timer chanmodes
  foreach chan $chanlistS {
    if {[botisop $chan]} {
      if {[string match *S* $chanmodes($chan)] == "0"} {
        pushmode $chan +S
        flushmode $chan
        putlog "SSL: set +S on $chan"
      }
    }
  }
  timer $ssl_timer ssl_test
}
bind dcc n sslstart ssl_start
proc ssl_start {nick uhost arg} {
  global ssl_timer
  timer $ssl_timer ssl_test
}
putlog "LinkNet +S mode support added"

bind dcc n sslstart2 ssl_start2
proc ssl_start2 {nick uhost arg} {
 ssl_test
}

bind raw - 324 testmodes
proc testmodes {from key arg} {
  global chanmodes
  list $arg
  set chan [lindex $arg 1]
  set modes [lindex $arg 2]
  set chanmodes($chan) $modes
}

bind raw - MODE changemodes
proc changemodes {from key arg} {
  global chanmodes
  list $arg
  set chan [lindex $arg 0]
  set modes [lindex $arg 1]
  if {$chanmodes($chan)} {
    set chanmodes($chan) [replacemodes $chanmodes($chan) $modes]
  } else {
    set chanmodes($chan) [replacemodes [getchanmode $chan] $modes]
  }
}

proc replacemodes {oldmodes newmodes} {
  set newmodes [string trim [string trim $newmodes o] v]
  set all [string length $newmodes]
  set plus [string first + $newmodes]
  set plusl [string last + $newmodes]
  set minus [string first - $newmodes]
  set minusl [string last - $newmodes]
  set outmodes $oldmodes
  if {$all > 1} {
    if {$plus==0 && $minus>0} {
      set x 1
      while {$x<$minus} {
        append outmodes [string index $newmodes $x ]
        incr x
      }
      set x [expr $minus + 1]
      while {$x<=$all} {
        set outmodes [string trim $newmodes $x]
        incr x
      }
    } elseif {$minus==0 && $plus>0} {
      set x 1
      while {$x<$plus} {
        append outmodes [string index $newmodes $x ]
        incr x
      }
      set x [expr $plus + 1]
      while {$x<=$all} {
        set outmodes [string trim $newmodes $x]
        incr x
      }
    } elseif {$plus==0 && $minus==-1} {
      append outmodes $plusl
    } elseif {$minus==0 && $plus==-1} {
      set x 1
      while {$x<=$all} {
        set outmodes [string trim $newmodes $x]
        incr x
      }
    } else { putlog "something smells dirty... have u farted at the channel modes?" }
  } else { putlog "something smells dirty... have u farted at the channel modes?" }
  return $outmodes
}
Post Reply